mkdocs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MkDocs Documentation Skill

MkDocs 文档构建技能

Build fast, beautiful project documentation with MkDocs and Material for MkDocs theme. This skill covers everything from basic setup to advanced deployment pipelines with versioning.
使用MkDocs和Material for MkDocs主题快速构建美观的项目文档。本技能涵盖从基础搭建到带有版本控制的高级部署流水线的所有内容。

When to Use This Skill

适用场景

USE When

适合使用的情况

  • Building project documentation for open source or internal projects
  • Need a fast, searchable static documentation site
  • Want beautiful Material Design without custom CSS
  • Require multi-version documentation (v1.x, v2.x, etc.)
  • Deploying documentation to GitHub Pages, GitLab Pages, or Netlify
  • Working with Python projects that need docs alongside code
  • Need admonitions, code tabs, and content formatting
  • Want simple Markdown-based documentation workflow
  • Require offline-capable documentation
  • Building API documentation alongside guides
  • 为开源项目或内部项目构建项目文档
  • 需要一个快速、可搜索的静态文档站点
  • 希望无需自定义CSS即可拥有美观的Material Design风格
  • 需要多版本文档(如v1.x、v2.x等)
  • 将文档部署到GitHub Pages、GitLab Pages或Netlify
  • 处理需要与代码配套文档的Python项目
  • 需要Admonition提示块、代码标签页和内容格式化功能
  • 想要基于Markdown的简单文档工作流
  • 需要支持离线访问的文档
  • 同时构建API文档和使用指南

DON'T USE When

不适合使用的情况

  • Need complex React components in docs (use Docusaurus)
  • Require auto-generated Python API docs (use Sphinx)
  • Building single-page documentation (use simple HTML)
  • Need document format conversion (use Pandoc)
  • Require collaborative real-time editing (use GitBook)
  • Building slide presentations (use Marp)
  • 需要在文档中使用复杂React组件(推荐使用Docusaurus)
  • 需要自动生成Python API文档(推荐使用Sphinx)
  • 构建单页文档(推荐使用简单HTML)
  • 需要文档格式转换(推荐使用Pandoc)
  • 需要实时协作编辑功能(推荐使用GitBook)
  • 构建幻灯片演示文稿(推荐使用Marp)

Prerequisites

前置条件

Installation

安装步骤

bash
undefined
bash
undefined

Using pip

使用pip安装

pip install mkdocs mkdocs-material
pip install mkdocs mkdocs-material

Using uv (recommended)

使用uv安装(推荐)

uv pip install mkdocs mkdocs-material
uv pip install mkdocs mkdocs-material

With common plugins

安装常用插件

pip install mkdocs mkdocs-material
mkdocs-minify-plugin
mkdocs-git-revision-date-localized-plugin
mkdocs-macros-plugin
mkdocs-glightbox
mike
pip install mkdocs mkdocs-material
mkdocs-minify-plugin
mkdocs-git-revision-date-localized-plugin
mkdocs-macros-plugin
mkdocs-glightbox
mike

Verify installation

验证安装

mkdocs --version
undefined
mkdocs --version
undefined

System Requirements

系统要求

  • Python 3.8 or higher
  • pip or uv package manager
  • Git (for git-revision plugin and mike)
  • Node.js (optional, for social cards)
  • Python 3.8或更高版本
  • pip或uv包管理器
  • Git(用于git-revision插件和mike)
  • Node.js(可选,用于生成社交卡片)

Core Capabilities

核心功能

1. Project Initialization

1. 项目初始化

bash
undefined
bash
undefined

Create new documentation project

创建新的文档项目

mkdocs new my-project-docs cd my-project-docs
mkdocs new my-project-docs cd my-project-docs

Project structure

项目结构

my-project-docs/

my-project-docs/

├── docs/

├── docs/

│ └── index.md

│ └── index.md

└── mkdocs.yml

└── mkdocs.yml

Or initialize in existing project

或在现有项目中初始化

mkdir -p docs touch docs/index.md touch mkdocs.yml
undefined
mkdir -p docs touch docs/index.md touch mkdocs.yml
undefined

2. Basic Configuration (mkdocs.yml)

2. 基础配置(mkdocs.yml)

yaml
undefined
yaml
undefined

mkdocs.yml - Minimal configuration

mkdocs.yml - 最简配置

site_name: My Project Documentation site_url: https://example.com/docs/ site_description: Comprehensive documentation for My Project site_author: Your Name
site_name: My Project Documentation site_url: https://example.com/docs/ site_description: Comprehensive documentation for My Project site_author: Your Name

Repository

仓库配置

repo_name: username/my-project repo_url: https://github.com/username/my-project edit_uri: edit/main/docs/
repo_name: username/my-project repo_url: https://github.com/username/my-project edit_uri: edit/main/docs/

Theme

主题配置

theme: name: material palette: - scheme: default primary: indigo accent: indigo toggle: icon: material/brightness-7 name: Switch to dark mode - scheme: slate primary: indigo accent: indigo toggle: icon: material/brightness-4 name: Switch to light mode font: text: Roboto code: Roboto Mono features: - navigation.instant - navigation.tracking - navigation.tabs - navigation.sections - navigation.expand - navigation.top - search.suggest - search.highlight - content.tabs.link - content.code.copy - content.code.annotate
theme: name: material palette: - scheme: default primary: indigo accent: indigo toggle: icon: material/brightness-7 name: Switch to dark mode - scheme: slate primary: indigo accent: indigo toggle: icon: material/brightness-4 name: Switch to light mode font: text: Roboto code: Roboto Mono features: - navigation.instant - navigation.tracking - navigation.tabs - navigation.sections - navigation.expand - navigation.top - search.suggest - search.highlight - content.tabs.link - content.code.copy - content.code.annotate

Navigation

导航配置

nav:
  • Home: index.md
  • Getting Started:
    • Installation: getting-started/installation.md
    • Quick Start: getting-started/quickstart.md
    • Configuration: getting-started/configuration.md
  • User Guide:
    • Overview: guide/overview.md
    • Basic Usage: guide/basic-usage.md
    • Advanced: guide/advanced.md
  • API Reference: api/reference.md
  • FAQ: faq.md
  • Changelog: changelog.md
