Display Config Tips
Highlight notes, hints, and warnings in the text
Reference: admonition
mkdocs.yml markdown_extensions :
- admonition # (1)!
- pymdownx.details # (2)!
- pymdownx.superfences # (3)!
highlight notes, hints, and warnings in the text
detail block(!!! to ???)
code fence
Display code block
Reference: Code blocks
Tabbed display of code blocks
mkdocs.yml markdown_extensions :
- pymdownx.superfences
- pymdownx.tabbed :
alternate_style : true
Add copy, code selection, and annotations to code blocks
mkdocs.yml thema :
features :
- content.code.copy
- content.code.select
- content.code.annotate
Display code
Tip
To highlight using pygments, enable the following comment-outs.
linenums: true
displays the number of lines of code.
The number of lines is displayed without python linenum="1"
.
mkdocs.yml markdown_extensions :
- pymdownx.highlight :
#use_pygments: true
#noclasses: true
#pygments_style: monokai
linenums : true
Display code in admonition
Highlight notes, hints, and warnings in the text 参照
Display emoji
mkdocs.yml markdown_extensions :
- pymdownx.emoji :
emoji_index : !!python/name:materialx.emoji.twemoji
emoji_generator : !!python/name:materialx.emoji.to_svg
Pop-up image display
glightbox plugin.
poetry add mkdocs-glightbox
pip install mkdocs-glightbox