diff --git a/.github/templates/mkdocs_template.yml b/.github/templates/mkdocs_template.yml index 87c59e0f..de66e516 100644 --- a/.github/templates/mkdocs_template.yml +++ b/.github/templates/mkdocs_template.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 4265ad14..dfdb3e52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/requirements.txt b/requirements.txt index 1e6a2ebe..5248dc33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ mkdocs-material mkdocs-same-dir mkdocs-minify-plugin -mkdocs-with-pdf -weasyprint +properdocs>=1.6.7 +pymdown-extensions