nav:
  • Home: index.md
  • 快速开始:
    • 安装: getting-started/installation.md
    • 快速上手: getting-started/quickstart.md
    • 配置指南: getting-started/configuration.md
  • 用户指南:
    • 概述: guide/overview.md
    • 基础使用: guide/basic-usage.md
    • 高级功能: guide/advanced.md
  • API参考: api/reference.md
  • FAQ: faq.md
  • 更新日志: changelog.md

Plugins

插件配置

plugins:
  • search: lang: en separator: '[\s-,:!=[]()"/]+|(?!\b)(?=[A-Z][a-z])|.(?!\d)|&[lg]t;'
  • minify: minify_html: true
plugins:
  • search: lang: en separator: '[\s-,:!=[]()"/]+|(?!\b)(?=[A-Z][a-z])|.(?!\d)|&[lg]t;'
  • minify: minify_html: true

Markdown extensions

Markdown扩展

markdown_extensions:
  • abbr
  • admonition
  • attr_list
  • def_list
  • footnotes
  • md_in_html
  • toc: permalink: true toc_depth: 3
  • pymdownx.arithmatex: generic: true
  • pymdownx.betterem: smart_enable: all
  • pymdownx.caret
  • pymdownx.details
  • pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg
  • pymdownx.highlight: anchor_linenums: true line_spans: __span pygments_lang_class: true
  • pymdownx.inlinehilite
  • pymdownx.keys
  • pymdownx.magiclink: repo_url_shorthand: true user: username repo: my-project
  • pymdownx.mark
  • pymdownx.smartsymbols
  • pymdownx.superfences: custom_fences: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format
  • pymdownx.tabbed: alternate_style: true
  • pymdownx.tasklist: custom_checkbox: true
  • pymdownx.tilde
markdown_extensions:
  • abbr
  • admonition
  • attr_list
  • def_list
  • footnotes
  • md_in_html
  • toc: permalink: true toc_depth: 3
  • pymdownx.arithmatex: generic: true
  • pymdownx.betterem: smart_enable: all
  • pymdownx.caret
  • pymdownx.details
  • pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg
  • pymdownx.highlight: anchor_linenums: true line_spans: __span pygments_lang_class: true
  • pymdownx.inlinehilite
  • pymdownx.keys
  • pymdownx.magiclink: repo_url_shorthand: true user: username repo: my-project
  • pymdownx.mark
  • pymdownx.smartsymbols
  • pymdownx.superfences: custom_fences: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format
  • pymdownx.tabbed: alternate_style: true
  • pymdownx.tasklist: custom_checkbox: true
  • pymdownx.tilde

Extra

额外配置

extra: social: - icon: fontawesome/brands/github link: https://github.com/username - icon: fontawesome/brands/twitter link: https://twitter.com/username generator: false version: provider: mike
extra: social: - icon: fontawesome/brands/github link: https://github.com/username - icon: fontawesome/brands/twitter link: https://twitter.com/username generator: false version: provider: mike

Copyright

版权信息

copyright: Copyright © 2024-2026 Your Name
undefined
copyright: Copyright © 2024-2026 Your Name
undefined

3. Navigation Structure

3. 导航结构

yaml
undefined
yaml
undefined

mkdocs.yml - Advanced navigation

mkdocs.yml - 高级导航配置

nav:
  • Home: index.md
  • Getting Started:
    • getting-started/index.md
    • Installation:
      • Linux: getting-started/install-linux.md
      • macOS: getting-started/install-macos.md
      • Windows: getting-started/install-windows.md
      • Docker: getting-started/install-docker.md
    • Quick Start: getting-started/quickstart.md
    • Configuration: getting-started/configuration.md
  • User Guide:
    • guide/index.md
    • Core Concepts:
      • Architecture: guide/architecture.md
      • Components: guide/components.md
      • Data Flow: guide/data-flow.md
    • Tutorials:
      • Basic Tutorial: guide/tutorials/basic.md
      • Advanced Tutorial: guide/tutorials/advanced.md
      • Integration: guide/tutorials/integration.md
    • Best Practices: guide/best-practices.md
  • API Reference:
    • api/index.md
    • REST API: api/rest.md
    • Python SDK: api/python-sdk.md
    • CLI Reference: api/cli.md
  • Examples:
    • examples/index.md
    • Basic Examples: examples/basic.md
    • Advanced Examples: examples/advanced.md
  • Contributing: contributing.md
  • Changelog: changelog.md
  • License: license.md
undefined
nav:
  • 首页: index.md
  • 快速开始:
    • getting-started/index.md
    • 安装:
      • Linux: getting-started/install-linux.md
      • macOS: getting-started/install-macos.md
      • Windows: getting-started/install-windows.md
      • Docker: getting-started/install-docker.md
    • 快速上手: getting-started/quickstart.md
    • 配置指南: getting-started/configuration.md
  • 用户指南:
    • guide/index.md
    • 核心概念:
      • 架构: guide/architecture.md
      • 组件: guide/components.md
      • 数据流: guide/data-flow.md
    • 教程:
      • 基础教程: guide/tutorials/basic.md
      • 高级教程: guide/tutorials/advanced.md
      • 集成教程: guide/tutorials/integration.md
    • 最佳实践: guide/best-practices.md
  • API参考:
    • api/index.md
    • REST API: api/rest.md
    • Python SDK: api/python-sdk.md
    • CLI参考: api/cli.md
  • 示例:
    • examples/index.md
    • 基础示例: examples/basic.md
    • 高级示例: examples/advanced.md
  • 贡献指南: contributing.md
  • 更新日志: changelog.md
  • 许可证: license.md
undefined

4. Material Theme Features

4. Material主题功能

yaml
undefined
yaml
undefined

mkdocs.yml - Theme customization

mkdocs.yml - 主题自定义

