MPE: Markdown Preview Enhanced
Read official documents
The setting part of the official document is relatively simple, such as the official document: HTML export. This code is actually written directly in the Markdown file, starting with this, and then writing the body. The purpose of this code is to implement some custom configuration when exporting HTML files.
---
html:
embed_local_images: false
embed_svg: true
offline: false
toc: undefined
print_background: false
---
Copy the code
See the documentation for more options.
Refer to the article
Markdown Preview enhances the fun of writing documents under VSCode
Let me summarize the content of this article here.
Highlight and other extended syntax
{== highlight text ==}
{~~ delete text ~> Replace text ~~}
{>> Hide comments <<}
{++ underline ++}
^ superscript ^~ subscript ~
- emoji
:smile:
The first four extension syntax are said to be CriticMarkup, which seems to work without the outer braces.
drawing
Support for rendering reference official documentation: images
Import other files
And if the imported code can also be executed oh:
@import "code.py" {cmd=/user/bin/python hide}
Copy the code
Table cell merge
Danger: Running code in a document
Turning this on means that if you open someone else’s Markdown document, the code in it will also be executed! So don’t look at someone else’s Markdown file when you open this feature!
The output of the code also goes through the parser, which means you can dynamically output a table, formula, etc.
Generated directory
Most Markdown parsers can now generate directories from [TOC], but this line of code inserts the text of the directory directly into the file, rather than generating it at parse time:
<! -- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=3 orderedList=false} -->Copy the code
Some nice Settings options
Automatic display of browsing effects:
Markdown’s original syntax had to be preceded by a blank line, enforcing segmentation. This option can be newline only, not segment:
The first line can also be wrapped this way, and the distance between it and the previous line is shorter than the paragraph distanceCopy the code
Before, I had to do this line break so that I actually had a new paragraph, and I had a lot of space between the linesCopy the code
Set inline and block to inline.
"markdown-preview-enhanced.mathBlockDelimiters": [["$$"."$$"
],
[
"\ \ ["."\ \]"]],"markdown-preview-enhanced.mathInlineDelimiters": [["$"."$"
],
[
"\\("."\\)"]],Copy the code
Export PDF
Right click preview interface to print PDF, if error:
"princexml" is required to be installed.
Copy the code
Install Prince and add it to the environment variable. Unfortunately, the exported file is not the same as the browse file, and the diagram I drew with Mermaid did not come out…
“Princexml” is required to be installed