Skip to content

Commit 6335de1

Browse files
committed
perf(docs): switch to minified CDN assets and improve documentation
- Use jsDelivr CDN for faster asset loading - Load minified versions of CSS/JS files - Add section headers for better plugin organization - Document privacy plugin limitation with MathJax - Note hippogriffe plugin compatibility constraints
1 parent 4bb514a commit 6335de1

2 files changed

Lines changed: 23 additions & 14 deletions

File tree

docs/javascript/mathjax.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ref: <https://squidfunk.github.io/mkdocs-material/reference/math/#mathjax>
2+
23
window.MathJax = {
34
tex: {
45
inlineMath: [["\\(", "\\)"]],

template/.config/copier/mkdocs.yaml.jinja

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ repo_url: "https://github.com/{{ github_user }}/{{ github_repo }}"
1515
edit_uri: blob/main/docs/
1616

1717
extra_css:
18-
- https://raw.githubusercontent.com/liblaf/copier-python/refs/heads/main/docs/css/fonts.css
19-
- https://raw.githubusercontent.com/liblaf/copier-python/refs/heads/main/docs/css/mkdocstrings/api-autonav.css
20-
- https://raw.githubusercontent.com/liblaf/copier-python/refs/heads/main/docs/css/mkdocstrings/material.css
21-
- https://raw.githubusercontent.com/liblaf/copier-python/refs/heads/main/docs/css/mkdocstrings/syntax-highlight-in-signatures.css
18+
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/fonts.min.css
19+
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/api-autonav.min.css
20+
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/material.min.css
21+
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/syntax-highlight-in-signatures.min.css
2222

2323
extra_javascript:
24-
- https://raw.githubusercontent.com/liblaf/copier-python/refs/heads/main/docs/javascript/mathjax.js
25-
- https://raw.githubusercontent.com/readthedocs/test-builds/refs/heads/mkdocs-material/docs/javascripts/readthedocs.js
24+
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/javascript/mathjax.min.js
25+
- https://cdn.jsdelivr.net/gh/readthedocs/test-builds@mkdocs-material/docs/javascripts/readthedocs.min.js
2626
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
2727

2828
theme:
@@ -79,28 +79,32 @@ theme:
7979
name: Dark Mode
8080

8181
plugins:
82-
# Built-in plugins
82+
# ---------------------------- Built-in plugins ---------------------------- #
8383
# blog:
8484
# group:
8585
# info:
8686
meta:
8787
# offline:
8888
# optimize: # sponsors only
89-
privacy:
89+
90+
# privacy:
91+
# ref: <https://squidfunk.github.io/mkdocs-material/plugins/privacy/#__code_16_annotation_1>
92+
# MathJax loads web fonts for typesetting of mathematical content through relative URLs, and thus cannot be automatically bundled by the privacy plugin.
93+
9094
# projects:
9195
search:
9296
social:
9397
tags:
9498
# typeset: # sponsors only
9599

96-
# External plugins, schema provided by us
100+
# ----------------- External plugins, schema provided by us ---------------- #
97101
git-committers:
98102
enabled: !ENV [READTHEDOCS, CI, false]
99103
repository: "{{ github_user }}/{{ github_repo }}"
100104
branch: main
101105
section-index:
102106

103-
# External plugins, schema provided by our community
107+
# ----------- External plugins, schema provided by our community ----------- #
104108
include-markdown:
105109
git-revision-date-localized:
106110
enable_creation_date: true
@@ -156,14 +160,18 @@ plugins:
156160
show_overloads: true
157161
signature_crossrefs: true
158162

159-
# ref: <https://mkdocstrings.github.io/autorefs/>
160-
autorefs:
163+
# ---------------------------- External Plugins ---------------------------- #
161164

162-
# ref: <https://github.com/tlambert03/mkdocs-api-autonav>
163-
api-autonav:
165+
autorefs: # ref: <https://mkdocstrings.github.io/autorefs/>
166+
167+
api-autonav: # ref: <https://github.com/tlambert03/mkdocs-api-autonav>
164168
modules:
165169
- "src/{{ wheel_package_dir }}/"
166170

171+
# hippogriffe: # ref: <https://github.com/patrick-kidger/hippogriffe>
172+
# hippogriffe requires `mkdocstrings.python.options.force_inspection: true`. (This is so it can do things like display type annotations correctly.)
173+
# However, this option will not be not compatible with `lazy-loader` until <https://github.com/mkdocstrings/mkdocstrings/issues/752> is resolved.
174+
167175
markdown_extensions:
168176
# ref: <https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/>
169177
abbr:

0 commit comments

Comments
 (0)