theme: name: material custom_dir: docs/overrides # Custom templates logo: assets/logo.png favicon: assets/favicon.ico icon: repo: fontawesome/brands/github admonition: note: octicons/tag-16 warning: octicons/alert-16 danger: octicons/zap-16 tip: octicons/light-bulb-16 example: octicons/beaker-16
palette: # Light mode - media: "(prefers-color-scheme: light)" scheme: default primary: deep purple accent: deep purple toggle: icon: material/weather-sunny name: Switch to dark mode # Dark mode - media: "(prefers-color-scheme: dark)" scheme: slate primary: deep purple accent: deep purple toggle: icon: material/weather-night name: Switch to light mode
features: # Navigation - navigation.instant - navigation.instant.progress - navigation.tracking - navigation.tabs - navigation.tabs.sticky - navigation.sections - navigation.expand - navigation.path - navigation.prune - navigation.indexes - navigation.top - navigation.footer # Table of contents - toc.follow - toc.integrate # Search - search.suggest - search.highlight - search.share # Header - header.autohide # Content - content.tabs.link - content.code.copy - content.code.select - content.code.annotate - content.tooltips # Announce - announce.dismiss
undefined
theme: name: material custom_dir: docs/overrides # 自定义模板目录 logo: assets/logo.png favicon: assets/favicon.ico icon: repo: fontawesome/brands/github admonition: note: octicons/tag-16 warning: octicons/alert-16 danger: octicons/zap-16 tip: octicons/light-bulb-16 example: octicons/beaker-16
palette: # 浅色模式 - media: "(prefers-color-scheme: light)" scheme: default primary: deep purple accent: deep purple toggle: icon: material/weather-sunny name: 切换到深色模式 # 深色模式 - media: "(prefers-color-scheme: dark)" scheme: slate primary: deep purple accent: deep purple toggle: icon: material/weather-night name: 切换到浅色模式
features: # 导航功能 - navigation.instant - navigation.instant.progress - navigation.tracking - navigation.tabs - navigation.tabs.sticky - navigation.sections - navigation.expand - navigation.path - navigation.prune - navigation.indexes - navigation.top - navigation.footer # 目录功能 - toc.follow - toc.integrate # 搜索功能 - search.suggest - search.highlight - search.share # 头部功能 - header.autohide # 内容功能 - content.tabs.link - content.code.copy - content.code.select - content.code.annotate - content.tooltips # 公告功能 - announce.dismiss
undefined

5. Admonitions and Call-outs

5. Admonition提示块与标注

markdown
<!-- docs/guide/admonitions.md -->
markdown
<!-- docs/guide/admonitions.md -->

Using Admonitions

使用Admonition提示块

MkDocs Material supports various admonition types for highlighting content.
MkDocs Material支持多种类型的Admonition提示块,用于高亮显示内容。

Note

注意

!!! note "Important Note" This is a note admonition. Use it for general information that readers should pay attention to.
!!! note "重要提示" 这是一个注意类型的提示块,用于展示读者需要关注的通用信息。

Tip

技巧

!!! tip "Pro Tip" Use tips to share best practices and helpful suggestions that improve the reader's experience.
!!! tip "专业技巧" 使用技巧提示块分享最佳实践和实用建议,提升读者的使用体验。

Warning

警告

!!! warning "Caution" Warnings alert readers to potential issues or important considerations they should be aware of.
!!! warning "注意" 警告提示块用于提醒读者潜在的问题或需要重点考虑的事项。

Danger

危险

!!! danger "Critical Warning" Use danger for critical warnings about actions that could cause data loss or security issues.
!!! danger "严重警告" 危险提示块用于展示可能导致数据丢失或安全问题的关键警告。

Example

示例

!!! example "Code Example"
python     def greet(name: str) -> str:         """Return a greeting message."""         return f"Hello, {name}!"     
!!! example "代码示例"
python     def greet(name: str) -> str:         """返回问候消息。"""         return f"Hello, {name}!"     

Info

信息

!!! info "Additional Information" Info admonitions provide supplementary details that enhance understanding.
!!! info "补充信息" 信息提示块提供补充细节,帮助读者更好地理解内容。

Success

成功

!!! success "Completed Successfully" Use success to indicate completed actions or successful outcomes.
!!! success "操作成功" 成功提示块用于标记已完成的操作或成功的结果。

Question

问题

!!! question "FAQ" Use question admonitions for frequently asked questions sections.
!!! question "常见问题" 问题提示块用于常见问题(FAQ)部分。

Quote

引用

!!! quote "Notable Quote" "Documentation is a love letter that you write to your future self." - Damian Conway
!!! quote "经典名言" "文档是你写给未来自己的一封情书。" - Damian Conway

Collapsible Admonitions

可折叠提示块

??? note "Click to expand" This admonition is collapsed by default. Click the title to expand it.
???+ tip "Expanded by default" This admonition uses
???+
to be expanded by default but can be collapsed by the reader.
??? note "点击展开" 这个提示块默认是折叠状态,点击标题即可展开。
???+ tip "默认展开" 这个提示块使用
???+
语法,默认展开,读者也可以将其折叠。

Inline Admonitions

内联提示块

!!! info inline "Inline Left" This appears inline on the left.
!!! tip inline end "Inline Right" This appears inline on the right.
undefined
!!! info inline "左侧内联" 这个提示块会在左侧内联显示。
!!! tip inline end "右侧内联" 这个提示块会在右侧内联显示。
undefined

6. Code Blocks with Features

6. 代码块功能

markdown
<!-- docs/guide/code-blocks.md -->
markdown
<!-- docs/guide/code-blocks.md -->

Code Block Features

代码块功能

Basic Code Block

基础代码块

python
def hello_world():
    print("Hello, World!")
python
def hello_world():
    print("Hello, World!")

With Title

带标题的代码块

python
def hello_world():
    print("Hello, World!")
python
def hello_world():
    print("Hello, World!")

Line Numbers

显示行号

python
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)
python
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)

Line Highlighting

高亮指定行

python
def process_data(data):
    validated = validate(data)  # highlighted
    transformed = transform(validated)
    return save(transformed)  # highlighted
