mirror of
https://github.com/Anduin2017/HowToCook.git
synced 2026-05-14 03:01:27 +08:00
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:
35
.github/templates/mkdocs_template.yml
vendored
35
.github/templates/mkdocs_template.yml
vendored
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mkdocs-material
|
||||
mkdocs-same-dir
|
||||
mkdocs-minify-plugin
|
||||
mkdocs-with-pdf
|
||||
weasyprint
|
||||
properdocs>=1.6.7
|
||||
pymdown-extensions
|
||||
|
||||
Reference in New Issue
Block a user