add KaTeX support to docs

This commit is contained in:
Sina Atalay 2023-09-13 19:07:22 +02:00
parent 672325ea56
commit 7ea2710fc4
2 changed files with 39 additions and 6 deletions

11
docs/javascripts/katex.js Normal file
View File

@ -0,0 +1,11 @@
document$.subscribe(({ body }) => {
renderMathInElement(body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
],
})
})

View File

@ -1,8 +1,10 @@
site_name: RenderCV
site_description: A Python application that creates a CV in PDF from a YAML/JSON input file.
site_author: Sina Atalay
copyright: Copyright © 2023 Sina Atalay
site_url: https://sinaatalay.github.io/rendercv/
repo_name: sinaatalay/rendercv
repo_url: https://github.com/sinaatalay/rendercv
repo_name: sinaatalay/rendercv
edit_uri: edit/main/docs/
theme:
@ -22,18 +24,30 @@ theme:
toggle:
icon: material/lightbulb
name: "Switch to light mode"
font:
text: Roboto
code: Roboto Mono
features:
- content.tabs.link
- content.code.annotate
- content.code.copy
- content.code.copy # the copy-to-clipboard buttons for code blocks
- content.action.view # view source button for pages
- navigation.footer # the previous and next buttons in the footer
- navigation.indexes # allow mother pages to have their own index pages
- navigation.tabs # render classical type of navbar at top
- navigation.top # back to top button
- search.highlight # highlight search results after going to a page
- search.suggest # show search suggestions while typing
- toc.follow # if toc sidebar doesn't fit, scroll to the active heading
nav:
- Quick Start: index.md
- Contact: contact.md
- Code Reference:
- Code Reference: reference/index.md
- __main__.py: reference/__main__.md
- data_model.py: reference/data_model.md
- tinytex.py: reference/tinytex.md
- rendering.py: reference/rendering.md
plugins:
- search
@ -49,3 +63,11 @@ plugins:
merge_init_into_class: true
show_docstring_attributes: true
docstring_style: google
extra_javascript:
- javascripts/katex.js
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js
extra_css:
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css