python
def process_data(data):
    validated = validate(data)  # 高亮行
    transformed = transform(validated)
    return save(transformed)  # 高亮行

Line Number Start

自定义起始行号

python
undefined
python
undefined

This code block starts at line 42

此代码块从第42行开始编号

def answer(): return 42
undefined
def answer(): return 42
undefined

Code Annotations

代码注释标注

python
def calculate_area(radius: float) -> float:  # (1)!
    """Calculate the area of a circle."""
    import math  # (2)!
    return math.pi * radius ** 2  # (3)!
  1. Type hints improve code readability
  2. Import inside function for demonstration
  3. Uses the formula: A = pi * r^2
python
def calculate_area(radius: float) -> float:  # (1)!
    """计算圆的面积。"""
    import math  # (2)!
    return math.pi * radius ** 2  # (3)!
  1. 类型提示提升代码可读性
  2. 仅为演示在函数内部导入模块
  3. 使用公式:A = π * r²

Tabbed Code Blocks

标签页式代码块

=== "Python"
python     def greet(name):         return f"Hello, {name}!"     
=== "JavaScript"
javascript     function greet(name) {         return `Hello, ${name}!`;     }     
=== "Go"
go     func greet(name string) string {         return fmt.Sprintf("Hello, %s!", name)     }     
=== "Rust"
rust     fn greet(name: &str) -> String {         format!("Hello, {}!", name)     }     
=== "Python"
python     def greet(name):         return f"Hello, {name}!"     
=== "JavaScript"
javascript     function greet(name) {         return `Hello, ${name}!`;     }     
=== "Go"
go     func greet(name string) string {         return fmt.Sprintf("Hello, %s!", name)     }     
=== "Rust"
rust     fn greet(name: &str) -> String {         format!("Hello, {}!", name)     }     

Inline Code

行内代码

Use
pip install mkdocs
to install MkDocs.
The
#!python print()
function outputs text to the console.
undefined
使用
pip install mkdocs
命令安装MkDocs。
#!python print()
函数用于向控制台输出文本。
undefined

7. Mermaid Diagrams

7. Mermaid图表

markdown
<!-- docs/guide/diagrams.md -->
markdown
<!-- docs/guide/diagrams.md -->

Diagrams with Mermaid

使用Mermaid绘制图表

Flowchart

流程图

mermaid
flowchart TD
    A[Start] --> B{Is it valid?}
    B -->|Yes| C[Process Data]
    B -->|No| D[Show Error]
    C --> E[Save Results]
    D --> F[Log Error]
    E --> G[End]
    F --> G
mermaid
flowchart TD
    A[开始] --> B{是否有效?}
    B -->|是| C[处理数据]
    B -->|否| D[显示错误]
    C --> E[保存结果]
    D --> F[记录错误]
    E --> G[结束]
    F --> G

Sequence Diagram

序列图

mermaid
sequenceDiagram
    participant U as User
    participant A as API
    participant D as Database

    U->>A: POST /api/data
    A->>A: Validate request
    A->>D: INSERT data
    D-->>A: Success
    A-->>U: 201 Created
mermaid
sequenceDiagram
    participant U as 用户
    participant A as API
    participant D as 数据库

    U->>A: POST /api/data
    A->>A: 验证请求
    A->>D: 插入数据
    D-->>A: 操作成功
    A-->>U: 201 Created

Class Diagram

类图

mermaid
classDiagram
    class Document {
        +String title
        +String content
        +Date created
        +save()
        +delete()
    }
    class Page {
        +int pageNumber
        +String markdown
        +render()
    }
    class Navigation {
        +List~Page~ pages
        +addPage()
        +removePage()
    }
    Document "1" --> "*" Page
    Navigation "1" --> "*" Page
mermaid
classDiagram
    class Document {
        +String title
        +String content
        +Date created
        +save()
        +delete()
    }
    class Page {
        +int pageNumber
        +String markdown
        +render()
    }
    class Navigation {
        +List~Page~ pages
        +addPage()
        +removePage()
    }
    Document "1" --> "*" Page
    Navigation "1" --> "*" Page

State Diagram

状态图

mermaid
stateDiagram-v2
    [*] --> Draft
    Draft --> Review: Submit
    Review --> Approved: Accept
    Review --> Draft: Request Changes
    Approved --> Published: Publish
    Published --> [*]
mermaid
stateDiagram-v2
    [*] --> 草稿
    草稿 --> 审核: 提交
    审核 --> 批准: 通过
    审核 --> 草稿: 请求修改
    批准 --> 发布: 发布
    发布 --> [*]

Entity Relationship

实体关系图

