mkdocs-material README

项目的 README,来自 github.com/squidfunk/mkdocs-material。合并为一个 markdown 文件:README.md。

Material for MkDocs

A powerful documentation framework on top of MkDocs

Build Downloads Python Package Index Docker Pulls

Write your documentation in Markdown and create a professional static site for your Open Source or commercial project in minutes – searchable, customizable, more than 60 languages, for all devices.

Material for MkDocs documentation site


[!WARNING]

Material for MkDocs reaches end of life on May 5, 2027. Critical fixes and security updates continue until that date.

We're continuing our work with Zensical, a maintained successor built by the team behind Material for MkDocs. It carries forward what we've learned from building documentation tools with this community, with Markdown authoring, a familiar design, and full control over your content. Zensical is Open Source and MIT-licensed.

You can evaluate Zensical alongside MkDocs using your existing mkdocs.yml. Check plugin compatibility and compare your pages, navigation, search, and customizations before switching. The classic theme variant preserves the appearance of Material for MkDocs. See the migration guide for the steps and current compatibility details.

Upcoming changes on November 5

Quick start

Material for MkDocs requires Python 3.11 or newer. Install it with pip:

pip install mkdocs-material

Add the following lines to mkdocs.yml:

theme:
  name: material

See the installation guide for detailed instructions and the documentation for configuration options.

Used by

Material for MkDocs has been used by projects including FastAPI, Pydantic, Ruff, OpenSSL, AWS Copilot, and Google Accompanist.

Acknowledgments

Thank you to everyone who sponsored Material for MkDocs. Your support made its development possible. We're grateful to the contributors, translators, and users who helped shape the project over the years.

License

MIT License

Copyright (c) 2016-2025 Martin Donath

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mkdocs-material (squidfunk/mkdocs-material)

正在搜索数据库…

这是什么?Material for MkDocs 是一个基于 MkDocs 构建的文档主题和框架,可以把 Markdown 文件转换成专业、可搜索的静态文档网站。
它是 MkDocs 上的主题,还是独立的静态站点生成器?它是扩展 MkDocs 的主题和框架,而不是它的替代品。你仍然用 Markdown 编写内容,由 MkDocs 生成网站,Material 只提供外观、交互效果和插件。
我该如何让它运行起来?用 pip 安装,然后在 mkdocs.yml 中添加几行配置,把它设为主题。
我需要先安装 Python 吗?需要。它是通过 pip 分发的 Python 包,因此必须有可用的 Python/pip 环境。
使用它需要懂 HTML、CSS 或 JavaScript 吗?不需要。这个项目的设计让你只需编写 Markdown 并配置 YAML,HTML、CSS 和 JS 的渲染由它自动完成。
谁已经在生产环境中使用它?它受到大型公司和开源项目的信赖,包括 AWS、Google、Microsoft、Kubernetes、FastAPI 和 Pydantic。
我的文档网站在手机和平板上也能正常使用吗?可以,主题会自动将布局适配到桌面、平板和手机屏幕。
我的文档会托管在第三方平台上吗?不会。你完全拥有源文件和生成的输出文件,因此内容不依赖外部托管服务。
我可以自定义网站的外观吗?可以,通过几行配置就能更改颜色、字体、语言、图标和徽标,而且主题设计上易于扩展。
文档支持多种语言吗?支持,网站内容和搜索功能支持 60 多种语言。
内置搜索功能吗?内置。项目捆绑了基于客户端的搜索,使用 lunr 和 lunr-languages,因此无需服务器,文档开箱即可搜索。
为什么要选它而不是普通的 MkDocs 主题?它针对速度和低资源占用做了优化,同时提供丰富的自定义选项(颜色、字体、图标),并且持续维护,已被 50,000 多名个人和组织使用,功能成熟,经过了实战检验。
作者
squidfunk
大小
144.9 MB
星标
27.6K
时长
10年
提交 · 90 天