Skip to content

Commit

Permalink
Merge pull request #180 from wilsonrljr/docs/fix_latex_jupyter
Browse files Browse the repository at this point in the history
Update doc dependencies. Change latex equations from mathjax to katex due to mkdcos-jupyter issue. Also, katex is a good alternative for the doc. Fix css in quickstart guide. Add code docs for missing basis function in API docs.
  • Loading branch information
wilsonrljr authored Mar 1, 2025
2 parents a6c2b4d + 707f291 commit 5aff6c5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 37 deletions.
4 changes: 2 additions & 2 deletions docs/getting-started/quickstart-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ yhat = model.predict(X=x_valid, y=y_valid)

<div class="custom-collapsible-card">
<input type="checkbox" id="initial-info">
<label for="toggle-info">
<label for="initial-info">
📚 <strong>Looking for more details on what are initial conditions?</strong>
<span class="arrow">▼</span>
</label>
Expand Down Expand Up @@ -547,7 +547,7 @@ yhat_4_steps = model.predict(X=x_valid, y=y_valid, steps_ahead=4)

<div class="custom-collapsible-card">
<input type="checkbox" id="steps-info">
<label for="toggle-info">
<label for="steps-info">
📚 <strong>Looking for more details about how steps-ahead prediction works?</strong>
<span class="arrow">▼</span>
</label>
Expand Down
10 changes: 10 additions & 0 deletions docs/overrides/assets-2.0/js/katex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document$.subscribe(({ body }) => {
renderMathInElement(body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
],
})
})
16 changes: 0 additions & 16 deletions docs/overrides/assets-2.0/js/mathjax.js

This file was deleted.

9 changes: 9 additions & 0 deletions docs/user-guide/API/basis-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ template: overrides/main.html

::: sysidentpy.basis_function._polynomial
show_root_heading: false

::: sysidentpy.basis_function._hermite
show_root_heading: false

::: sysidentpy.basis_function._hermite_normalized
show_root_heading: false

::: sysidentpy.basis_function._laguerre
show_root_heading: false
19 changes: 10 additions & 9 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ theme:

## Custom theme additions
extra_javascript:
- "overrides/assets-2.0/js/extra.js"
- "overrides/assets-2.0/js/mathjax.js"
- "https://polyfill.io/v3/polyfill.min.js?features=es6"
- "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
- https://polyfill.io/v3/polyfill.min.js?features=es6
- overrides/assets-2.0/js/katex.js
- https://unpkg.com/katex@0/dist/katex.min.js
- https://unpkg.com/katex@0/dist/contrib/auto-render.min.js

extra_css:
- "overrides/assets-2.0/css/extra.css"
- "overrides/assets-2.0/css/feature-grid.css"
- "overrides/assets-2.0/css/fontsize.css"
- "overrides/assets-2.0/css/card-container.css"
- overrides/assets-2.0/css/extra.css
- overrides/assets-2.0/css/feature-grid.css
- overrides/assets-2.0/css/fontsize.css
- overrides/assets-2.0/css/card-container.css
- https://unpkg.com/katex@0/dist/katex.min.css

# Plugins
plugins:
Expand All @@ -89,7 +90,6 @@ plugins:
python:
options:
show_source: true
selection:
docstring_style: numpy

# Customization
Expand Down Expand Up @@ -144,6 +144,7 @@ markdown_extensions:
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- pymdownx.blocks.caption

# Page tree
nav:
Expand Down
19 changes: 9 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,21 @@ examples = ["scikit-learn", "catboost"]

docs = [
"mkdocs >=1.1.2,<2.0.0",
"mkdocs-material >=8.1.4,<=9.5.21",
"mkdocs-material >=8.1.4,<=9.6.6",
"mdx-include >=1.4.1,<2.0.0",
"mkdocs-markdownextradata-plugin >=0.1.7,<=0.2.5",
"mkdocs-markdownextradata-plugin >=0.1.7,<=0.2.6",
# TODO: upgrade and enable typer-cli once it supports Click 8.x.x
# "typer-cli >=0.0.12,<0.0.13",
"typer >=0.4.1,<0.5.0",
"pyyaml >=5.3.1,<7.0.0",
"mkdocstrings[python]<=0.25.2",
"mkdocstrings-python<=1.10.8",
"mkdocs-redirects",
"mkdocs-minify-plugin<=0.6.4",
"mkdocs-glightbox <= 0.3.2",
"mkdocs-jupyter<=0.25.0",
"mkdocs-autorefs<=1.3.1",
"mkdocstrings[python]>=0.25.2, <0.29",
"mkdocs-redirects>=1.2.0",
"mkdocs-minify-plugin<=0.8.0",
"mkdocs-glightbox <= 0.4.0",
"mkdocs-jupyter<=0.25.1",
"mkdocs-autorefs>=1.3.1",
# avoid jinja import error using 3.0.3 version
"jinja2==3.0.3",
"jinja2>=3.0.3",
]
all = ["torch >=1.7.1, <2.4.0"]

Expand Down

0 comments on commit 5aff6c5

Please sign in to comment.