mermaid
erDiagram
    USER ||--o{ POST : creates
    USER ||--o{ COMMENT : writes
    POST ||--|{ COMMENT : contains
    POST }|..|{ TAG : has
mermaid
erDiagram
    USER ||--o{ POST : 创建
    USER ||--o{ COMMENT : 撰写
    POST ||--|{ COMMENT : 包含
    POST }|..|{ TAG : 关联

Gantt Chart

甘特图

mermaid
gantt
    title Documentation Project
    dateFormat  YYYY-MM-DD
    section Phase 1
    Research           :a1, 2024-01-01, 7d
    Outline            :a2, after a1, 3d
    section Phase 2
    Writing            :b1, after a2, 14d
    Review             :b2, after b1, 7d
    section Phase 3
    Publishing         :c1, after b2, 3d
undefined
mermaid
gantt
    title 文档项目进度
    dateFormat  YYYY-MM-DD
    section 第一阶段
    调研           :a1, 2024-01-01, 7d
    大纲编写            :a2, after a1, 3d
    section 第二阶段
    内容编写            :b1, after a2, 14d
    内容审核             :b2, after b1, 7d
    section 第三阶段
    发布         :c1, after b2, 3d
undefined

8. Plugin Configuration

8. 插件配置

yaml
undefined
yaml
undefined

mkdocs.yml - Comprehensive plugin setup

mkdocs.yml - 完整插件配置

plugins:

Built-in search

  • search: lang: en separator: '[\s-,:!=[]()"/]+|(?!\b)(?=[A-Z][a-z])|.(?!\d)|&[lg]t;' pipeline: - stemmer - stopWordFilter - trimmer

Minification

  • minify: minify_html: true minify_js: true minify_css: true htmlmin_opts: remove_comments: true

Git revision date

  • git-revision-date-localized: type: timeago timezone: UTC locale: en fallback_to_build_date: true enable_creation_date: true

Macros for variables and templating

  • macros: include_dir: docs/includes module_name: docs/macros

Image lightbox

  • glightbox: touchNavigation: true loop: false effect: zoom width: 100% height: auto zoomable: true draggable: true

Social cards (requires dependencies)

  • social: cards_layout: default

Tags

  • tags: tags_file: tags.md

Blog (Material Insiders)

- blog:

blog_dir: blog

post_date_format: long

undefined
plugins:

内置搜索插件

  • search: lang: en separator: '[\s-,:!=[]()"/]+|(?!\b)(?=[A-Z][a-z])|.(?!\d)|&[lg]t;' pipeline: - stemmer - stopWordFilter - trimmer

资源压缩插件

  • minify: minify_html: true minify_js: true minify_css: true htmlmin_opts: remove_comments: true

Git修订日期插件

  • git-revision-date-localized: type: timeago timezone: UTC locale: en fallback_to_build_date: true enable_creation_date: true

宏插件(用于变量和模板)

  • macros: include_dir: docs/includes module_name: docs/macros

图片灯箱插件

  • glightbox: touchNavigation: true loop: false effect: zoom width: 100% height: auto zoomable: true draggable: true

社交卡片插件(需要依赖)

  • social: cards_layout: default

标签插件

  • tags: tags_file: tags.md

博客插件(Material Insiders 专属)

- blog:

blog_dir: blog

post_date_format: long

undefined

9. Versioning with Mike

9. 基于mike的版本控制

bash
undefined
bash
undefined

Install mike

安装mike

pip install mike
pip install mike

Initialize versioning

初始化版本控制

mike deploy --push --update-aliases 1.0 latest
mike deploy --push --update-aliases 1.0 latest

Deploy a new version

部署新版本

mike deploy --push --update-aliases 2.0 latest
mike deploy --push --update-aliases 2.0 latest

Set default version

设置默认版本

mike set-default --push latest
mike set-default --push latest

Delete a version

删除版本

mike delete --push 1.0
mike delete --push 1.0

List versions

列出所有版本

mike list
mike list

Serve versioned docs locally

本地运行带版本的文档

mike serve

```yaml
mike serve

```yaml

mkdocs.yml - Mike configuration

mkdocs.yml - mike配置

extra: version: provider: mike default: latest
undefined
extra: version: provider: mike default: latest
undefined

10. Custom CSS and JavaScript

10. 自定义CSS和JavaScript

yaml
undefined
yaml
undefined

mkdocs.yml

mkdocs.yml

extra_css:

```css
/* docs/stylesheets/extra.css */

/* Custom color scheme */
:root {
  --md-primary-fg-color: #6200ea;
  --md-primary-fg-color--light: #9d46ff;
  --md-primary-fg-color--dark: #0a00b6;
  --md-accent-fg-color: #ff6d00;
}

/* Custom admonition */
:root {
  --md-admonition-icon--custom: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>');
}

.md-typeset .admonition.custom,
.md-typeset details.custom {
  border-color: #6200ea;
}

.md-typeset .custom > .admonition-title,
.md-typeset .custom > summary {
  background-color: rgba(98, 0, 234, 0.1);
}

.md-typeset .custom > .admonition-title::before,
.md-typeset .custom > summary::before {
  background-color: #6200ea;
  -webkit-mask-image: var(--md-admonition-icon--custom);
  mask-image: var(--md-admonition-icon--custom);
}

/* Code block styling */
.md-typeset code {
  border-radius: 4px;
}

/* Navigation tweaks */
.md-nav__link {
  font-size: 0.75rem;
}

/* Table styling */
.md-typeset table:not([class]) {
  font-size: 0.8rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: white;
}
javascript
// docs/javascripts/extra.js

// Add copy button feedback
document.addEventListener('DOMContentLoaded', function() {
  document.querySelectorAll('.md-clipboard').forEach(function(button) {
    button.addEventListener('click', function() {
      const originalText = this.getAttribute('data-clipboard-text');
      console.log('Copied:', originalText.substring(0, 50) + '...');
    });
  });
});

// Custom analytics event
function trackDocSection(section) {
  if (typeof gtag !== 'undefined') {
    gtag('event', 'view_section', {
      'section_name': section
    });
  }
}

// Smooth scroll enhancement
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
  anchor.addEventListener('click', function(e) {
    e.preventDefault();
    document.querySelector(this.getAttribute('href')).scrollIntoView({
      behavior: 'smooth'
    });
  });
});
extra_css:

```css
/* docs/stylesheets/extra.css */

/* 自定义配色方案 */
:root {
  --md-primary-fg-color: #6200ea;
  --md-primary-fg-color--light: #9d46ff;
  --md-primary-fg-color--dark: #0a00b6;
  --md-accent-fg-color: #ff6d00;
}

/* 自定义Admonition提示块 */
:root {
  --md-admonition-icon--custom: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>');
}

.md-typeset .admonition.custom,
.md-typeset details.custom {
  border-color: #6200ea;
}

.md-typeset .custom > .admonition-title,
.md-typeset .custom > summary {
  background-color: rgba(98, 0, 234, 0.1);
}

.md-typeset .custom > .admonition-title::before,
.md-typeset .custom > summary::before {
  background-color: #6200ea;
  -webkit-mask-image: var(--md-admonition-icon--custom);
  mask-image: var(--md-admonition-icon--custom);
}

/* 代码块样式 */
.md-typeset code {
  border-radius: 4px;
}

/* 导航调整 */
.md-nav__link {
  font-size: 0.75rem;
}

/* 表格样式 */
.md-typeset table:not([class]) {
  font-size: 0.8rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: white;
}
javascript
// docs/javascripts/extra.js

// 添加复制按钮反馈
document.addEventListener('DOMContentLoaded', function() {
  document.querySelectorAll('.md-clipboard').forEach(function(button) {
    button.addEventListener('click', function() {
      const originalText = this.getAttribute('data-clipboard-text');
      console.log('已复制:', originalText.substring(0, 50) + '...');
    });
  });
});

// 自定义分析事件
function trackDocSection(section) {
  if (typeof gtag !== 'undefined') {
    gtag('event', 'view_section', {
      'section_name': section
    });
  }
}

// 平滑滚动增强
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
  anchor.addEventListener('click', function(e) {
    e.preventDefault();
    document.querySelector(this.getAttribute('href')).scrollIntoView({
      behavior: 'smooth'
    });
  });
});

11. GitHub Pages Deployment

11. 部署到GitHub Pages

yaml
undefined
yaml
undefined

.github/workflows/docs.yml

.github/workflows/docs.yml

name: Deploy Documentation
on: push: branches: - main paths: - 'docs/**' - 'mkdocs.yml' - '.github/workflows/docs.yml' workflow_dispatch:
permissions: contents: write pages: write id-token: write
jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 # Required for git-revision-date plugin
  - name: Setup Python
    uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: Cache dependencies
    uses: actions/cache@v4
    with:
      path: ~/.cache/pip
      key: ${{ runner.os }}-pip-${{ hashFiles('requirements-docs.txt') }}
      restore-keys: |
        ${{ runner.os }}-pip-

  - name: Install dependencies
    run: |
      pip install -r requirements-docs.txt

  - name: Build documentation
    run: mkdocs build --strict

  - name: Deploy to GitHub Pages
    uses: peaceiris/actions-gh-pages@v4
    with:
      github_token: ${{ secrets.GITHUB_TOKEN }}
      publish_dir: ./site
      cname: docs.example.com  # Optional custom domain

```text
name: 部署文档
on: push: branches: - main paths: - 'docs/**' - 'mkdocs.yml' - '.github/workflows/docs.yml' workflow_dispatch:
permissions: contents: write pages: write id-token: write
jobs: build: runs-on: ubuntu-latest steps: - name: 检出代码 uses: actions/checkout@v4 with: fetch-depth: 0 # git-revision-date插件需要完整的Git历史
  - name: 设置Python环境
    uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: 缓存依赖
    uses: actions/cache@v4
    with:
      path: ~/.cache/pip
      key: ${{ runner.os }}-pip-${{ hashFiles('requirements-docs.txt') }}
      restore-keys: |
        ${{ runner.os }}-pip-

  - name: 安装依赖
    run: |
      pip install -r requirements-docs.txt

  - name: 构建文档
    run: mkdocs build --strict

  - name: 部署到GitHub Pages
    uses: peaceiris/actions-gh-pages@v4
    with:
      github_token: ${{ secrets.GITHUB_TOKEN }}
      publish_dir: ./site
      cname: docs.example.com  # 可选自定义域名

```text

requirements-docs.txt

requirements-docs.txt

mkdocs>=1.5.0 mkdocs-material>=9.5.0 mkdocs-minify-plugin>=0.7.0 mkdocs-git-revision-date-localized-plugin>=1.2.0 mkdocs-glightbox>=0.3.0 pymdown-extensions>=10.0 pillow>=10.0.0 cairosvg>=2.7.0 mike>=2.0.0
undefined
mkdocs>=1.5.0 mkdocs-material>=9.5.0 mkdocs-minify-plugin>=0.7.0 mkdocs-git-revision-date-localized-plugin>=1.2.0 mkdocs-glightbox>=0.3.0 pymdown-extensions>=10.0 pillow>=10.0.0 cairosvg>=2.7.0 mike>=2.0.0
undefined

12. Versioned Deployment with Mike

12. 基于mike的版本化部署

yaml
undefined
yaml
undefined

.github/workflows/docs-versioned.yml

.github/workflows/docs-versioned.yml

name: Deploy Versioned Docs
on: push: tags: - 'v*' workflow_dispatch: inputs: version: description: 'Version to deploy (e.g., 1.0)' required: true alias: description: 'Alias (e.g., latest)' required: false default: 'latest'
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0
  - uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: Install dependencies
    run: pip install -r requirements-docs.txt

  - name: Configure Git
    run: |
      git config user.name "github-actions[bot]"
      git config user.email "github-actions[bot]@users.noreply.github.com"

  - name: Get version from tag
    id: version
    run: |
      if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
        echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
        echo "ALIAS=${{ github.event.inputs.alias }}" >> $GITHUB_OUTPUT
      else
        VERSION=${GITHUB_REF#refs/tags/v}
        MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2)
        echo "VERSION=$MAJOR_MINOR" >> $GITHUB_OUTPUT
        echo "ALIAS=latest" >> $GITHUB_OUTPUT
      fi

  - name: Deploy with mike
    run: |
      mike deploy --push --update-aliases \
        ${{ steps.version.outputs.VERSION }} \
        ${{ steps.version.outputs.ALIAS }}
      mike set-default --push latest
undefined
name: 部署版本化文档
on: push: tags: - 'v*' workflow_dispatch: inputs: version: description: '要部署的版本(如1.0)' required: true alias: description: '版本别名(如latest)' required: false default: 'latest'
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0
  - uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: 安装依赖
    run: pip install -r requirements-docs.txt

  - name: 配置Git
    run: |
      git config user.name "github-actions[bot]"
      git config user.email "github-actions[bot]@users.noreply.github.com"

  - name: 从标签中获取版本
    id: version
    run: |
      if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
        echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
        echo "ALIAS=${{ github.event.inputs.alias }}" >> $GITHUB_OUTPUT
      else
        VERSION=${GITHUB_REF#refs/tags/v}
        MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2)
        echo "VERSION=$MAJOR_MINOR" >> $GITHUB_OUTPUT
        echo "ALIAS=latest" >> $GITHUB_OUTPUT
      fi

  - name: 使用mike部署
    run: |
      mike deploy --push --update-aliases \
        ${{ steps.version.outputs.VERSION }} \
        ${{ steps.version.outputs.ALIAS }}
      mike set-default --push latest
undefined

Integration Examples

集成示例

Integration with Python Package

与Python包集成

my-python-package/
├── src/
│   └── mypackage/
│       ├── __init__.py
│       └── core.py
├── docs/
│   ├── index.md
│   ├── getting-started/
│   ├── api/
│   └── assets/
├── tests/
├── mkdocs.yml
├── pyproject.toml
└── README.md
yaml
undefined
my-python-package/
├── src/
│   └── mypackage/
│       ├── __init__.py
│       └── core.py
├── docs/
│   ├── index.md
│   ├── getting-started/
│   ├── api/
│   └── assets/
├── tests/
├── mkdocs.yml
├── pyproject.toml
└── README.md
yaml
undefined

mkdocs.yml for Python package

Python包的mkdocs.yml配置

site_name: MyPackage site_url: https://username.github.io/mypackage/
theme: name: material features: - content.code.copy
plugins:
  • search
  • mkdocstrings: handlers: python: paths: [src] options: docstring_style: google show_source: true
nav:
  • Home: index.md
  • Getting Started: getting-started.md
  • API Reference:
    • api/index.md
    • Core Module: api/core.md
  • Changelog: changelog.md
undefined
site_name: MyPackage site_url: https://username.github.io/mypackage/
theme: name: material features: - content.code.copy
plugins:
  • search
  • mkdocstrings: handlers: python: paths: [src] options: docstring_style: google show_source: true
nav:
  • 首页: index.md
  • 快速开始: getting-started.md
  • API参考:
    • api/index.md
    • 核心模块: api/core.md
  • 更新日志: changelog.md
undefined

Integration with Monorepo

与单体仓库(Monorepo)集成

yaml
undefined
yaml
undefined

mkdocs.yml for monorepo

单体仓库的mkdocs.yml配置

site_name: Monorepo Documentation
nav:
  • Home: index.md
  • Packages:
    • Package A: packages/package-a/README.md
    • Package B: packages/package-b/README.md
  • Shared:
    • Contributing: CONTRIBUTING.md
    • Code of Conduct: CODE_OF_CONDUCT.md
plugins:
  • search
  • monorepo
site_name: 单体仓库文档
nav:
  • 首页: index.md
  • 包:
    • 包A: packages/package-a/README.md
    • 包B: packages/package-b/README.md
  • 共享文档:
    • 贡献指南: CONTRIBUTING.md
    • 行为准则: CODE_OF_CONDUCT.md
plugins:
  • search
  • monorepo

Reference files outside docs/

引用docs目录外的文件

docs_dir: .
undefined
docs_dir: .
undefined

Integration with CI Testing

与CI测试集成

yaml
undefined
yaml
undefined

.github/workflows/test-docs.yml

.github/workflows/test-docs.yml

name: Test Documentation
on: pull_request: paths: - 'docs/**' - 'mkdocs.yml'
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
  - uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: Install dependencies
    run: pip install -r requirements-docs.txt

  - name: Build documentation (strict mode)
    run: mkdocs build --strict

  - name: Check links
    run: |
      pip install linkchecker
      mkdocs serve &
      sleep 5
      linkchecker http://127.0.0.1:8000 --check-extern

  - name: Lint Markdown
    run: |
      npm install -g markdownlint-cli
      markdownlint docs/**/*.md
undefined
name: 测试文档
on: pull_request: paths: - 'docs/**' - 'mkdocs.yml'
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
  - uses: actions/setup-python@v5
    with:
      python-version: '3.11'

  - name: 安装依赖
    run: pip install -r requirements-docs.txt

  - name: 构建文档(严格模式)
    run: mkdocs build --strict

  - name: 检查链接
    run: |
      pip install linkchecker
      mkdocs serve &
      sleep 5
      linkchecker http://127.0.0.1:8000 --check-extern

  - name: 检查Markdown格式
    run: |
      npm install -g markdownlint-cli
      markdownlint docs/**/*.md
undefined

Best Practices

最佳实践

1. Documentation Structure

1. 文档结构

docs/
├── index.md                    # Landing page
├── getting-started/
│   ├── index.md               # Section overview
│   ├── installation.md
│   ├── quickstart.md
│   └── configuration.md
├── user-guide/
│   ├── index.md
│   ├── concepts.md
│   ├── tutorials/
│   │   ├── basic.md
│   │   └── advanced.md
│   └── best-practices.md
├── api/
│   ├── index.md
│   └── reference.md
├── contributing/
│   ├── index.md
│   ├── development.md
│   └── style-guide.md
├── changelog.md
├── assets/
│   ├── images/
│   ├── stylesheets/
│   └── javascripts/
└── includes/                   # Reusable snippets
    └── abbreviations.md
docs/
├── index.md                    # 首页
├── getting-started/
│   ├── index.md               # 章节概述
│   ├── installation.md
│   ├── quickstart.md
│   └── configuration.md
├── user-guide/
│   ├── index.md
│   ├── concepts.md
│   ├── tutorials/
│   │   ├── basic.md
│   │   └── advanced.md
│   └── best-practices.md
├── api/
│   ├── index.md
│   └── reference.md
├── contributing/
│   ├── index.md
│   ├── development.md
│   └── style-guide.md
├── changelog.md
├── assets/
│   ├── images/
│   ├── stylesheets/
│   └── javascripts/
└── includes/                   # 可复用代码片段
    └── abbreviations.md

2. Page Template

2. 页面模板

markdown
---
title: Page Title
description: Brief description for SEO and social sharing
---
markdown
---
title: 页面标题
description: 用于SEO和社交分享的简短描述
---

Page Title

页面标题

Brief introduction explaining what this page covers.
简要介绍本页面的内容。

Prerequisites

前置条件

  • Prerequisite 1
  • Prerequisite 2
  • 前置条件1
  • 前置条件2

Section 1

章节1

Content with examples...
内容及示例...

Subsection 1.1

子章节1.1

More details...
更多细节...

Section 2

章节2

Additional content...
补充内容...

Examples

示例

!!! example "Example Title"
python     # Code example     pass     
!!! example "示例标题"
python     # 代码示例     pass     

See Also

相关链接

  • Related Page 1
  • Related Page 2
undefined
  • 相关页面1
  • 相关页面2
undefined

3. Abbreviations

3. 缩写定义

markdown
<!-- docs/includes/abbreviations.md -->
*[HTML]: Hyper Text Markup Language
*[API]: Application Programming Interface
*[CLI]: Command Line Interface
*[CSS]: Cascading Style Sheets
*[JSON]: JavaScript Object Notation
*[YAML]: YAML Ain't Markup Language
*[REST]: Representational State Transfer
*[SDK]: Software Development Kit
*[URL]: Uniform Resource Locator
*[CI]: Continuous Integration
*[CD]: Continuous Deployment
yaml
undefined
markdown
<!-- docs/includes/abbreviations.md -->
*[HTML]: 超文本标记语言
*[API]: 应用程序编程接口
*[CLI]: 命令行界面
*[CSS]: 层叠样式表
*[JSON]: JavaScript对象表示法
*[YAML]: YAML不是标记语言
*[REST]: 表述性状态转移
*[SDK]: 软件开发工具包
*[URL]: 统一资源定位符
*[CI]: 持续集成
*[CD]: 持续部署
yaml
undefined

mkdocs.yml

mkdocs.yml配置

markdown_extensions:
  • abbr
  • pymdownx.snippets: auto_append: - docs/includes/abbreviations.md
undefined
markdown_extensions:
  • abbr
  • pymdownx.snippets: auto_append: - docs/includes/abbreviations.md
undefined

4. SEO Optimization

4. SEO优化

yaml
undefined
yaml
undefined

mkdocs.yml

mkdocs.yml配置

plugins:
  • search
  • social
  • meta
extra: social: - icon: fontawesome/brands/twitter link: https://twitter.com/username analytics: provider: google property: G-XXXXXXXXXX
undefined
plugins:
  • search
  • social
  • meta
extra: social: - icon: fontawesome/brands/twitter link: https://twitter.com/username analytics: provider: google property: G-XXXXXXXXXX
undefined

5. Performance Optimization

5. 性能优化

yaml
undefined
yaml
undefined

mkdocs.yml - Performance settings

mkdocs.yml - 性能设置

theme: features: - navigation.instant # Preload pages - navigation.prune # Reduce navigation size
plugins:
  • minify: minify_html: true minify_js: true minify_css: true
  • optimize: enabled: true
undefined
theme: features: - navigation.instant # 预加载页面 - navigation.prune # 减少导航体积
plugins:
  • minify: minify_html: true minify_js: true minify_css: true
  • optimize: enabled: true
undefined

Troubleshooting

故障排除

Common Issues

常见问题

Build Fails with "Page not in nav"

构建失败,提示“Page not in nav”

yaml
undefined
yaml
undefined

mkdocs.yml - Allow pages not in nav

mkdocs.yml - 允许导航中未包含的页面

validation: nav: omitted_files: info not_found: warn absolute_links: info
undefined
validation: nav: omitted_files: info not_found: warn absolute_links: info
undefined

Mermaid Diagrams Not Rendering

Mermaid图表无法渲染

yaml
undefined
yaml
undefined

Ensure superfences is configured correctly

确保superfences配置正确

markdown_extensions:
  • pymdownx.superfences: custom_fences: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format
undefined
markdown_extensions:
  • pymdownx.superfences: custom_fences: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format
undefined

Search Not Working

搜索功能无法使用

yaml
undefined
yaml
undefined

Check search configuration

检查搜索插件配置

plugins:
  • search: lang: en prebuild_index: true # Build search index at build time
undefined
plugins:
  • search: lang: en prebuild_index: true # 在构建时预先生成搜索索引
undefined

Git Revision Plugin Fails

Git Revision插件运行失败

bash
undefined
bash
undefined

Ensure git history is available

确保Git历史可用

git fetch --unshallow # In CI environments
git fetch --unshallow # 在CI环境中执行

Or disable in mkdocs.yml for local testing

或在本地测试时禁用该插件

plugins:
  • git-revision-date-localized: fallback_to_build_date: true
undefined
plugins:
  • git-revision-date-localized: fallback_to_build_date: true
undefined

Social Cards Generation Fails

社交卡片生成失败

bash
undefined
bash
undefined

Install required dependencies

安装所需依赖

pip install pillow cairosvg
pip install pillow cairosvg

On Ubuntu

在Ubuntu上

apt-get install libcairo2-dev libffi-dev
apt-get install libcairo2-dev libffi-dev

On macOS

在macOS上

brew install cairo
undefined
brew install cairo
undefined

Debug Mode

调试模式

bash
undefined
bash
undefined

Verbose build output

详细构建输出

mkdocs build --verbose
mkdocs build --verbose

Serve with debug info

带调试信息运行本地服务

mkdocs serve --verbose --dev-addr 0.0.0.0:8000
mkdocs serve --verbose --dev-addr 0.0.0.0:8000

Strict mode catches warnings as errors

严格模式(将警告视为错误)

mkdocs build --strict
undefined
mkdocs build --strict
undefined

Version History

版本历史

v1.0.0 (2026-01-17)

v1.0.0(2026-01-17)

  • Initial skill creation
  • Material for MkDocs theme configuration
  • Plugin ecosystem documentation
  • GitHub Pages deployment workflows
  • Versioning with mike
  • Mermaid diagrams integration
  • Custom CSS/JS extensions
  • Best practices and troubleshooting
  • 初始技能创建
  • Material for MkDocs主题配置
  • 插件生态系统文档
  • GitHub Pages部署工作流
  • 基于mike的版本控制
  • Mermaid图表集成
  • 自定义CSS/JS扩展
  • 最佳实践和故障排除

Related Resources

相关资源


Build beautiful, searchable documentation sites with MkDocs and deploy them anywhere.

使用MkDocs构建美观、可搜索的文档站点,并部署到任意平台。