Skip to content

Commit 4aa95ad

Browse files
committed
feat(docs): Enable MathJax physics package and clean up CSS
Enable the MathJax physics package to support advanced mathematical notation in documentation. This enhances the ability to render complex physics-related equations and symbols. Additionally, this commit deprecates and removes the `api-autonav.css` file and its inclusion from `mkdocs.yaml.jinja`. This cleanup is performed because the `mkdocs-api-autonav` plugin is no longer actively used or supported in this template. Minor stylistic improvements and browser compatibility adjustments are also included in `material.css`.
1 parent 32fea88 commit 4aa95ad

5 files changed

Lines changed: 15 additions & 21 deletions

File tree

.config/cspell.config.yaml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This file is @generated by <https://github.com/liblaf/cspell-init>.
33
# DO NOT EDIT!
44
allowCompoundWords: true
5+
cache:
6+
useCache: true
57
caseSensitive: false
68
enableGlobDot: true
79
ignorePaths:
@@ -15,53 +17,41 @@ ignoreRandomStrings: true
1517
useGitignore: true
1618
words:
1719
- arithmatex
20+
- chtml
1821
- cuda
19-
- cython
2022
- direnv
21-
- dmypy
2223
- elif
2324
- envops
25+
- envrc
2426
- fieldz
2527
- getattr
2628
- hynek
2729
- inlinehilite
28-
- ipynb
29-
- ipython
3030
- libc
3131
- liblaf
3232
- mathjax
3333
- mkdocs
3434
- mkdocstrings
35-
- mypy
3635
- numprocesses
3736
- numpy
38-
- pipenv
39-
- pixi
40-
- pybuilder
4137
- pycache
4238
- pydantic
4339
- pydocstyle
44-
- pyenv
45-
- pyflow
4640
- pylint
4741
- pymdownx
4842
- pypa
49-
- pypackages
5043
- pypi
5144
- pyplot
5245
- pyproject
53-
- pyright
5446
- pyrightconfig
5547
- pytest
56-
- pytype
5748
- pyvenv
5849
- pyvista
59-
- scrapy
6050
- sdist
6151
- strftime
6252
- tombi
6353
- trimesh
6454
- unshallow
55+
- uuidgen
6556
- venv
6657
- virtualenv
67-
- xdist
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
/* ! DEPRECATED */
12
/* ref: https://github.com/tlambert03/mkdocs-api-autonav */
3+
24
nav.md-nav code.doc-symbol.doc-symbol-nav {
35
margin-right: 0.25em;
46
}

docs/css/mkdocstrings/material.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ a.external::after,
1111
a.autorefs-external::after {
1212
/* https://primer.style/octicons/arrow-up-right-24 */
1313
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
14+
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
1415
content: " ";
16+
1517
display: inline-block;
1618
vertical-align: middle;
1719
position: relative;
20+
1821
height: 1em;
1922
width: 1em;
20-
background-color: currentcolor;
23+
background-color: currentColor;
2124
}
2225

2326
a.external:hover::after,
@@ -33,15 +36,13 @@ a.autorefs-external:hover::after {
3336
--tree-offset: 1rem;
3437
--tree-thickness: 1px;
3538
--tree-style: solid;
36-
3739
display: grid;
3840
list-style: none !important;
3941
}
4042

4143
.doc-backlink-list li > span:first-child {
4244
text-indent: 0.3rem;
4345
}
44-
4546
.doc-backlink-list li {
4647
padding-inline-start: var(--tree-offset);
4748
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
@@ -51,7 +52,6 @@ a.autorefs-external:hover::after {
5152
&:last-child {
5253
border-color: transparent;
5354
}
54-
5555
&::before {
5656
content: "";
5757
position: absolute;
@@ -68,7 +68,6 @@ a.autorefs-external:hover::after {
6868
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
6969
border-bottom: var(--tree-thickness) var(--tree-style) var(--tree-clr);
7070
}
71-
7271
&::after {
7372
content: "";
7473
position: absolute;

docs/javascript/mathjax.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ window.MathJax = {
66
displayMath: [["\\[", "\\]"]],
77
processEscapes: true,
88
processEnvironments: true,
9+
// ref: <https://docs.mathjax.org/en/v3.2/input/tex/extensions/physics.html#physics>
10+
packages: { "[+]": ["physics"] },
911
},
12+
// ref: <https://docs.mathjax.org/en/v3.2/web/components/combined.html#tex-mml-chtml>
13+
loader: { load: ["tex-mml-chtml", "[tex]/physics"] },
1014
options: {
1115
ignoreHtmlClass: ".*|",
1216
processHtmlClass: "arithmatex",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ edit_uri: blob/main/docs/
1616

1717
extra_css:
1818
- 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
2019
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/material.min.css
2120
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/syntax-highlight-in-signatures.min.css
2221

0 commit comments

Comments
 (0)