Migrate from mkdocs to properdocs

- Replace mkdocs-with-pdf + weasyprint with properdocs>=1.6.7
- Add pymdown-extensions for richer markdown support
- Remove heavy apt dependencies (weasyprint, fonts-noto-cjk, wget, unzip)
- Switch build command from 'mkdocs build' to 'properdocs build --strict'
- Update template: add offline plugin, fix palette, add content.code.select/copy
- Add md_in_html, pymdownx.tilde, emoji, mermaid, annotation icon support
- Fix broken icon path material//weather-sunny

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anduin Xue
2026-05-04 13:20:03 +00:00
parent 1857c9e313
commit a7d81fa681
3 changed files with 29 additions and 13 deletions

View File

@@ -13,6 +13,8 @@ theme:
language: zh
features:
- content.code.annotate
- content.code.select
- content.code.copy
# - content.tabs.link
# - header.autohide
# - navigation.expand
@@ -31,18 +33,28 @@ theme:
# - toc.integrate
search_index_only: true
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/link
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material//weather-sunny
icon: material/toggle-switch
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/weather-night
name: Switch to light mode
icon: material/toggle-switch-off
name: Switch to system preference
extra:
icon:
annotation: material/arrow-right-circle
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
@@ -58,25 +70,30 @@ theme:
quote: octicons/quote-16
markdown_extensions:
- md_in_html
- admonition
- pymdownx.details
- pymdownx.superfences
- abbr
- pymdownx.snippets
- pymdownx.tilde
- def_list
- pymdownx.tasklist:
custom_checkbox: true
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
plugins:
- offline
- same-dir
- search
- with-pdf:
author: GitHub Community
copyright: The Unlicense
cover_title: How To Cook
cover_subtitle: 程序员做饭指南
output_path: document.pdf
- minify:
minify_html: true

View File

@@ -12,9 +12,8 @@ RUN npm run lint
FROM python:3.11 AS python-env
WORKDIR /app
COPY --from=lint-env /app .
RUN apt-get update && apt-get install -y weasyprint fonts-noto-cjk wget unzip
RUN rm node_modules -rf && pip install -r requirements.txt
RUN mkdocs build
RUN python3 -m properdocs build --strict
# ============================
# Prepare Runtime Environment

View File

@@ -1,5 +1,5 @@
mkdocs-material
mkdocs-same-dir
mkdocs-minify-plugin
mkdocs-with-pdf
weasyprint
properdocs>=1.6.7
pymdown-extensions