Export the document to PDF, once the content is relatively large, if there is no directory jump, it is particularly difficult to find, here is the solution

The first uses CSDN

1. After editing the article, click Export and select export as HTML

2. Select the template to be exported

3. Use the HTML to PDF tool to convert the format

Software download link: https://wkhtmltopdf.org/downloads.htmlCopy the code
Usage:
Wkhtmltopdf -- disabl-smart-shrinking HTML file path Exported PDF file path // HTML path You can use the network pathCopy the code

4. If you don’t like the trouble of downloading software, you can also directly use the browser to export

The second uses the i5TING_TOC tool

This method requires a NodeJS environment

Usage:

Install i5ting_TOC

npm install i5ting_toc -g
Copy the code

The second step uses the transform instruction to first convert the MD into HTML

I5ting_toc-f [need to convert filename].mdCopy the code

The third step is to preview the converted file

I5ting_toc-o // By default, the preview folder is generated in the sibling directoryCopy the code

The fourth step is to use a browser or convert HTML to PDFThe effect is as follows:

The third is to use the VSCode plug-in Markdown Preview Enhanced

Usage:

Step 1: Install the plug-in

Step 2: Open the.md file you want to convert, right-click and choose Open Sync Preview

Step 3 Place the cursor where you want to generate the output of the directory. Right-click to open the command panel and typeMarkdown Preview Enhanced: Create Toc

Step 4 Click Save document to automatically generate a directory

Step 5: Export the format you want. It is recommended to export the HTML and convert it accordingly

The final result is as follows: