内置插件¶
¥Built-in plugins¶
Material for MkDocs 最初是MkDocs的一个主题,后来发展成为一个用于构建和维护文档的成熟框架。该主题仍然是项目的核心,但现在它附带了越来越多的互补内置插件。
¥Material for MkDocs started out as a theme for MkDocs, but has since evolved into a full-fledged framework for building and maintaining documentation. The theme is still the core of the project, but it's now accompanied by a growing number of complementary built-in plugins.
我们致力于使这些插件尽可能模块化和通用,以便它们能够应用于各种项目和用例。通过提供实用的默认设置,我们也努力使它们尽可能易于使用,以便您可以快速上手,并在之后调整设置。在开发内置插件时,我们始终遵循以下设计原则:
¥We strive to make those plugins as modular and generic as possible, so that they can be used in a wide variety of projects and use cases. By providing useful default settings, we also try to make them as easy to use as possible, so that you can get started quickly, tweaking their settings later on. When developing built-in plugins, we always adhere to the following design principles:
模块化:内置插件采用模块化设计,以便轻松组合以实现复杂的流程。例如,离线、优化和隐私插件可以一起使用,构建真正支持离线的文档。
互操作性:内置插件的设计尽可能兼容,因此它们可以与其他插件(包括第三方插件)结合使用。我们致力于简化与围绕MkDocs发展起来的庞大生态系统的集成。
性能:内置插件的设计尽可能快速且内存高效,以避免不必要地降低构建速度。这对于包含数千页的大型文档项目尤为重要。
类别¶
¥Categories¶
管理¶
¥Management¶
以下插件通过提供更好的管理功能(从插件、多个项目和元数据的管理到为错误报告创建最少的复制品),极大地改善了处理文档项目时的创作体验:
¥Modularity: Built-in plugins are designed to be modular, so that they can be easily combined to implement sophisticated pipelines. For example, the offline, optimize and privacy plugins can be used together to build truly offline-capable documentation.
内置组插件组插件允许将插件分组为逻辑单元,以便使用环境变量有条件地为特定环境启用或禁用它们。在不同环境中构建时对插件进行最佳管理
内置元插件元插件可以轻松管理文件夹中所有页面的元数据(前言),因此某些页面子集可以使用特定标签或自定义模板。更简单的元数据组织、分类和管理
内置项目插件项目插件允许将主项目拆分为多个不同的项目,同时构建它们并将它们作为一个项目进行预览。将多个项目连接在一起,然后分别构建它们或将它们作为一个项目进行预览。
内置信息插件信息插件是一款小巧实用的实用程序,可帮助您创建独立的最小复现版本,以便维护人员能够更快地修复已报告的错误。您的错误报告质量极高,因此我们可以尽快修复它们。
优化¶
¥Optimization¶
以下插件旨在帮助您构建优化的文档,通过更快的加载时间、更好的搜索引擎排名、社交媒体上漂亮的预览图像以及几行配置符合 GDPR 要求,使您的用户更容易访问它:
¥Interoperability: Built-in plugins are designed to be as compatible as possible, so they can be used in combination with other plugins, including third-party plugins. We strive to make it simple to integrate with the vast ecosystem that has evolved around MkDocs.
内容¶
¥Content¶
以下插件旨在帮助您设置博客、为用户提供搜索功能、为页面和帖子添加标签,并在文档的特定部分使用与主要内容完全相同的排版功能:
¥Performance: Built-in plugins are designed to be as fast and memory-efficient as possible, so that they don't unnecessarily slow down builds. This is particularly important for large documentation projects with thousands of pages.
内置博客插件:该博客插件为 Material for MkDocs 添加了一流的博客支持,既可以作为文档的附属组件,也可以作为独立安装。您的博客与文档使用相同的强大引擎构建。
内置搜索插件该搜索插件在页眉处添加了一个搜索栏,允许用户搜索整个文档,从而更轻松地找到所需内容。您的文档无需任何外部服务即可搜索,即使在离线状态下也是如此。
内置标签插件标签插件新增了使用标签对页面进行分类的高级支持,并添加了对相关页面进行分组的功能,从而改善相关内容的发现。您的页面已使用标签进行分类,从而提供更多上下文信息
内置排版插件排版插件允许在导航和目录中保留标题和标题的丰富呈现。侧边栏保留与页面中章节标题相同的格式
建筑学¶
¥Architecture¶
多个实例¶
¥Multiple instances¶
一些内置插件支持多实例,这意味着它们可以在同一个配置文件中多次使用,从而可以针对项目的不同部分进行行为微调。目前,以下插件支持多实例:
¥The following plugins greatly improve the authoring experience when working on documentation projects by providing better management capabilities, from the management of plugins, multiple projects, and metadata, to the creation of minimal reproductions for bug reports: