内置排版插件¶
¥Built-in typeset plugin¶
排版插件允许在导航和目录中保留标题和标题的丰富呈现方式。这意味着代码块、图标、表情符号和任何其他内联格式都可以完全按照页面内容中的定义进行渲染。
¥The typeset plugin allows to preserve the enriched presentation of titles and headlines within the navigation and table of contents. This means that code blocks, icons, emojis and any other inline formatting can be rendered exactly as defined in the page's content.
仅限赞助商– 此插件目前仅供我们出色的赞助商使用。
¥ Sponsors only – this plugin is currently reserved to our awesome sponsors.
客观的¶
¥Objective¶
工作原理¶
¥How it works¶
在构建项目时,MkDocs 会从标题中提取纯文本并删除原始格式。这通常很有用,也是一个好主意,因为这些信息可以被其他插件使用,而这些插件在传递 HTML 而不是纯文本时可能会出现问题。
¥When building your project, MkDocs extracts the plain text from headlines and drops the original formatting. This is generally useful and a good idea, since this information is made available to other plugins that might have problems when being passed HTML instead of plain text.
然而,这也意味着整个格式都会丢失。
¥However, it also means that the entire formatting is lost.
该插件会挂载到渲染过程中,提取原始标题,并将其提供给模板和插件使用。Material for MkDocs 的模板会使用此信息来渲染导航和目录的增强版本。
¥The plugin hooks into the rendering process, extracts the original headlines, and makes them available to be used in templates and plugins. The templates of Material for MkDocs use this information to render an enriched version of the navigation and table of contents.
何时使用¶
¥When to use it¶
通常建议使用该插件,因为它是一个无需任何配置的嵌入式解决方案,并且设计为开箱即用。由于它不会覆盖现有内容,而只会添加信息,因此预计不会干扰其他插件。
¥It's generally recommended to use the plugin, because it is a drop-in solution that doesn't require any configuration and is designed to work out of the box. Since it doesn't overwrite but only adds information, it's not expected to interfere with other plugins.
配置¶
¥Configuration¶
insiders-4.27.0排版 – 内置
¥ insiders-4.27.0 typeset – built-in
与所有内置插件一样,typeset 插件的使用非常简单。只需将以下几行添加到mkdocs.yml ,然后观察丰富的导航和目录:
¥As with all built-in plugins, getting started with the typeset plugin is straightforward. Just add the following lines to mkdocs.yml, and observe the enriched navigation and table of contents:
排版插件内置于 Material for MkDocs 中,无需安装。
¥The typeset plugin is built into Material for MkDocs and doesn't need to be installed.
一般的¶
¥General¶
可用的设置如下:
¥The following settings are available:
enabled¶
¥enabled¶
insiders-4.27.0真实
¥ insiders-4.27.0 true
使用此设置在构建项目时启用或禁用插件。通常不需要指定此设置,但如果您想禁用插件,请使用:
¥Use this setting to enable or disable the plugin when building your project. It's normally not necessary to specify this setting, but if you want to disable the plugin, use: