├── layouts ├── _partials │ ├── comment.html │ ├── side-tags.html │ ├── side-categories.html │ ├── side-recent.html │ ├── header.html │ ├── pagination.html │ ├── footer.html │ └── head.html ├── robots.txt ├── _markup │ ├── render-codeblock-mermaid.html │ └── render-heading.html ├── taxonomy.html ├── baseof.html ├── term.html ├── section.html ├── single.html ├── index.html └── rss.xml ├── images ├── tn.png └── screenshot.png ├── .gitignore ├── static ├── lib │ ├── icofont │ │ ├── fonts │ │ │ ├── icofont.ttf │ │ │ ├── icofont.woff │ │ │ ├── icofont.woff2 │ │ │ ├── icofont.svg │ │ │ └── icofont.eot │ │ ├── demo.html │ │ ├── icofont.min.css │ │ └── icofont.css │ └── katex │ │ ├── fonts │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ ├── KaTeX_Main-BoldItalic.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.woff │ │ └── KaTeX_Typewriter-Regular.woff2 │ │ ├── contrib │ │ ├── mathtex-script-type.mjs │ │ ├── mathtex-script-type.min.js │ │ ├── copy-tex.min.js │ │ ├── auto-render.min.js │ │ ├── copy-tex.mjs │ │ ├── mathtex-script-type.js │ │ ├── copy-tex.js │ │ ├── auto-render.mjs │ │ ├── render-a11y-string.min.js │ │ ├── auto-render.js │ │ └── render-a11y-string.mjs │ │ ├── README.md │ │ └── katex.min.css ├── js │ └── copy-code-block.js └── css │ ├── syntax.css │ └── style.css ├── exampleSite ├── content │ ├── essays │ │ ├── add-picture-in-post │ │ │ ├── TEIDE.JPG │ │ │ ├── markdown-30x20.png │ │ │ └── index.md │ │ ├── _index.md │ │ └── What-Is-Hugo.md │ ├── posts │ │ ├── _index.md │ │ ├── latex-support.md │ │ ├── rich-content.md │ │ ├── emoji-support.md │ │ ├── math-typesetting.md │ │ ├── placeholder-text.md │ │ ├── test.md │ │ └── markdown-syntax.md │ └── about.md └── config.toml ├── archetypes └── default.md ├── theme.toml ├── LICENSE ├── README.md └── .github └── workflows └── hugo.yml /layouts/_partials/comment.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/images/tn.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | exampleSite/public/ 2 | exampleSite/resources/ 3 | exampleSite/.hugo_build.lock 4 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/images/screenshot.png -------------------------------------------------------------------------------- /layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: * 3 | 4 | Sitemap: {{ .Site.BaseURL }}sitemap.xml 5 | -------------------------------------------------------------------------------- /static/lib/icofont/fonts/icofont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/icofont/fonts/icofont.ttf -------------------------------------------------------------------------------- /static/lib/icofont/fonts/icofont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/icofont/fonts/icofont.woff -------------------------------------------------------------------------------- /static/lib/icofont/fonts/icofont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/icofont/fonts/icofont.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /layouts/_markup/render-codeblock-mermaid.html: -------------------------------------------------------------------------------- 1 |
2 | {{- .Inner | safeHTML }} 3 |
4 | {{ .Page.Store.Set "hasMermaid" true }} -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /static/lib/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/static/lib/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /exampleSite/content/essays/add-picture-in-post/TEIDE.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/exampleSite/content/essays/add-picture-in-post/TEIDE.JPG -------------------------------------------------------------------------------- /layouts/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | {{ .Text | safeHTML }} 🔗 -------------------------------------------------------------------------------- /exampleSite/content/essays/add-picture-in-post/markdown-30x20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leafee98/hugo-theme-flat/main/exampleSite/content/essays/add-picture-in-post/markdown-30x20.png -------------------------------------------------------------------------------- /exampleSite/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Posts" 3 | date: 2022-05-18T11:22:44+08:00 4 | tags: [] 5 | categories: [] 6 | weight: 30 7 | draft: false 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /exampleSite/content/essays/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Essays" 3 | date: 2022-05-18T11:19:08+08:00 4 | tags: [] 5 | categories: [] 6 | weight: 70 7 | draft: false 8 | --- 9 | 10 | 11 | 12 | *There are some short articles.* 13 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | tags: [] 5 | categories: [] 6 | weight: 50 7 | show_comments: true 8 | katex: false 9 | draft: true 10 | description: "" 11 | --- 12 | 13 | 14 | -------------------------------------------------------------------------------- /layouts/_partials/side-tags.html: -------------------------------------------------------------------------------- 1 |
2 |

Tags

3 |
4 | 5 | 12 |
13 | -------------------------------------------------------------------------------- /layouts/_partials/side-categories.html: -------------------------------------------------------------------------------- 1 |
2 |

Categories

3 |
4 | 5 | 12 |
13 | -------------------------------------------------------------------------------- /layouts/_partials/side-recent.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Recent {{ .Section | humanize }} 4 |

5 |
6 | 7 | 14 |
15 | -------------------------------------------------------------------------------- /layouts/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 | {{ $data := .Data }} 4 | {{ range $key, $value := .Data.Terms.ByCount }} 5 | {{ if $value.Name}} 6 | 7 | 8 | {{ $value.Name }} ({{ $value.Count }}) 9 | 10 | 11 | {{ end }} 12 | {{ end }} 13 |
14 | {{ end }} -------------------------------------------------------------------------------- /layouts/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "head.html" . }} 5 | 6 | 7 | 8 | {{ partial "header.html" . }} 9 |
10 |
11 | {{ block "main" . }}{{ end }} 12 |
13 |
14 | {{ range .Site.Sections }} 15 | {{ partial "side-recent.html" . }} 16 | {{ end }} 17 | {{ partial "side-categories.html" . }} 18 | {{ partial "side-tags.html" . }} 19 |
20 |
21 | {{ partial "footer.html" . }} 22 | 23 | 24 | -------------------------------------------------------------------------------- /exampleSite/content/posts/latex-support.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Latex Support" 3 | date: 2022-09-20T09:36:26+08:00 4 | tags: [] 5 | categories: [] 6 | weight: 50 7 | show_comments: true 8 | katex: true 9 | draft: false 10 | --- 11 | 12 | This article contians some test for latex support. 13 | Currently the lib used for rendering LaTeX is [\\(\KaTeX\\)](https://katex.org/) 14 | 15 | 16 | 17 | $$ 18 | \pi=\int_{-\infty}^\infty\frac{dx}{1+x^2} 19 | $$ 20 | 21 | ## The code which render the above 22 | 23 | ``` 24 | This article contians some test for latex support. 25 | Currently the lib used for rendering LaTeX is [\\(\KaTeX\\)](https://katex.org/) 26 | 27 | $$ 28 | \pi=\int_{-\infty}^\infty\frac{dx}{1+x^2} 29 | $$ 30 | ``` 31 | -------------------------------------------------------------------------------- /static/lib/icofont/fonts/icofont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/mathtex-script-type.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | var scripts = document.body.getElementsByTagName("script"); 4 | scripts = Array.prototype.slice.call(scripts); 5 | scripts.forEach(function (script) { 6 | if (!script.type || !script.type.match(/math\/tex/i)) { 7 | return -1; 8 | } 9 | 10 | var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 11 | var katexElement = document.createElement(display ? "div" : "span"); 12 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 13 | 14 | try { 15 | katex.render(script.text, katexElement, { 16 | displayMode: display 17 | }); 18 | } catch (err) { 19 | //console.error(err); linter doesn't like this 20 | katexElement.textContent = script.text; 21 | } 22 | 23 | script.parentNode.replaceChild(katexElement, script); 24 | }); 25 | -------------------------------------------------------------------------------- /layouts/_partials/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ .Site.Title }} 4 | 5 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Flat" 2 | license = "MIT" 3 | licenselink = "Link to theme's license" 4 | description = "A theme with light color and multi-section support" 5 | 6 | # The home page of the theme, where the source can be found. 7 | homepage = "https://github.com/leafee98/hugo-theme-flat" 8 | 9 | # If you have a running demo of the theme. 10 | demosite = "https://leafee98.github.io/hugo-theme-flat/" 11 | 12 | tags = ["blog", "personal", "light", "dark", "responsive"] 13 | features = [] 14 | 15 | # If the theme has multiple authors 16 | #authors = [ 17 | # {name = "", homepage = ""}, 18 | #] 19 | 20 | # If the theme has a single author 21 | [author] 22 | name = "leafee98" 23 | homepage = "https://leafee98.com" 24 | 25 | # If porting an existing theme 26 | #[original] 27 | # author = "Name of original author" 28 | # homepage = "His/Her website" 29 | # repo = "Link to source code of original theme" 30 | -------------------------------------------------------------------------------- /exampleSite/content/posts/rich-content.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Rich Content" 4 | date = "2019-03-10" 5 | description = "A brief description of Hugo Shortcodes" 6 | tags = [ 7 | "shortcodes", 8 | "privacy", 9 | ] 10 | draft = true 11 | +++ 12 | 13 | Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. 14 | 15 | --- 16 | 17 | ## YouTube Privacy Enhanced Shortcode 18 | 19 | {{< youtube ZJthWmvUzzc >}} 20 | 21 |
22 | 23 | --- 24 | 25 | ## Twitter Simple Shortcode 26 | 27 | {{< twitter_simple 1085870671291310081 >}} 28 | 29 |
30 | 31 | --- 32 | 33 | ## Vimeo Simple Shortcode 34 | 35 | {{< vimeo_simple 48912912 >}} 36 | -------------------------------------------------------------------------------- /layouts/_partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{ $pag := $.Paginator }} 2 | 3 | -------------------------------------------------------------------------------- /exampleSite/content/essays/What-Is-Hugo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "What Is Hugo" 3 | date: 2022-05-16T21:57:50+08:00 4 | tags: [] 5 | categories: [] 6 | draft: false 7 | --- 8 | 9 | Hugo is a static site generator written in Go. Originally created by Steve Francia in 2013, Hugo has seen a great increase in both features and performance thanks to current lead developer Bjørn Erik Pedersen (since v0.14 in 2015[4]) and other contributors. Hugo is an open source project licensed under the Apache License 2.0.[5] 10 | 11 | 12 | 13 | Being able to generate most websites within seconds (at < 1 ms per page), Hugo's official website states it is "the world’s fastest framework for building websites". In July 2015, Netlify began providing Hugo hosting,[6] and in 2017, Smashing Magazine completed its redesign of their website, migrating from WordPress to a JAMstack solution with Hugo.[7] 14 | 15 | > Source: https://en.wikipedia.org/wiki/Hugo_(software) 16 | > 17 | > License: [CC-BY-SA 3.0](https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License) 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 leafee98 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /static/js/copy-code-block.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Every codeblock has "pre > code" structure, some highlighted codeblocks have 3 | * "div.highlight > pre.chroma > code" structure. So, use the simple CSS selector 4 | * to query all codeblocks. 5 | */ 6 | document.addEventListener("DOMContentLoaded", 7 | () => { 8 | var codeblocks = document.querySelectorAll(".single .content pre code"); 9 | 10 | console.log("codeblocks length:", codeblocks.length); 11 | 12 | codeblocks.forEach( 13 | (codeblock) => { 14 | let elementPre = codeblock.parentElement; 15 | 16 | let button = document.createElement("div"); 17 | button.classList.add("copyCodeButton"); 18 | button.innerHTML = "copy"; 19 | button.addEventListener("click", 20 | () => { 21 | navigator.clipboard.writeText(codeblock.textContent); 22 | 23 | button.innerHTML = "copied!"; 24 | setTimeout( 25 | () => { button.innerHTML = "copy"; }, 26 | 1000 27 | ); 28 | } 29 | ); 30 | 31 | elementPre.appendChild(button); 32 | } 33 | ); 34 | } 35 | ); 36 | 37 | -------------------------------------------------------------------------------- /layouts/term.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 | {{ if trim .Content " \n" }} 5 |
{{ .Content }}
6 | {{ end }} 7 | 8 |
9 | {{ range .Data.Pages.GroupByDate "2006" }} 10 |
11 |

12 | {{ .Key }} 13 |

14 | 15 | {{ range .Pages }} 16 |
17 | 18 | 19 |
20 | 21 | {{ .Title }} 22 | 23 | {{ with .Params.tags }} 24 | {{ range . }} 25 | {{ . }} 26 | {{ end }} 27 | {{ end }} 28 | 29 |
30 |
31 | {{ end }} 32 | 33 |
34 | {{ end }} 35 | 36 |
37 |
38 | 39 | {{ end }} 40 | -------------------------------------------------------------------------------- /layouts/section.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 | {{ if trim .Content " \n" }} 5 |
{{ .Content }}
6 | {{ end }} 7 | 8 |
9 | {{ range .Data.Pages.GroupByDate "2006" }} 10 |
11 |

12 | {{ .Key }} 13 |

14 | 15 | {{ range .Pages }} 16 |
17 | 18 | 19 |
20 | 21 | {{ .Title }} 22 | 23 | {{ with .Params.tags }} 24 | {{ range . }} 25 | {{ . }} 26 | {{ end }} 27 | {{ end }} 28 | 29 |
30 |
31 | {{ end }} 32 | 33 |
34 | {{ end }} 35 | 36 |
37 |
38 | 39 | {{ end }} 40 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/mathtex-script-type.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o,i,a,u={};return o=n(771),i=n.n(o),a=document.body.getElementsByTagName("script"),(a=Array.prototype.slice.call(a)).forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;var t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{i().render(e.text,r,{displayMode:t})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)})),u=u.default}()})); -------------------------------------------------------------------------------- /exampleSite/content/essays/add-picture-in-post/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Add Picture In Blog" 3 | date: 2023-01-24T20:04:07+08:00 4 | tags: [] 5 | categories: [] 6 | weight: 50 7 | show_comments: true 8 | katex: false 9 | draft: false 10 | --- 11 | 12 | In this essay, we will talk about how to add a picture in blog. 13 | 14 | 15 | 16 | There are many ways to add a picture, the one to use pure markdown syntax is `![](./path/to/picture)`. 17 | 18 | Now I will show you a BIG picture (3600x2180): 19 | 20 | ![Big picture](./TEIDE.JPG) 21 | 22 | And a small picture (30x20): 23 | 24 | ![Small markdown mark](./markdown-30x20.png) 25 | 26 | Here is a inline markdown mark ![Small markdown mark](./markdown-30x20.png). 27 | 28 | ## Some other things 29 | 30 | **Note** that due to the *big picture* is from [Wikipedia][wikipedia] who use [CC-BY-SA 3.0][cc-by-sa-3] as license, so this essay also use [CC-BY-SA 3.0] as license. 31 | 32 | The *big picture* is from . 33 | 34 | The small markdown mark has been dedicated to the public domain. 35 | 36 | [wikipedia]: https://wikipedia.org/ "Wikipedia" 37 | [cc-by-sa-3]: https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License "Creative Commons Attribution-ShareAlike License 3.0" 38 | 39 | -------------------------------------------------------------------------------- /layouts/_partials/footer.html: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /layouts/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 |

{{ .Title }}

5 | 6 |
7 | 8 | · 9 | {{ .WordCount }} words 10 | · 11 | 12 | {{ .ReadingTime }} minutes to read 13 | 14 |
15 | 16 |
17 | {{ with .Params.categories }} 18 |
19 | Categories: 20 | {{ range . }} 21 | {{ . }} 22 | {{ end }} 23 |
24 | {{ end }} 25 | 26 | {{ with .Params.tags }} 27 |
28 | Tags: 29 | {{ range . }} 30 | {{ . }} 31 | {{ end }} 32 |
33 | {{ end }} 34 |
35 | 36 |
37 | 38 |
39 | {{ .Content }} 40 |
41 | 42 | {{ with and .Site.Params.remark42 .Params.show_comments }} 43 |
44 | {{ partial "comment.html" . }} 45 | {{ end }} 46 |
47 | 48 | {{ end }} 49 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/copy-tex.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={},t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);for(var r=e.querySelectorAll(".katex-mathml + .katex-html"),a=0;aDFLTlatnligaèz¼Œz¼à1PfEd@ídídRÿjZR–èè,TN, 6 | T"ídÿÿídÿÿ ídídDÿ©¨ *234'.'H34'.'&#".4>2@R•s>¨-, gkuƒ~Â67¨EBñœ¢±è6@55@6C>u•Rukh ,-‚85ă²¢óBEý 7 | 66@55Æ ' 8 | +. Y l z ˆ – ¤ º 9 | VÈ &IcoFontRegularicofonticofontVersion 1.0icofontGenerated by svg2ttf from Fontello project.http://fontello.comIcoFontRegularicofonticofontVersion 1.0icofontGenerated by svg2ttf from Fontello project.http://fontello.com 10 | rss -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 |
5 | {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} 6 | {{ $paginator := .Paginate $pages }} 7 | {{ range $paginator.Pages }} 8 |
9 |

{{ .Title }}

10 | 11 |
12 |
13 | 14 |
15 | 16 | {{ with .Params.Categories }} 17 |
18 | Categories: 19 | {{ range first 2 . }} 20 | {{ . }} 21 | {{ end }} 22 |
23 | {{ end }} 24 | 25 | {{ with .Params.Tags }} 26 |
27 | Tags: 28 | {{ range first 5 . }} 29 | {{ . }} 30 | {{ end }} 31 |
32 | {{ end }} 33 |
34 | 35 |
36 | {{ with .Description }} 37 | {{ . }} 38 | {{ else }} 39 | {{ .Summary }} 40 | {{ end }} 41 |
42 |
43 | {{ end }} 44 | 45 |
46 | {{ partial "pagination.html" . }} 47 |
48 | {{ end }} 49 | -------------------------------------------------------------------------------- /exampleSite/content/posts/emoji-support.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Emoji Support" 4 | date = "2019-03-05" 5 | description = "Guide to emoji usage in Hugo" 6 | tags = [ 7 | "emoji", 8 | ] 9 | 10 | +++ 11 | 12 | Emoji can be enabled in a Hugo project in a number of ways. 13 | 14 | The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). 15 | 16 | To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. 17 | 18 |

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

19 |
20 | 21 | The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. 22 | 23 | *** 24 | 25 | **N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. 26 | 27 | {{< highlight html >}} 28 | .emoji { 29 | font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; 30 | } 31 | {{< /highlight >}} 32 | 33 | {{< css.inline >}} 34 | 47 | {{< /css.inline >}} 48 | -------------------------------------------------------------------------------- /exampleSite/content/posts/math-typesetting.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: Hugo Authors 3 | title: Math Typesetting 4 | date: 2019-03-08 5 | description: A brief guide to setup KaTeX 6 | math: true 7 | --- 8 | 9 | Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. 10 | 11 | 12 | In this example we will be using [KaTeX](https://katex.org/) 13 | 14 | - Create a partial under `/layouts/partials/math.html` 15 | - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. 16 | - Include the partial in your templates like so: 17 | 18 | ```bash 19 | {{ if or .Params.math .Site.Params.math }} 20 | {{ partial "math.html" . }} 21 | {{ end }} 22 | ``` 23 | 24 | - To enable KaTex globally set the parameter `math` to `true` in a project's configuration 25 | - To enable KaTex on a per page basis include the parameter `math: true` in content files 26 | 27 | **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) 28 | 29 | {{< math.inline >}} 30 | {{ if or .Page.Params.math .Site.Params.math }} 31 | 32 | 33 | 34 | 35 | {{ end }} 36 | {{}} 37 | 38 | ### Examples 39 | 40 | {{< math.inline >}} 41 |

42 | Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) 43 |

44 | {{}} 45 | 46 | Block math: 47 | $$ 48 | \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } 49 | $$ 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hugo-theme-flat 2 | 3 | This is a theme I personally use. 4 | 5 | ## Features 6 | 7 | - Dark theme support (auto switch by css media query) 8 | - Muti-Section supports 9 | - Side card to display recent updated sections 10 | - Responsive layout 11 | - Sub-menu support 12 | 13 | ## Multi Section Supports 14 | 15 | If you use multi sections (with the concept from hugo), the RSS at bottom and *Recent* at side are ready for displaying those content. However, you will need to set up your menu at `config.toml` to point the hyperlink to proper destination. 16 | 17 | If you want to re-order those sections, you need a `_index.md` at the directory of the section to set proper weight at front matter, just alike what was done at the exampleSite, see `/exampleSite/content/essays/_index.md`. See the predefined variable `weight` at [docs](https://gohugo.io/content-management/front-matter/#front-matter-variables). 18 | 19 | **Note** that separating taxonomies according to different sections is not implemented yet. So better to only use taxonomies inside a specific section. 20 | 21 | For a better understand, if you have to posts *A* and *B* in section *S1* and *S2*, both of the posts has the same tag *T1*, like the follow. 22 | 23 | ``` 24 | post A: section S1, tag T1, tag T2 25 | post B: section S2, tag T2 26 | ``` 27 | 28 | When you open the index page of *T1*, there will be two posts, rathor than post *A* when you are in section *S1* and post *B* when you are in section *S2*. 29 | 30 | ``` 31 | tag T1: post A, post B 32 | tag T2: post A 33 | ``` 34 | 35 | ## Special Thanks 36 | 37 | The wordpress theme [Allium](https://wordpress.org/themes/allium/), and [here](https://templatelens.com/allium/) is its home page. I like this theme very much when I'm using wordpress, but I don't have it on hugo, so I try my best to write a theme similar with it. There are many designs in this theme refers to it. 38 | 39 | The hugo theme [jane](https://github.com/xianmin/hugo-theme-jane) and [mini](https://github.com/nodejh/hugo-theme-mini/), this is my first time to write a hugo theme, I referred this two themes' project structure and way of handling problems. 40 | -------------------------------------------------------------------------------- /exampleSite/config.toml: -------------------------------------------------------------------------------- 1 | title = "Flat theme" 2 | theme = "hugo-theme-flat" 3 | themesDir = "../.." 4 | enableRobotsTXT = true 5 | hasCJKLanguage = true 6 | baseURL = "" 7 | 8 | [pagination] 9 | pagerSize = 4 10 | 11 | # these values are hugo built in markup config 12 | [markup.highlight] 13 | anchorLineNos = false 14 | codeFences = true 15 | guessSyntax = false 16 | hl_Lines = '' 17 | lineAnchors = '' 18 | lineNoStart = 1 19 | lineNos = false 20 | lineNumbersInTable = false 21 | noClasses = false 22 | noHl = false 23 | style = 'monokailight' 24 | tabWidth = 4 25 | 26 | [params] 27 | description = "Example site for hugo-theme-flat" 28 | mainSections = ['posts'] 29 | 30 | ## uncomment belows and set proper values to enable remark42 31 | # [params.remark42] 32 | # host='' 33 | # site_id='' 34 | # max_shown_comments=100 35 | # theme='light' 36 | # locale='en' 37 | # show_email_subscription=false 38 | # simple_view=true 39 | 40 | 41 | # you can set multi row of footers like these 42 | [[params.footer_rows]] 43 | [[params.footer_rows.items]] 44 | name = "Creative Commons Attribution 4.0 International" 45 | url = "https://creativecommons.org/licenses/by/4.0/" 46 | pre = "Copyright CC BY-4.0" 47 | 48 | [[params.footer_rows]] 49 | [[params.footer_rows.items]] 50 | name = "Hugo" 51 | url = "https://gohugo.io" 52 | pre = "Powered by Hugo" 53 | [[params.footer_rows.items]] 54 | name = "theme flat" 55 | url = "https://cgit.leafee98.com/hugo-theme-flat.git" 56 | pre = "Theme hugo-theme-flat" 57 | 58 | 59 | [[menus.main]] 60 | name = "Posts" 61 | url = "/posts/" 62 | weight = 30 63 | 64 | [[menus.main]] 65 | name = "Essays" 66 | url = "/essays/" 67 | weight = 40 68 | 69 | [[menus.main]] 70 | pageref = "about" 71 | name = "About" 72 | weight = 80 73 | 74 | # 2-level sub menus are supported 75 | [[menus.main]] 76 | name = "Services" 77 | weight = 60 78 | [[menus.main]] 79 | parent = "Services" 80 | name = "Service A" 81 | url = "#" 82 | [[menus.main]] 83 | parent = "Services" 84 | name = "Service B" 85 | url = "#" 86 | -------------------------------------------------------------------------------- /static/lib/icofont/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Examples | IcoFont 6 | 7 | 73 | 74 | 75 |
76 |
77 |

IcoFont Icons

78 |
79 |
80 |
81 |
    82 | 83 |
  • 84 |
    85 |
    86 | 87 |
    88 | rss 89 |
    90 |
  • 91 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /exampleSite/content/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | date: 2022-04-27T21:01:43+08:00 4 | draft: false 5 | --- 6 | 7 | ## About this demo site 8 | 9 | This is the *about page* of this theme. The content of this demo site is come from [hugo-theme-mini](https://github.com/nodejh/hugo-theme-mini/), whose license is [MIT](https://github.com/nodejh/hugo-theme-mini/blob/39be4727b355bc8cabd919c6684d79064690a5c6/LICENSE.md) 10 | 11 | This site is built by hugo, which is a fast static site generator writen in go. You can go to its [offical site](https://gohugo.io) to get more information. 12 | 13 | ## CJK supported 14 | 15 | This hugo theme support CJK language, but some right to left language may not act as expected. Let's just test CJK layout! 16 | 17 | 这一句话是用中文写的,一般情况下,中英文排版如果字体设置不当,显示出来的字号会有相当的差距,即便实际上的字号是相同的。这个问题暂时看来无法彻底解决,唯一能做的就是挑选合适的字体,使相同字号下,中英文在展示出来后肉眼感官大小差别不大。 18 | 19 | Try another typography, which make English and Chinese lay down in a single line. The word *Chinese* in Chinese is "中文". 20 | 21 | ## What is hugo 22 | 23 | Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. 24 | 25 | Hugo makes use of a variety of open source projects including: 26 | 27 | * https://github.com/yuin/goldmark 28 | * https://github.com/alecthomas/chroma 29 | * https://github.com/muesli/smartcrop 30 | * https://github.com/spf13/cobra 31 | * https://github.com/spf13/viper 32 | 33 | Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. 34 | 35 | Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. 36 | 37 | Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. 38 | 39 | Learn more and contribute on [GitHub](https://github.com/gohugoio). 40 | 41 | -------------------------------------------------------------------------------- /layouts/rss.xml: -------------------------------------------------------------------------------- 1 | {{- $pctx := . -}} 2 | {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} 3 | {{- $pages := slice -}} 4 | 5 | {{- if or $.IsHome -}} 6 | {{/* remove page at top level from RSS, for exmaple "about" page */}} 7 | {{- $pages = where $pctx.RegularPages "Type" "ne" "page" -}} 8 | {{- else if $.IsSection -}} 9 | {{- $pages = $pctx.RegularPages -}} 10 | {{- else -}} 11 | {{- $pages = $pctx.Pages -}} 12 | {{- end -}} 13 | 14 | {{- $limit := .Site.Config.Services.RSS.Limit -}} 15 | {{- if ge $limit 1 -}} 16 | {{- $pages = $pages | first $limit -}} 17 | {{- end -}} 18 | 19 | {{- printf "" | safeHTML }} 20 | 21 | 22 | {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} 23 | {{ .Permalink }} 24 | Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} 25 | Hugo -- gohugo.io{{ with .Site.LanguageCode }} 26 | {{.}}{{end}}{{ with .Site.Author.email }} 27 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} 28 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} 29 | {{.}}{{end}}{{ if not .Date.IsZero }} 30 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} 31 | {{- with .OutputFormats.Get "RSS" -}} 32 | {{ printf "" .Permalink .MediaType | safeHTML }} 33 | {{- end -}} 34 | {{ range $pages }} 35 | 36 | {{ .Title }} 37 | {{ .Permalink }} 38 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 39 | {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} 40 | {{ .Permalink }} 41 | {{ .Content | html }} 42 | 43 | {{ end }} 44 | 45 | 46 | -------------------------------------------------------------------------------- /.github/workflows/hugo.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a Hugo site to GitHub Pages 2 | name: Deploy Hugo site to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ["main"] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 20 | concurrency: 21 | group: "pages" 22 | cancel-in-progress: false 23 | 24 | # Default to bash 25 | defaults: 26 | run: 27 | shell: bash 28 | 29 | jobs: 30 | # Build job 31 | build: 32 | runs-on: ubuntu-latest 33 | env: 34 | HUGO_VERSION: 0.147.2 35 | steps: 36 | - name: Install Hugo CLI 37 | run: | 38 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ 39 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 40 | - name: Install Dart Sass 41 | run: sudo snap install dart-sass 42 | - name: Checkout 43 | uses: actions/checkout@v4 44 | with: 45 | submodules: recursive 46 | - name: Setup Pages 47 | id: pages 48 | uses: actions/configure-pages@v5 49 | - name: Install Node.js dependencies 50 | run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" 51 | - name: Build with Hugo 52 | env: 53 | HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache 54 | HUGO_ENVIRONMENT: production 55 | run: | 56 | hugo \ 57 | --source ./exampleSite \ 58 | --minify \ 59 | --baseURL "${{ steps.pages.outputs.base_url }}/" 60 | - name: Upload artifact 61 | uses: actions/upload-pages-artifact@v3 62 | with: 63 | path: ./exampleSite/public 64 | 65 | # Deployment job 66 | deploy: 67 | environment: 68 | name: github-pages 69 | url: ${{ steps.deployment.outputs.page_url }} 70 | runs-on: ubuntu-latest 71 | needs: build 72 | steps: 73 | - name: Deploy to GitHub Pages 74 | id: deployment 75 | uses: actions/deploy-pages@v4 76 | 77 | -------------------------------------------------------------------------------- /static/lib/icofont/icofont.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package IcoFont 3 | * @version 1.0.1 4 | * @author IcoFont https://icofont.com 5 | * @copyright Copyright (c) 2015 - 2022 IcoFont 6 | * @license - https://icofont.com/license/ 7 | */@font-face{font-family:IcoFont;font-weight:400;font-style:Regular;src:url(fonts/icofont.woff2) format("woff2"),url(fonts/icofont.woff) format("woff")}[class*=" icofont-"],[class^=icofont-]{font-family:IcoFont!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr;line-height:1;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.icofont-rss:before{content:"\ed64"}.icofont-xs{font-size:.5em}.icofont-sm{font-size:.75em}.icofont-md{font-size:1.25em}.icofont-lg{font-size:1.5em}.icofont-1x{font-size:1em}.icofont-2x{font-size:2em}.icofont-3x{font-size:3em}.icofont-4x{font-size:4em}.icofont-5x{font-size:5em}.icofont-6x{font-size:6em}.icofont-7x{font-size:7em}.icofont-8x{font-size:8em}.icofont-9x{font-size:9em}.icofont-10x{font-size:10em}.icofont-fw{text-align:center;width:1.25em}.icofont-ul{list-style-type:none;padding-left:0;margin-left:0}.icofont-ul>li{position:relative;line-height:2em}.icofont-ul>li .icofont{display:inline-block;vertical-align:middle}.icofont-border{border:solid .08em #f1f1f1;border-radius:.1em;padding:.2em .25em .15em}.icofont-pull-left{float:left}.icofont-pull-right{float:right}.icofont.icofont-pull-left{margin-right:.3em}.icofont.icofont-pull-right{margin-left:.3em}.icofont-spin{-webkit-animation:icofont-spin 2s infinite linear;animation:icofont-spin 2s infinite linear;display:inline-block}.icofont-pulse{-webkit-animation:icofont-spin 1s infinite steps(8);animation:icofont-spin 1s infinite steps(8);display:inline-block}@-webkit-keyframes icofont-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes icofont-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.icofont-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.icofont-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.icofont-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.icofont-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.icofont-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.icofont-flip-horizontal.icofont-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .icofont-flip-horizontal,:root .icofont-flip-vertical,:root .icofont-rotate-180,:root .icofont-rotate-270,:root .icofont-rotate-90{-webkit-filter:none;filter:none;display:inline-block}.icofont-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto} -------------------------------------------------------------------------------- /exampleSite/content/posts/placeholder-text.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Placeholder Text" 4 | date = "2019-03-09" 5 | description = "Lorem Ipsum Dolor Si Amet" 6 | tags = [ 7 | "markdown", 8 | "text", 9 | ] 10 | +++ 11 | 12 | Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. 13 | 14 | 1. Exierant elisi ambit vivere dedere 15 | 2. Duce pollice 16 | 3. Eris modo 17 | 4. Spargitque ferrea quos palude 18 | 19 | Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. 20 | 21 | 1. Comas hunc haec pietate fetum procerum dixit 22 | 2. Post torum vates letum Tiresia 23 | 3. Flumen querellas 24 | 4. Arcanaque montibus omnes 25 | 5. Quidem et 26 | 27 | # Vagus elidunt 28 | 29 | 30 | 31 | [The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) 32 | 33 | ## Mane refeci capiebant unda mulcebat 34 | 35 | Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. 36 | 37 | Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. 38 | 39 | Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. 40 | 41 | {{< css.inline >}} 42 | 45 | {{< /css.inline >}} 46 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/auto-render.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a 2 | 3 | 4 | 5 | {{ $title := .Site.Title -}} 6 | {{ if .Params.Title -}} 7 | {{ $title = printf "%s | %s" .Params.Title $title -}} 8 | {{ end -}} 9 | 10 | {{ $description := "" -}} 11 | {{ if .IsHome -}} 12 | {{ with .Site.Params.description }}{{ $description = . }}{{ end -}} 13 | {{ else if .IsPage -}} 14 | {{ if .Description -}} 15 | {{ $description = .Description -}} 16 | {{ else -}} 17 | {{ $description = .Summary -}} 18 | {{ end -}} 19 | {{ end }} 20 | 21 | {{ $title }} 22 | 23 | {{ if $description -}} 24 | 25 | {{ end -}} 26 | 27 | 28 | 29 | 30 | {{ if $description -}} 31 | 32 | {{ end -}} 33 | 34 | 35 | {{ range .AlternativeOutputFormats -}} 36 | {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} 37 | {{ end -}} 38 | 39 | {{/* load mermaid if any mermaid code block */}} 40 | {{ if .Page.Store.Get "hasMermaid" }} 41 | 42 | 43 | {{ end }} 44 | 45 | {{/* load katex if enabled on front matter */}} 46 | {{ if .Params.katex }} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | {{ end }} 56 | 57 | {{ with and .Site.Params.remark42 .Params.show_comments }} 58 | {{ $remark42 := $.Site.Params.remark42 }} 59 | 74 | {{ end }} 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /exampleSite/content/posts/test.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Test" 3 | title = "Code Content" 4 | date = "2021-03-10" 5 | description = "A brief description of Hugo Shortcodes" 6 | tags = [ 7 | "shortcodes", 8 | "privacy", 9 | ] 10 | draft = true 11 | +++ 12 | 13 | ## t1 14 | 15 | aaaa 16 | 17 | 18 | Test [aaa](http://example.com) text. 19 | 20 | ### t1.1 21 | 22 | aaaa 23 | 24 | 25 | ### t1.2 26 | 27 | aaaa 28 | 29 | 30 | #### t1.2.1 31 | 32 | aaaa 33 | 34 | 35 | #### t1.2.2 36 | 37 | aaaa 38 | 39 | 40 | ## t2 41 | 42 | aaaa 43 | 44 | ## t3 45 | 46 | 1. One

47 | 48 | /``` 49 | testing 50 | some 51 | code 52 | /``` 53 | 54 | 2. Two

55 | 3. Three

56 | 57 | 超宽显示 `var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";` 超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示 `var a = "text";` 58 | 59 | ``` 60 | 2021-08-02 17:51:23.718 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Fatal error occurred in the cluster entrypoint. 61 | org.apache.flink.util.FlinkException: Application failed unexpectedly. 62 | at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAndShutdownClusterAsync$0(ApplicationDispatcherBootstrap.java:170) ~[flink-dist_2.12-1.13.1.jar:1.13.1] 63 | at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836) ~[?:1.8.0_292] 64 | at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:811) ~[?:1.8.0_292] 65 | at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_292] 66 | at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990) ~[?:1.8.0_292] 67 | at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:257) ~[flink-dist_2.12-1.13.1.jar:1.13.1] 68 | at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAsync$1(ApplicationDispatcherBootstrap.java:212) ~[flink-dist_2.12-1.13.1.jar:1.13.1] 69 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_292] 70 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292] 71 | at org.apache.flink.runtime.concurrent.akka.ActorSystemScheduledExecutorAdapter$ScheduledFutureTask.run(ActorSystemScheduledExecutorAdapter.java:159) [flink-dist_2.12-1.13.1.jar:1.13.1] 72 | at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) [flink-dist_2.12-1.13.1.jar:1.13.1] 73 | at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) [flink-dist_2.12-1.13.1.jar:1.13.1] 74 | at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [flink-dist_2.12-1.13.1.jar:1.13.1] 75 | at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [flink-dist_2.12-1.13.1.jar:1.13.1] 76 | at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [flink-dist_2.12-1.13.1.jar:1.13.1] 77 | ``` 78 | 79 | 80 | ``` 81 | test 82 | test 83 | test 84 | ``` -------------------------------------------------------------------------------- /static/lib/katex/contrib/copy-tex.mjs: -------------------------------------------------------------------------------- 1 | // Set these to how you want inline and display math to be delimited. 2 | var defaultCopyDelimiters = { 3 | inline: ['$', '$'], 4 | // alternative: ['\(', '\)'] 5 | display: ['$$', '$$'] // alternative: ['\[', '\]'] 6 | 7 | }; // Replace .katex elements with their TeX source ( element). 8 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 9 | // as in copy-tex.js. 10 | 11 | function katexReplaceWithTex(fragment, copyDelimiters) { 12 | if (copyDelimiters === void 0) { 13 | copyDelimiters = defaultCopyDelimiters; 14 | } 15 | 16 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 17 | // (which will get replaced below). 18 | var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 19 | 20 | for (var i = 0; i < katexHtml.length; i++) { 21 | var element = katexHtml[i]; 22 | 23 | if (element.remove) { 24 | element.remove(); 25 | } else if (element.parentNode) { 26 | element.parentNode.removeChild(element); 27 | } 28 | } // Replace .katex-mathml elements with their annotation (TeX source) 29 | // descendant, with inline delimiters. 30 | 31 | 32 | var katexMathml = fragment.querySelectorAll('.katex-mathml'); 33 | 34 | for (var _i = 0; _i < katexMathml.length; _i++) { 35 | var _element = katexMathml[_i]; 36 | 37 | var texSource = _element.querySelector('annotation'); 38 | 39 | if (texSource) { 40 | if (_element.replaceWith) { 41 | _element.replaceWith(texSource); 42 | } else if (_element.parentNode) { 43 | _element.parentNode.replaceChild(texSource, _element); 44 | } 45 | 46 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 47 | } 48 | } // Switch display math to display delimiters. 49 | 50 | 51 | var displays = fragment.querySelectorAll('.katex-display annotation'); 52 | 53 | for (var _i2 = 0; _i2 < displays.length; _i2++) { 54 | var _element2 = displays[_i2]; 55 | _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 56 | } 57 | 58 | return fragment; 59 | } 60 | 61 | function closestKatex(node) { 62 | // If node is a Text Node, for example, go up to containing Element, 63 | // where we can apply the `closest` method. 64 | var element = node instanceof Element ? node : node.parentElement; 65 | return element && element.closest('.katex'); 66 | } // Global copy handler to modify behavior on/within .katex elements. 67 | 68 | 69 | document.addEventListener('copy', function (event) { 70 | var selection = window.getSelection(); 71 | 72 | if (selection.isCollapsed || !event.clipboardData) { 73 | return; // default action OK if selection is empty or unchangeable 74 | } 75 | 76 | var clipboardData = event.clipboardData; 77 | var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. 78 | 79 | var startKatex = closestKatex(range.startContainer); 80 | 81 | if (startKatex) { 82 | range.setStartBefore(startKatex); 83 | } // Similarly, when end point is within a formula, expand to entire formula. 84 | 85 | 86 | var endKatex = closestKatex(range.endContainer); 87 | 88 | if (endKatex) { 89 | range.setEndAfter(endKatex); 90 | } 91 | 92 | var fragment = range.cloneContents(); 93 | 94 | if (!fragment.querySelector('.katex-mathml')) { 95 | return; // default action OK if no .katex-mathml elements 96 | } 97 | 98 | var htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior. 99 | 100 | clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version. 101 | 102 | clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent); // Prevent normal copy handling. 103 | 104 | event.preventDefault(); 105 | }); 106 | -------------------------------------------------------------------------------- /exampleSite/content/posts/markdown-syntax.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Markdown Syntax Guide" 4 | date = "2019-03-11" 5 | description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." 6 | tags = [ 7 | "markdown", 8 | "css", 9 | "html", 10 | ] 11 | categories = [ 12 | "themes", 13 | "syntax", 14 | ] 15 | series = ["Themes Guide"] 16 | aliases = ["migrate-from-jekyl"] 17 | +++ 18 | 19 | This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. 20 | 21 | 22 | ## Headings 23 | 24 | The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. 25 | 26 | # H1 27 | ## H2 28 | ### H3 29 | #### H4 30 | ##### H5 31 | ###### H6 32 | 33 | ## Paragraph 34 | 35 | Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. 36 | 37 | Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. 38 | 39 | ## Blockquotes 40 | 41 | The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. 42 | 43 | #### Blockquote without attribution 44 | 45 | > Tiam, ad mint andaepu dandae nostion secatur sequo quae. 46 | > **Note** that you can use *Markdown syntax* within a blockquote. 47 | 48 | #### Blockquote with attribution 49 | 50 | > Don't communicate by sharing memory, share memory by communicating.
51 | > — Rob Pike[^1] 52 | 53 | [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. 54 | 55 | ## Tables 56 | 57 | Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. 58 | 59 | Name | Age 60 | --------|------ 61 | Bob | 27 62 | Alice | 23 63 | 64 | #### Inline Markdown within tables 65 | 66 | | Italics | Bold | Code | 67 | | -------- | -------- | ------ | 68 | | *italics* | **bold** | `code` | 69 | 70 | ## Code Blocks 71 | 72 | #### Code block with backticks 73 | 74 | ```html 75 | 76 | 77 | 78 | 79 | Example HTML5 Document 80 | 81 | 82 |

Test

83 | 84 | 85 | ``` 86 | 87 | #### Code block indented with four spaces 88 | 89 | 90 | 91 | 92 | 93 | Example HTML5 Document 94 | 95 | 96 |

Test

97 | 98 | 99 | 100 | #### Code block with Hugo's internal highlight shortcode 101 | {{< highlight html >}} 102 | 103 | 104 | 105 | 106 | Example HTML5 Document 107 | 108 | 109 |

Test

110 | 111 | 112 | {{< /highlight >}} 113 | 114 | ## List Types 115 | 116 | #### Ordered List 117 | 118 | 1. First item 119 | 2. Second item 120 | 3. Third item 121 | 122 | #### Unordered List 123 | 124 | * List item 125 | * Another item 126 | * And another item 127 | 128 | #### Nested list 129 | 130 | * Fruit 131 | * Apple 132 | * Orange 133 | * Banana 134 | * Dairy 135 | * Milk 136 | * Cheese 137 | 138 | ## Other Elements — abbr, sub, sup, kbd, mark 139 | 140 | GIF is a bitmap image format. 141 | 142 | H2O 143 | 144 | Xn + Yn = Zn 145 | 146 | Press CTRL+ALT+Delete to end the session. 147 | 148 | Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. 149 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/mathtex-script-type.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else { 7 | var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | /******/ var __webpack_modules__ = ({ 14 | 15 | /***/ 771: 16 | /***/ (function(module) { 17 | 18 | module.exports = __WEBPACK_EXTERNAL_MODULE__771__; 19 | 20 | /***/ }) 21 | 22 | /******/ }); 23 | /************************************************************************/ 24 | /******/ // The module cache 25 | /******/ var __webpack_module_cache__ = {}; 26 | /******/ 27 | /******/ // The require function 28 | /******/ function __webpack_require__(moduleId) { 29 | /******/ // Check if module is in cache 30 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 31 | /******/ if (cachedModule !== undefined) { 32 | /******/ return cachedModule.exports; 33 | /******/ } 34 | /******/ // Create a new module (and put it into the cache) 35 | /******/ var module = __webpack_module_cache__[moduleId] = { 36 | /******/ // no module.id needed 37 | /******/ // no module.loaded needed 38 | /******/ exports: {} 39 | /******/ }; 40 | /******/ 41 | /******/ // Execute the module function 42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 43 | /******/ 44 | /******/ // Return the exports of the module 45 | /******/ return module.exports; 46 | /******/ } 47 | /******/ 48 | /************************************************************************/ 49 | /******/ /* webpack/runtime/compat get default export */ 50 | /******/ !function() { 51 | /******/ // getDefaultExport function for compatibility with non-harmony modules 52 | /******/ __webpack_require__.n = function(module) { 53 | /******/ var getter = module && module.__esModule ? 54 | /******/ function() { return module['default']; } : 55 | /******/ function() { return module; }; 56 | /******/ __webpack_require__.d(getter, { a: getter }); 57 | /******/ return getter; 58 | /******/ }; 59 | /******/ }(); 60 | /******/ 61 | /******/ /* webpack/runtime/define property getters */ 62 | /******/ !function() { 63 | /******/ // define getter functions for harmony exports 64 | /******/ __webpack_require__.d = function(exports, definition) { 65 | /******/ for(var key in definition) { 66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 68 | /******/ } 69 | /******/ } 70 | /******/ }; 71 | /******/ }(); 72 | /******/ 73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 74 | /******/ !function() { 75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 76 | /******/ }(); 77 | /******/ 78 | /************************************************************************/ 79 | var __webpack_exports__ = {}; 80 | // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 81 | !function() { 82 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771); 83 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__); 84 | 85 | var scripts = document.body.getElementsByTagName("script"); 86 | scripts = Array.prototype.slice.call(scripts); 87 | scripts.forEach(function (script) { 88 | if (!script.type || !script.type.match(/math\/tex/i)) { 89 | return -1; 90 | } 91 | 92 | var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 93 | var katexElement = document.createElement(display ? "div" : "span"); 94 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 95 | 96 | try { 97 | katex__WEBPACK_IMPORTED_MODULE_0___default().render(script.text, katexElement, { 98 | displayMode: display 99 | }); 100 | } catch (err) { 101 | //console.error(err); linter doesn't like this 102 | katexElement.textContent = script.text; 103 | } 104 | 105 | script.parentNode.replaceChild(katexElement, script); 106 | }); 107 | }(); 108 | __webpack_exports__ = __webpack_exports__["default"]; 109 | /******/ return __webpack_exports__; 110 | /******/ })() 111 | ; 112 | }); -------------------------------------------------------------------------------- /static/lib/katex/contrib/copy-tex.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(); 4 | else if(typeof define === 'function' && define.amd) 5 | define([], factory); 6 | else { 7 | var a = factory(); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function() { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | var __webpack_exports__ = {}; 14 | 15 | ;// CONCATENATED MODULE: ./contrib/copy-tex/katex2tex.js 16 | // Set these to how you want inline and display math to be delimited. 17 | var defaultCopyDelimiters = { 18 | inline: ['$', '$'], 19 | // alternative: ['\(', '\)'] 20 | display: ['$$', '$$'] // alternative: ['\[', '\]'] 21 | 22 | }; // Replace .katex elements with their TeX source ( element). 23 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 24 | // as in copy-tex.js. 25 | 26 | function katexReplaceWithTex(fragment, copyDelimiters) { 27 | if (copyDelimiters === void 0) { 28 | copyDelimiters = defaultCopyDelimiters; 29 | } 30 | 31 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 32 | // (which will get replaced below). 33 | var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 34 | 35 | for (var i = 0; i < katexHtml.length; i++) { 36 | var element = katexHtml[i]; 37 | 38 | if (element.remove) { 39 | element.remove(); 40 | } else if (element.parentNode) { 41 | element.parentNode.removeChild(element); 42 | } 43 | } // Replace .katex-mathml elements with their annotation (TeX source) 44 | // descendant, with inline delimiters. 45 | 46 | 47 | var katexMathml = fragment.querySelectorAll('.katex-mathml'); 48 | 49 | for (var _i = 0; _i < katexMathml.length; _i++) { 50 | var _element = katexMathml[_i]; 51 | 52 | var texSource = _element.querySelector('annotation'); 53 | 54 | if (texSource) { 55 | if (_element.replaceWith) { 56 | _element.replaceWith(texSource); 57 | } else if (_element.parentNode) { 58 | _element.parentNode.replaceChild(texSource, _element); 59 | } 60 | 61 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 62 | } 63 | } // Switch display math to display delimiters. 64 | 65 | 66 | var displays = fragment.querySelectorAll('.katex-display annotation'); 67 | 68 | for (var _i2 = 0; _i2 < displays.length; _i2++) { 69 | var _element2 = displays[_i2]; 70 | _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 71 | } 72 | 73 | return fragment; 74 | } 75 | /* harmony default export */ var katex2tex = (katexReplaceWithTex); 76 | ;// CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.js 77 | // Return
element containing node, or null if not found. 78 | 79 | function closestKatex(node) { 80 | // If node is a Text Node, for example, go up to containing Element, 81 | // where we can apply the `closest` method. 82 | var element = node instanceof Element ? node : node.parentElement; 83 | return element && element.closest('.katex'); 84 | } // Global copy handler to modify behavior on/within .katex elements. 85 | 86 | 87 | document.addEventListener('copy', function (event) { 88 | var selection = window.getSelection(); 89 | 90 | if (selection.isCollapsed || !event.clipboardData) { 91 | return; // default action OK if selection is empty or unchangeable 92 | } 93 | 94 | var clipboardData = event.clipboardData; 95 | var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. 96 | 97 | var startKatex = closestKatex(range.startContainer); 98 | 99 | if (startKatex) { 100 | range.setStartBefore(startKatex); 101 | } // Similarly, when end point is within a formula, expand to entire formula. 102 | 103 | 104 | var endKatex = closestKatex(range.endContainer); 105 | 106 | if (endKatex) { 107 | range.setEndAfter(endKatex); 108 | } 109 | 110 | var fragment = range.cloneContents(); 111 | 112 | if (!fragment.querySelector('.katex-mathml')) { 113 | return; // default action OK if no .katex-mathml elements 114 | } 115 | 116 | var htmlContents = Array.prototype.map.call(fragment.childNodes, function (el) { 117 | return el instanceof Text ? el.textContent : el.outerHTML; 118 | }).join(''); // Preserve usual HTML copy/paste behavior. 119 | 120 | clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version. 121 | 122 | clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling. 123 | 124 | event.preventDefault(); 125 | }); 126 | __webpack_exports__ = __webpack_exports__["default"]; 127 | /******/ return __webpack_exports__; 128 | /******/ })() 129 | ; 130 | }); -------------------------------------------------------------------------------- /static/lib/icofont/icofont.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package IcoFont 3 | * @version 1.0.1 4 | * @author IcoFont https://icofont.com 5 | * @copyright Copyright (c) 2015 - 2022 IcoFont 6 | * @license - https://icofont.com/license/ 7 | */ 8 | 9 | @font-face 10 | { 11 | 12 | font-family: "IcoFont"; 13 | font-weight: normal; 14 | font-style: "Regular"; 15 | src: url("./fonts/icofont.woff2") format("woff2"), 16 | url("./fonts/icofont.woff") format("woff"); 17 | } 18 | 19 | [class^="icofont-"], [class*=" icofont-"] 20 | { 21 | font-family: 'IcoFont' !important; 22 | speak: none; 23 | font-style: normal; 24 | font-weight: normal; 25 | font-variant: normal; 26 | text-transform: none; 27 | white-space: nowrap; 28 | word-wrap: normal; 29 | direction: ltr; 30 | line-height: 1; 31 | /* Better Font Rendering =========== */ 32 | -webkit-font-feature-settings: "liga"; 33 | -webkit-font-smoothing: antialiased; 34 | } 35 | 36 | .icofont-rss:before 37 | { 38 | content: "\ed64"; 39 | } 40 | 41 | .icofont-xs 42 | { 43 | font-size: .5em; 44 | } 45 | 46 | .icofont-sm 47 | { 48 | font-size: .75em; 49 | } 50 | 51 | .icofont-md 52 | { 53 | font-size: 1.25em; 54 | } 55 | 56 | .icofont-lg 57 | { 58 | font-size: 1.5em; 59 | } 60 | 61 | .icofont-1x 62 | { 63 | font-size: 1em; 64 | } 65 | 66 | .icofont-2x 67 | { 68 | font-size: 2em; 69 | } 70 | 71 | .icofont-3x 72 | { 73 | font-size: 3em; 74 | } 75 | 76 | .icofont-4x 77 | { 78 | font-size: 4em; 79 | } 80 | 81 | .icofont-5x 82 | { 83 | font-size: 5em; 84 | } 85 | 86 | .icofont-6x 87 | { 88 | font-size: 6em; 89 | } 90 | 91 | .icofont-7x 92 | { 93 | font-size: 7em; 94 | } 95 | 96 | .icofont-8x 97 | { 98 | font-size: 8em; 99 | } 100 | 101 | .icofont-9x 102 | { 103 | font-size: 9em; 104 | } 105 | 106 | .icofont-10x 107 | { 108 | font-size: 10em; 109 | } 110 | 111 | .icofont-fw 112 | { 113 | text-align: center; 114 | width: 1.25em; 115 | } 116 | 117 | .icofont-ul 118 | { 119 | list-style-type: none; 120 | padding-left: 0; 121 | margin-left: 0; 122 | } 123 | 124 | .icofont-ul > li 125 | { 126 | position: relative; 127 | line-height: 2em; 128 | } 129 | 130 | .icofont-ul > li .icofont 131 | { 132 | display: inline-block; 133 | vertical-align: middle; 134 | } 135 | 136 | .icofont-border 137 | { 138 | border: solid 0.08em #f1f1f1; 139 | border-radius: .1em; 140 | padding: .2em .25em .15em; 141 | } 142 | 143 | .icofont-pull-left 144 | { 145 | float: left; 146 | } 147 | 148 | .icofont-pull-right 149 | { 150 | float: right; 151 | } 152 | 153 | .icofont.icofont-pull-left 154 | { 155 | margin-right: .3em; 156 | } 157 | 158 | .icofont.icofont-pull-right 159 | { 160 | margin-left: .3em; 161 | } 162 | 163 | .icofont-spin 164 | { 165 | -webkit-animation: icofont-spin 2s infinite linear; 166 | animation: icofont-spin 2s infinite linear; 167 | display: inline-block; 168 | } 169 | 170 | .icofont-pulse 171 | { 172 | -webkit-animation: icofont-spin 1s infinite steps(8); 173 | animation: icofont-spin 1s infinite steps(8); 174 | display: inline-block; 175 | } 176 | 177 | @-webkit-keyframes icofont-spin 178 | { 179 | 0% 180 | { 181 | -webkit-transform: rotate(0deg); 182 | transform: rotate(0deg); 183 | } 184 | 185 | 100% 186 | { 187 | -webkit-transform: rotate(360deg); 188 | transform: rotate(360deg); 189 | } 190 | } 191 | 192 | @keyframes icofont-spin 193 | { 194 | 0% 195 | { 196 | -webkit-transform: rotate(0deg); 197 | transform: rotate(0deg); 198 | } 199 | 200 | 100% 201 | { 202 | -webkit-transform: rotate(360deg); 203 | transform: rotate(360deg); 204 | } 205 | } 206 | 207 | .icofont-rotate-90 208 | { 209 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; 210 | -webkit-transform: rotate(90deg); 211 | transform: rotate(90deg); 212 | } 213 | 214 | .icofont-rotate-180 215 | { 216 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; 217 | -webkit-transform: rotate(180deg); 218 | transform: rotate(180deg); 219 | } 220 | 221 | .icofont-rotate-270 222 | { 223 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; 224 | -webkit-transform: rotate(270deg); 225 | transform: rotate(270deg); 226 | } 227 | 228 | .icofont-flip-horizontal 229 | { 230 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; 231 | -webkit-transform: scale(-1, 1); 232 | transform: scale(-1, 1); 233 | } 234 | 235 | .icofont-flip-vertical 236 | { 237 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; 238 | -webkit-transform: scale(1, -1); 239 | transform: scale(1, -1); 240 | } 241 | 242 | .icofont-flip-horizontal.icofont-flip-vertical 243 | { 244 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; 245 | -webkit-transform: scale(-1, -1); 246 | transform: scale(-1, -1); 247 | } 248 | 249 | :root .icofont-rotate-90, 250 | :root .icofont-rotate-180, 251 | :root .icofont-rotate-270, 252 | :root .icofont-flip-horizontal, 253 | :root .icofont-flip-vertical 254 | { 255 | -webkit-filter: none; 256 | filter: none; 257 | display: inline-block; 258 | } 259 | 260 | .icofont-inverse 261 | { 262 | color: #fff; 263 | } 264 | 265 | .sr-only 266 | { 267 | border: 0; 268 | clip: rect(0, 0, 0, 0); 269 | height: 1px; 270 | margin: -1px; 271 | overflow: hidden; 272 | padding: 0; 273 | position: absolute; 274 | width: 1px; 275 | } 276 | 277 | .sr-only-focusable:active, 278 | .sr-only-focusable:focus 279 | { 280 | clip: auto; 281 | height: auto; 282 | margin: 0; 283 | overflow: visible; 284 | position: static; 285 | width: auto; 286 | } 287 | -------------------------------------------------------------------------------- /static/lib/katex/README.md: -------------------------------------------------------------------------------- 1 | # [KaTeX](https://katex.org/) 2 | [![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex) 3 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 4 | [![CI](https://github.com/KaTeX/KaTeX/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI) 5 | [![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/main/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX) 6 | [![Discussions](https://img.shields.io/badge/Discussions-join-brightgreen)](https://github.com/KaTeX/KaTeX/discussions) 7 | [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex) 8 | ![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip) 9 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX) 10 | [![Financial Contributors on Open Collective](https://opencollective.com/katex/all/badge.svg?label=financial+contributors)](https://opencollective.com/katex) 11 | 12 | KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. 13 | 14 | * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](https://www.intmath.com/cg5/katex-mathjax-comparison.php). 15 | * **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting. 16 | * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. 17 | * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML. 18 | 19 | KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11. 20 | 21 | KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html). 22 | 23 | Try out KaTeX [on the demo page](https://katex.org/#demo)! 24 | 25 | ## Getting started 26 | 27 | ### Starter template 28 | 29 | ```html 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 43 | ... 44 | 45 | ``` 46 | 47 | You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself. 48 | 49 | For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html). 50 | 51 | ### API 52 | 53 | Call `katex.render` to render a TeX expression directly into a DOM element. 54 | For example: 55 | 56 | ```js 57 | katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { 58 | throwOnError: false 59 | }); 60 | ``` 61 | 62 | Call `katex.renderToString` to generate an HTML string of the rendered math, 63 | e.g., for server-side rendering. For example: 64 | 65 | ```js 66 | var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", { 67 | throwOnError: false 68 | }); 69 | // '...' 70 | ``` 71 | 72 | Make sure to include the CSS and font files in both cases. 73 | If you are doing all rendering on the server, there is no need to include the 74 | JavaScript on the client. 75 | 76 | The examples above use the `throwOnError: false` option, which renders invalid 77 | inputs as the TeX source code in red (by default), with the error message as 78 | hover text. For other available options, see the 79 | [API documentation](https://katex.org/docs/api.html), 80 | [options documentation](https://katex.org/docs/options.html), and 81 | [handling errors documentation](https://katex.org/docs/error.html). 82 | 83 | ## Demo and Documentation 84 | 85 | Learn more about using KaTeX [on the website](https://katex.org)! 86 | 87 | ## Contributors 88 | 89 | ### Code Contributors 90 | 91 | This project exists thanks to all the people who contribute code. If you'd like to help, see [our guide to contributing code](CONTRIBUTING.md). 92 | Code contributors 93 | 94 | ### Financial Contributors 95 | 96 | Become a financial contributor and help us sustain our community. 97 | 98 | #### Individuals 99 | 100 | Contribute on Open Collective 101 | 102 | #### Organizations 103 | 104 | Support this project with your organization. Your logo will show up here with a link to your website. 105 | 106 | Organization 1 107 | Organization 2 108 | Organization 3 109 | Organization 4 110 | Organization 5 111 | Organization 6 112 | Organization 7 113 | Organization 8 114 | Organization 9 115 | Organization 10 116 | 117 | ## License 118 | 119 | KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT). 120 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/auto-render.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | /* eslint no-constant-condition:0 */ 4 | var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) { 5 | // Adapted from 6 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx 7 | var index = startIndex; 8 | var braceLevel = 0; 9 | var delimLength = delimiter.length; 10 | 11 | while (index < text.length) { 12 | var character = text[index]; 13 | 14 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) { 15 | return index; 16 | } else if (character === "\\") { 17 | index++; 18 | } else if (character === "{") { 19 | braceLevel++; 20 | } else if (character === "}") { 21 | braceLevel--; 22 | } 23 | 24 | index++; 25 | } 26 | 27 | return -1; 28 | }; 29 | 30 | var escapeRegex = function escapeRegex(string) { 31 | return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); 32 | }; 33 | 34 | var amsRegex = /^\\begin{/; 35 | 36 | var splitAtDelimiters = function splitAtDelimiters(text, delimiters) { 37 | var index; 38 | var data = []; 39 | var regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")"); 40 | 41 | while (true) { 42 | index = text.search(regexLeft); 43 | 44 | if (index === -1) { 45 | break; 46 | } 47 | 48 | if (index > 0) { 49 | data.push({ 50 | type: "text", 51 | data: text.slice(0, index) 52 | }); 53 | text = text.slice(index); // now text starts with delimiter 54 | } // ... so this always succeeds: 55 | 56 | 57 | var i = delimiters.findIndex(delim => text.startsWith(delim.left)); 58 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length); 59 | 60 | if (index === -1) { 61 | break; 62 | } 63 | 64 | var rawData = text.slice(0, index + delimiters[i].right.length); 65 | var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); 66 | data.push({ 67 | type: "math", 68 | data: math, 69 | rawData, 70 | display: delimiters[i].display 71 | }); 72 | text = text.slice(index + delimiters[i].right.length); 73 | } 74 | 75 | if (text !== "") { 76 | data.push({ 77 | type: "text", 78 | data: text 79 | }); 80 | } 81 | 82 | return data; 83 | }; 84 | 85 | /* eslint no-console:0 */ 86 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the 87 | * API, we should copy it before mutating. 88 | */ 89 | 90 | var renderMathInText = function renderMathInText(text, optionsCopy) { 91 | var data = splitAtDelimiters(text, optionsCopy.delimiters); 92 | 93 | if (data.length === 1 && data[0].type === 'text') { 94 | // There is no formula in the text. 95 | // Let's return null which means there is no need to replace 96 | // the current text node with a new one. 97 | return null; 98 | } 99 | 100 | var fragment = document.createDocumentFragment(); 101 | 102 | for (var i = 0; i < data.length; i++) { 103 | if (data[i].type === "text") { 104 | fragment.appendChild(document.createTextNode(data[i].data)); 105 | } else { 106 | var span = document.createElement("span"); 107 | var math = data[i].data; // Override any display mode defined in the settings with that 108 | // defined by the text itself 109 | 110 | optionsCopy.displayMode = data[i].display; 111 | 112 | try { 113 | if (optionsCopy.preProcess) { 114 | math = optionsCopy.preProcess(math); 115 | } 116 | 117 | katex.render(math, span, optionsCopy); 118 | } catch (e) { 119 | if (!(e instanceof katex.ParseError)) { 120 | throw e; 121 | } 122 | 123 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e); 124 | fragment.appendChild(document.createTextNode(data[i].rawData)); 125 | continue; 126 | } 127 | 128 | fragment.appendChild(span); 129 | } 130 | } 131 | 132 | return fragment; 133 | }; 134 | 135 | var renderElem = function renderElem(elem, optionsCopy) { 136 | for (var i = 0; i < elem.childNodes.length; i++) { 137 | var childNode = elem.childNodes[i]; 138 | 139 | if (childNode.nodeType === 3) { 140 | // Text node 141 | // Concatenate all sibling text nodes. 142 | // Webkit browsers split very large text nodes into smaller ones, 143 | // so the delimiters may be split across different nodes. 144 | var textContentConcat = childNode.textContent; 145 | var sibling = childNode.nextSibling; 146 | var nSiblings = 0; 147 | 148 | while (sibling && sibling.nodeType === Node.TEXT_NODE) { 149 | textContentConcat += sibling.textContent; 150 | sibling = sibling.nextSibling; 151 | nSiblings++; 152 | } 153 | 154 | var frag = renderMathInText(textContentConcat, optionsCopy); 155 | 156 | if (frag) { 157 | // Remove extra text nodes 158 | for (var j = 0; j < nSiblings; j++) { 159 | childNode.nextSibling.remove(); 160 | } 161 | 162 | i += frag.childNodes.length - 1; 163 | elem.replaceChild(frag, childNode); 164 | } else { 165 | // If the concatenated text does not contain math 166 | // the siblings will not either 167 | i += nSiblings; 168 | } 169 | } else if (childNode.nodeType === 1) { 170 | (function () { 171 | // Element node 172 | var className = ' ' + childNode.className + ' '; 173 | var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1); 174 | 175 | if (shouldRender) { 176 | renderElem(childNode, optionsCopy); 177 | } 178 | })(); 179 | } // Otherwise, it's something else, and ignore it. 180 | 181 | } 182 | }; 183 | 184 | var renderMathInElement = function renderMathInElement(elem, options) { 185 | if (!elem) { 186 | throw new Error("No element provided to render"); 187 | } 188 | 189 | var optionsCopy = {}; // Object.assign(optionsCopy, option) 190 | 191 | for (var option in options) { 192 | if (options.hasOwnProperty(option)) { 193 | optionsCopy[option] = options[option]; 194 | } 195 | } // default options 196 | 197 | 198 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 199 | left: "$$", 200 | right: "$$", 201 | display: true 202 | }, { 203 | left: "\\(", 204 | right: "\\)", 205 | display: false 206 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 207 | // {left: "$", right: "$", display: false}, 208 | // $ must come after $$ 209 | // Render AMS environments even if outside $$…$$ delimiters. 210 | { 211 | left: "\\begin{equation}", 212 | right: "\\end{equation}", 213 | display: true 214 | }, { 215 | left: "\\begin{align}", 216 | right: "\\end{align}", 217 | display: true 218 | }, { 219 | left: "\\begin{alignat}", 220 | right: "\\end{alignat}", 221 | display: true 222 | }, { 223 | left: "\\begin{gather}", 224 | right: "\\end{gather}", 225 | display: true 226 | }, { 227 | left: "\\begin{CD}", 228 | right: "\\end{CD}", 229 | display: true 230 | }, { 231 | left: "\\[", 232 | right: "\\]", 233 | display: true 234 | }]; 235 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 236 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 237 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 238 | // math elements within a single call to `renderMathInElement`. 239 | 240 | optionsCopy.macros = optionsCopy.macros || {}; 241 | renderElem(elem, optionsCopy); 242 | }; 243 | 244 | export { renderMathInElement as default }; 245 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/render-a11y-string.min.js: -------------------------------------------------------------------------------- 1 | !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var a="object"==typeof exports?r(require("katex")):r(e.katex);for(var t in a)("object"==typeof exports?exports:e)[t]=a[t]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={771:function(r){r.exports=e}},a={};function t(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},t.d=function(e,r){for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o,n,s,i,l,c,u,p,d,b,h,m,f,y,w={};return o=t(771),n=t.n(o),s={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},i={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},l={"|":"open vertical bar",".":""},c={"|":"close vertical bar",".":""},u={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},p={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},d={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},b=function(e,r,a){var t;e&&(/^\d+$/.test(t="open"===r?e in l?l[e]:s[e]||e:"close"===r?e in c?c[e]:s[e]||e:"bin"===r?u[e]||e:"rel"===r?p[e]||e:s[e]||e)&&a.length>0&&/^\d+$/.test(a[a.length-1])?a[a.length-1]+=t:t&&a.push(t))},h=function(e,r){var a=[];e.push(a),r(a)},m=function(e,r,a){switch(e.type){case"accent":h(r,(function(r){f(e.base,r,a),r.push("with"),b(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":h(r,(function(r){f(e.base,r,a),r.push("with"),b(d[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":break;case"atom":var t=e.text;switch(e.family){case"bin":b(t,"bin",r);break;case"close":b(t,"close",r);break;case"inner":b(e.text,"inner",r);break;case"open":b(t,"open",r);break;case"punct":b(t,"punct",r);break;case"rel":b(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break;case"color":var o=e.color.replace(/katex-/,"");h(r,(function(r){r.push("start color "+o),f(e.body,r,a),r.push("end color "+o)}));break;case"color-token":break;case"delimsizing":e.delim&&"."!==e.delim&&b(e.delim,"normal",r);break;case"genfrac":h(r,(function(r){var t=e.leftDelim,o=e.rightDelim;e.hasBarLine?(r.push("start fraction"),t&&b(t,"open",r),f(e.numer,r,a),r.push("divided by"),f(e.denom,r,a),o&&b(o,"close",r),r.push("end fraction")):(r.push("start binomial"),t&&b(t,"open",r),f(e.numer,r,a),r.push("over"),f(e.denom,r,a),o&&b(o,"close",r),r.push("end binomial"))}));break;case"hbox":f(e.body,r,a);break;case"kern":break;case"leftright":h(r,(function(r){b(e.left,"open",r),f(e.body,r,a),b(e.right,"close",r)}));break;case"leftright-right":break;case"lap":f(e.body,r,a);break;case"mathord":b(e.text,"normal",r);break;case"op":var n=e.body,s=e.name;n?f(n,r,a):s&&b(s,"normal",r);break;case"op-token":b(e.text,a,r);break;case"ordgroup":f(e.body,r,a);break;case"overline":h(r,(function(r){r.push("start overline"),f(e.body,r,a),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"raisebox":f(e.body,r,a);break;case"rule":r.push("rectangle");break;case"sizing":f(e.body,r,a);break;case"spacing":r.push("space");break;case"styling":f(e.body,r,a);break;case"sqrt":h(r,(function(r){var t=e.body,o=e.index;if(o)return"3"===y(f(o,[],a)).join(",")?(r.push("cube root of"),f(t,r,a),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,a),void r.push("end index"));r.push("square root of"),f(t,r,a),r.push("end square root")}));break;case"supsub":var l=e.base,c=e.sub,u=e.sup,p=!1;if(l&&(f(l,r,a),p="op"===l.type&&"\\log"===l.name),c){var m=p?"base":"subscript";h(r,(function(e){e.push("start "+m),f(c,e,a),e.push("end "+m)}))}u&&h(r,(function(e){var r=y(f(u,[],a)).join(",");r in i?e.push(i[r]):(e.push("start superscript"),f(u,e,a),e.push("end superscript"))}));break;case"text":if("\\textbf"===e.font){h(r,(function(r){r.push("start bold text"),f(e.body,r,a),r.push("end bold text")}));break}h(r,(function(r){r.push("start text"),f(e.body,r,a),r.push("end text")}));break;case"textord":b(e.text,a,r);break;case"smash":f(e.body,r,a);break;case"enclose":if(/cancel/.test(e.label)){h(r,(function(r){r.push("start cancel"),f(e.body,r,a),r.push("end cancel")}));break}if(/box/.test(e.label)){h(r,(function(r){r.push("start box"),f(e.body,r,a),r.push("end box")}));break}if(/sout/.test(e.label)){h(r,(function(r){r.push("start strikeout"),f(e.body,r,a),r.push("end strikeout")}));break}if(/phase/.test(e.label)){h(r,(function(r){r.push("start phase angle"),f(e.body,r,a),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vcenter":f(e.body,r,a);break;case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"operatorname":f(e.body,r,a);break;case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"size":break;case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":b("start verbatim","normal",r),b(e.body,"normal",r),b("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":b("start "+e.label.slice(1),"normal",r),f(e.base,r,a),b("end "+e.label.slice(1),"normal",r);break;case"infix":break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"font":f(e.body,r,a);break;case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":h(r,(function(r){r.push("start underline"),f(e.body,r,a),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":var w=e.mclass.slice(1);f(e.body,r,w);break;case"mathchoice":f(e.text,r,a);break;case"htmlmathml":f(e.mathml,r,a);break;case"middle":b(e.delim,a,r);break;case"internal":break;case"html":f(e.body,r,a);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}},f=function e(r,a,t){if(void 0===a&&(a=[]),r instanceof Array)for(var o=0;o 0) { 140 | data.push({ 141 | type: "text", 142 | data: text.slice(0, index) 143 | }); 144 | text = text.slice(index); // now text starts with delimiter 145 | } // ... so this always succeeds: 146 | 147 | 148 | var i = delimiters.findIndex(function (delim) { 149 | return text.startsWith(delim.left); 150 | }); 151 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length); 152 | 153 | if (index === -1) { 154 | break; 155 | } 156 | 157 | var rawData = text.slice(0, index + delimiters[i].right.length); 158 | var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); 159 | data.push({ 160 | type: "math", 161 | data: math, 162 | rawData: rawData, 163 | display: delimiters[i].display 164 | }); 165 | text = text.slice(index + delimiters[i].right.length); 166 | } 167 | 168 | if (text !== "") { 169 | data.push({ 170 | type: "text", 171 | data: text 172 | }); 173 | } 174 | 175 | return data; 176 | }; 177 | 178 | /* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters); 179 | ;// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js 180 | /* eslint no-console:0 */ 181 | 182 | 183 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the 184 | * API, we should copy it before mutating. 185 | */ 186 | 187 | var renderMathInText = function renderMathInText(text, optionsCopy) { 188 | var data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters); 189 | 190 | if (data.length === 1 && data[0].type === 'text') { 191 | // There is no formula in the text. 192 | // Let's return null which means there is no need to replace 193 | // the current text node with a new one. 194 | return null; 195 | } 196 | 197 | var fragment = document.createDocumentFragment(); 198 | 199 | for (var i = 0; i < data.length; i++) { 200 | if (data[i].type === "text") { 201 | fragment.appendChild(document.createTextNode(data[i].data)); 202 | } else { 203 | var span = document.createElement("span"); 204 | var math = data[i].data; // Override any display mode defined in the settings with that 205 | // defined by the text itself 206 | 207 | optionsCopy.displayMode = data[i].display; 208 | 209 | try { 210 | if (optionsCopy.preProcess) { 211 | math = optionsCopy.preProcess(math); 212 | } 213 | 214 | external_katex_default().render(math, span, optionsCopy); 215 | } catch (e) { 216 | if (!(e instanceof (external_katex_default()).ParseError)) { 217 | throw e; 218 | } 219 | 220 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e); 221 | fragment.appendChild(document.createTextNode(data[i].rawData)); 222 | continue; 223 | } 224 | 225 | fragment.appendChild(span); 226 | } 227 | } 228 | 229 | return fragment; 230 | }; 231 | 232 | var renderElem = function renderElem(elem, optionsCopy) { 233 | for (var i = 0; i < elem.childNodes.length; i++) { 234 | var childNode = elem.childNodes[i]; 235 | 236 | if (childNode.nodeType === 3) { 237 | // Text node 238 | // Concatenate all sibling text nodes. 239 | // Webkit browsers split very large text nodes into smaller ones, 240 | // so the delimiters may be split across different nodes. 241 | var textContentConcat = childNode.textContent; 242 | var sibling = childNode.nextSibling; 243 | var nSiblings = 0; 244 | 245 | while (sibling && sibling.nodeType === Node.TEXT_NODE) { 246 | textContentConcat += sibling.textContent; 247 | sibling = sibling.nextSibling; 248 | nSiblings++; 249 | } 250 | 251 | var frag = renderMathInText(textContentConcat, optionsCopy); 252 | 253 | if (frag) { 254 | // Remove extra text nodes 255 | for (var j = 0; j < nSiblings; j++) { 256 | childNode.nextSibling.remove(); 257 | } 258 | 259 | i += frag.childNodes.length - 1; 260 | elem.replaceChild(frag, childNode); 261 | } else { 262 | // If the concatenated text does not contain math 263 | // the siblings will not either 264 | i += nSiblings; 265 | } 266 | } else if (childNode.nodeType === 1) { 267 | (function () { 268 | // Element node 269 | var className = ' ' + childNode.className + ' '; 270 | var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) { 271 | return className.indexOf(' ' + x + ' ') === -1; 272 | }); 273 | 274 | if (shouldRender) { 275 | renderElem(childNode, optionsCopy); 276 | } 277 | })(); 278 | } // Otherwise, it's something else, and ignore it. 279 | 280 | } 281 | }; 282 | 283 | var renderMathInElement = function renderMathInElement(elem, options) { 284 | if (!elem) { 285 | throw new Error("No element provided to render"); 286 | } 287 | 288 | var optionsCopy = {}; // Object.assign(optionsCopy, option) 289 | 290 | for (var option in options) { 291 | if (options.hasOwnProperty(option)) { 292 | optionsCopy[option] = options[option]; 293 | } 294 | } // default options 295 | 296 | 297 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 298 | left: "$$", 299 | right: "$$", 300 | display: true 301 | }, { 302 | left: "\\(", 303 | right: "\\)", 304 | display: false 305 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 306 | // {left: "$", right: "$", display: false}, 307 | // $ must come after $$ 308 | // Render AMS environments even if outside $$…$$ delimiters. 309 | { 310 | left: "\\begin{equation}", 311 | right: "\\end{equation}", 312 | display: true 313 | }, { 314 | left: "\\begin{align}", 315 | right: "\\end{align}", 316 | display: true 317 | }, { 318 | left: "\\begin{alignat}", 319 | right: "\\end{alignat}", 320 | display: true 321 | }, { 322 | left: "\\begin{gather}", 323 | right: "\\end{gather}", 324 | display: true 325 | }, { 326 | left: "\\begin{CD}", 327 | right: "\\end{CD}", 328 | display: true 329 | }, { 330 | left: "\\[", 331 | right: "\\]", 332 | display: true 333 | }]; 334 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 335 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 336 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 337 | // math elements within a single call to `renderMathInElement`. 338 | 339 | optionsCopy.macros = optionsCopy.macros || {}; 340 | renderElem(elem, optionsCopy); 341 | }; 342 | 343 | /* harmony default export */ var auto_render = (renderMathInElement); 344 | }(); 345 | __webpack_exports__ = __webpack_exports__["default"]; 346 | /******/ return __webpack_exports__; 347 | /******/ })() 348 | ; 349 | }); -------------------------------------------------------------------------------- /static/css/style.css: -------------------------------------------------------------------------------- 1 | /* defines light color */ 2 | :root { 3 | --color-light-bg-page: #EBEBEB; 4 | --color-light-bg-content: #F4F4F4; 5 | --color-light-bg-block: #EBEBEB; 6 | --color-light-bg-shadow: #E0E0E0; 7 | --color-light-fg-font-normal: #4E403E; 8 | --color-light-fg-font-hover: #555555; 9 | --color-light-fg-font-quote: #57606A; 10 | --color-light-fg-tiny-line: #e0e0e0; 11 | --color-light-fg-marker-quote: #BFBFBF; 12 | --color-light-fg-font-hyper: #4E403E; 13 | --color-light-fg-font-hyper-hover: #DE629E; 14 | --color-light-fg-hyperlink: #DE629E; 15 | --color-light-fg-hyperlink-hover: #CB3E50; 16 | --color-light-bg-pager-normal: #D4D4D4; 17 | --color-light-bg-pager-current: #E4E4E4; 18 | --color-light-bg-pager-hover: #ECECEC; 19 | } 20 | 21 | /* defines dark color */ 22 | :root { 23 | --color-dark-bg-page: #202124; 24 | --color-dark-bg-content: #262628; 25 | --color-dark-bg-block: #2B2B2B; 26 | --color-dark-bg-shadow: #505050; 27 | --color-dark-fg-font-normal: #C2C2B6; 28 | --color-dark-fg-font-hover: #D2D2D3; 29 | --color-dark-fg-font-quote: #8B8680; 30 | --color-dark-fg-tiny-line: #3B3B3B; 31 | --color-dark-fg-marker-quote: #6F6B66; 32 | --color-dark-fg-font-hyper: #C2C2B6; 33 | --color-dark-fg-font-hyper-hover: #DE629E; 34 | --color-dark-fg-hyperlink: #DE629E; 35 | --color-dark-fg-hyperlink-hover: #CB3E50; 36 | --color-dark-bg-pager-normal: #303030; 37 | --color-dark-bg-pager-current: #3A3A3E; 38 | --color-dark-bg-pager-hover: #444446; 39 | } 40 | 41 | :root { 42 | --color-bg-page: var(--color-light-bg-page); 43 | --color-bg-content: var(--color-light-bg-content); 44 | --color-bg-block: var(--color-light-bg-block); 45 | --color-bg-shadow: var(--color-light-bg-shadow); 46 | --color-fg-font-normal: var(--color-light-fg-font-normal); 47 | --color-fg-font-hover: var(--color-light-fg-font-hover); 48 | --color-fg-font-quote: var(--color-light-fg-font-quote); 49 | --color-fg-tiny-line: var(--color-light-fg-tiny-line); 50 | --color-fg-marker-quote: var(--color-light-fg-marker-quote); 51 | --color-fg-font-hyper: var(--color-light-fg-font-hyper); 52 | --color-fg-font-hyper-hover: var(--color-light-fg-font-hyper-hover); 53 | --color-fg-hyperlink: var(--color-light-fg-hyperlink); 54 | --color-fg-hyperlink-hover: var(--color-light-fg-hyperlink-hover); 55 | --color-bg-pager-normal: var(--color-light-bg-pager-normal); 56 | --color-bg-pager-current: var(--color-light-bg-pager-current); 57 | --color-bg-pager-hover: var(--color-light-bg-pager-hover); 58 | } 59 | 60 | @media (prefers-color-scheme: dark) { 61 | :root { 62 | --color-bg-page: var(--color-dark-bg-page); 63 | --color-bg-content: var(--color-dark-bg-content); 64 | --color-bg-block: var(--color-dark-bg-block); 65 | --color-bg-shadow: var(--color-dark-bg-shadow); 66 | --color-fg-font-normal: var(--color-dark-fg-font-normal); 67 | --color-fg-font-hover: var(--color-dark-fg-font-hover); 68 | --color-fg-font-quote: var(--color-dark-fg-font-quote); 69 | --color-fg-tiny-line: var(--color-dark-fg-tiny-line); 70 | --color-fg-marker-quote: var(--color-dark-fg-marker-quote); 71 | --color-fg-font-hyper: var(--color-dark-fg-font-hyper); 72 | --color-fg-font-hyper-hover: var(--color-dark-fg-font-hyper-hover); 73 | --color-fg-hyperlink: var(--color-dark-fg-hyperlink); 74 | --color-fg-hyperlink-hover: var(--color-dark-fg-hyperlink-hover); 75 | --color-bg-pager-normal: var(--color-dark-bg-pager-normal); 76 | --color-bg-pager-current: var(--color-dark-bg-pager-current); 77 | --color-bg-pager-hover: var(--color-dark-bg-pager-hover); 78 | } 79 | } 80 | 81 | :root { 82 | --fonts-sans-en: "Noto Sans", "Droid Sans", "Calibri", "Arial"; 83 | --fonts-sans-zh: "WenQuanYi Zen Hei", "WenQuanYi Micro Hei", 84 | "Noto Sans CJK", "Microsoft YaHei", "PingFang SC"; 85 | --fonts-sans: var(--fonts-sans-en), var(--fonts-sans-zh), sans-serif; 86 | 87 | --fonts-serif-en: "Noto Serif", "Times New Roman"; 88 | --fonts-serif-zh: "Noto Serif CJK", SimSun, STSong; 89 | --fonts-serif: var(--fonts-serif-en), var(--fonts-serif-zh), serif; 90 | 91 | --fonts-mono-en: "DejaVu Sans Mono", "Noto Sans Mono", "Consolas", "Courier"; 92 | --fonts-mono-zh: "Noto Sans Mono CJK", "WenQuanYi Zen Hei Mono", "WenQuanYi Micro Hei Mono"; 93 | --fonts-mono: var(--fonts-mono-en), var(--fonts-mono-zh), monospace; 94 | 95 | --len-0: 0.00rem; 96 | --len-1: 0.25rem; 97 | --len-2: 0.50rem; 98 | --len-3: 1.00rem; 99 | --len-4: 1.50rem; 100 | --len-5: 3.00rem; 101 | 102 | --font-size-0: 0.8125rem; 103 | --font-size-1: 0.875rem; 104 | --font-size-2: 1.000rem; 105 | --font-size-3: 1.125rem; 106 | --font-size-4: 1.250rem; 107 | --font-size-5: 1.500rem; 108 | --font-size-6: 2.000rem; 109 | } 110 | 111 | 112 | *, ::before, ::after { 113 | font-family: inherit; 114 | box-sizing: border-box; 115 | } 116 | 117 | html { 118 | font-family: var(--fonts-sans); 119 | font-size: 16px; 120 | color: var(--color-fg-font-normal); 121 | } 122 | 123 | /**************************************************************/ 124 | /* approximately set up the layout of header, footer and main */ 125 | /**************************************************************/ 126 | 127 | body { 128 | display: flex; 129 | flex-direction: column; 130 | 131 | min-height: 100vh; 132 | margin: 0; 133 | 134 | align-items: center; 135 | 136 | background-color: var(--color-bg-page); 137 | } 138 | 139 | /* set up padding and margin of some main elements */ 140 | .main-wrapper { 141 | margin-top: var(--len-5); 142 | margin-bottom: var(--len-5); 143 | } 144 | 145 | .main-wrapper { display: flex; flex-wrap: wrap; } 146 | .main-wrapper > * { height: fit-content; } 147 | 148 | .main { padding: var(--len-4); } 149 | .side { padding-left: var(--len-4); } 150 | .main { flex: 0 0 72%; width: 72%; } 151 | .side { flex: 0 0 28%; width: 28%; } 152 | 153 | /* mobile layout: place side to bottom */ 154 | @media (max-width: 991px) { 155 | .main { padding: var(--len-4); } 156 | .side { padding-left: 0; padding-top: var(--len-4); } 157 | .main { flex: 0 0 100%; width: 100%; } 158 | .side { flex: 0 0 100%; width: 100%; } 159 | } 160 | 161 | /* set light background */ 162 | .header-wrapper, 163 | .footer, 164 | .main, 165 | .side-recent, 166 | .side-categories, 167 | .side-tags 168 | { 169 | background-color: var(--color-bg-content); 170 | } 171 | 172 | /* place header in the center of header-wrapper */ 173 | .header-wrapper { 174 | display: flex; 175 | justify-content: center; 176 | } 177 | 178 | /* let footer stay at bottom of screen */ 179 | .footer { 180 | margin-top: auto; 181 | margin-bottom: 0; 182 | } 183 | 184 | 185 | /********** set up break point **********/ 186 | 187 | .main-wrapper, .header { max-width: 1140px; } 188 | @media (max-width: 1199px) { .main-wrapper, .header { max-width: 960px; } } 189 | @media (max-width: 991px) { .main-wrapper, .header { max-width: 720px; } } 190 | @media (max-width: 767px) { .main-wrapper, .header { max-width: 540px; } } 191 | @media (max-width: 575px) { .main-wrapper, .header { max-width: none; } } 192 | 193 | /* size the element who has breakpoint limitation */ 194 | /* .header, .main-wrapper, .main { width: 100vw; } */ 195 | /* .header-wrapper, .footer { width: 100vw; } */ 196 | .header-wrapper, .footer { width: 100vw;} 197 | .main-wrapper { width: calc(100vw - 2 * var(--len-3));} 198 | 199 | /************************/ 200 | /* set up header layout */ 201 | /************************/ 202 | 203 | .header { 204 | padding: var(--len-3); 205 | width: 100%; 206 | } 207 | 208 | /* place title and menus horizonally */ 209 | .header { 210 | display: flex; 211 | flex-wrap: wrap; 212 | align-content: center; 213 | justify-content: space-between; 214 | } 215 | 216 | .header .menu { justify-content: center; align-items: center; } 217 | .header .site-title { text-align: center; } 218 | 219 | @media (max-width: 767px) { 220 | .header .site-title { 221 | padding-top: var(--len-4); 222 | 223 | flex: 0 0 100%; 224 | } 225 | 226 | .header .menu { 227 | flex-wrap: wrap; 228 | flex: 0 0 100%; 229 | 230 | margin-top: var(--len-3); 231 | padding-top: var(--len-3); 232 | border-top: 1px solid var(--color-fg-tiny-line); 233 | } 234 | } 235 | 236 | /* setup hyper link style */ 237 | .header .site-title { 238 | text-decoration: none; 239 | font-family: var(--fonts-serif); 240 | font-size: var(--font-size-6); 241 | font-weight: bold; 242 | } 243 | 244 | /********** set up menus layout **********/ 245 | 246 | /* menus and submenus, hover to display, and setup animation */ 247 | .header .menu-item .sub-menu { visibility: hidden; opacity: 0; transition: opacity 0.25s, visibility 0.25s; } 248 | .header .menu-item:hover .sub-menu { visibility: visible; opacity: 1; } 249 | .header .sub-menu { position: absolute; } 250 | 251 | /* menu direction */ 252 | .header .menu { 253 | display: flex; 254 | align-items: center; 255 | } 256 | .header .sub-menu { 257 | display: flex; 258 | flex-direction: column; 259 | align-items: flex-start; 260 | } 261 | 262 | /* set up spacing of menu items in menu and sub-menu */ 263 | .header .menu > * { margin-right: var(--len-3); } 264 | .header .menu > *:last-child { margin-right: 0; } 265 | .header .sub-menu > * { margin-bottom: var(--len-2); } 266 | .header .sub-menu > *:last-child { margin-bottom: 0; } 267 | 268 | /* beautify sub menu style */ 269 | .header .sub-menu { 270 | background-color: var(--color-bg-content); 271 | padding: var(--len-2) var(--len-4); 272 | box-shadow: var(--color-bg-shadow) 0px 0px 3px 1px; 273 | border-radius: 3px; 274 | } 275 | 276 | /* beautify menu item */ 277 | .header .menu-item { 278 | font-family: var(--fonts-serif); 279 | font-size: var(--font-size-3); 280 | font-weight: bold; 281 | } 282 | 283 | .header a { color: var(--color-fg-font-normal); text-decoration: none; } 284 | .header a:hover { color: var(--color-fg-font-hover); } 285 | 286 | /************************/ 287 | /* set up footer layout */ 288 | /************************/ 289 | 290 | .footer { 291 | padding: var(--len-4) 0; 292 | font-size: var(--font-size-1); 293 | } 294 | 295 | .footer > * { 296 | margin-top: var(--len-2); 297 | margin-bottom: var(--len-2); 298 | } 299 | 300 | /* credit, license and social layout */ 301 | .footer .footer-row { display: flex; justify-content: center; } 302 | 303 | .footer .footer-item { margin-right: var(--len-3); } 304 | .footer .footer-item:last-child { margin-right: 0; } 305 | 306 | /* beautify hyper link style */ 307 | .footer { color: var(--color-fg-font-normal) } 308 | 309 | .footer a { color: var(--color-fg-hyperlink); text-decoration: none; } 310 | .footer a:hover { color: var(--color-fg-hyperlink-hover); } 311 | 312 | /**********************************/ 313 | /* set up home page's list layout */ 314 | /**********************************/ 315 | 316 | .list-item .tips { 317 | display: flex; 318 | flex-wrap: wrap; 319 | justify-content: start; 320 | align-items: flex-start; 321 | 322 | font-size: var(--font-size-1); 323 | color: var(--color-fg-font-quote); 324 | } 325 | 326 | .list-item .tips > * { margin-right: var(--len-3); } 327 | .list-item .tips > *:last-child { margin-right: 0; } 328 | 329 | .list-item .title a { text-decoration: none; color: var(--color-fg-font-normal); } 330 | .list-item .title a:hover { color: var(--color-fg-font-hover); } 331 | .list-item .tips a { text-decoration: none; color: var(--color-fg-hyperlink); } 332 | .list-item .tips a:hover { color: var(--color-fg-hyperlink-hover); } 333 | 334 | .list-item .title { margin: var(--len-2) 0 var(--len-3) 0; } 335 | 336 | .list-item .tags > *, 337 | .list-item .categories > * 338 | { margin: 0 var(--len-1); } 339 | 340 | .list-item .summary > * { margin: 0; } 341 | .list-item .title { margin: 0 0 var(--len-2) 0; } 342 | .list-item .tips { margin: 0 0 var(--len-3) 0; } 343 | 344 | .list-item { border-bottom: 1px solid var(--color-fg-tiny-line); } 345 | .list-item:last-child { border-bottom: 0; } 346 | 347 | .list-item:first-child { padding-top: 0;} 348 | .list-item { padding: var(--len-3) 0; } 349 | .list-item:last-child { padding-bottom: 0;} 350 | 351 | /**********************/ 352 | /* set up side layout */ 353 | /**********************/ 354 | 355 | .side h2 { margin: 0; } 356 | 357 | .side ul { list-style: none; margin: 0; padding: 0; } 358 | 359 | .side li { margin-bottom: var(--len-3); } 360 | .side li:last-child { margin-bottom: 0; } 361 | 362 | .side hr { 363 | border: none; 364 | height: 1px; 365 | background-color: var(--color-bg-content); 366 | 367 | margin: var(--len-2) 0; 368 | } 369 | 370 | .side > * { padding: var(--len-4); } 371 | 372 | .side > * { margin-bottom: var(--len-3); } 373 | .side > *:last-child { margin-bottom: 0; } 374 | 375 | .side a { color: var(--color-fg-font-normal); text-decoration: none; } 376 | .side a:hover { color: var(--color-fg-hyperlink); } 377 | 378 | /* horizontally place tags */ 379 | .side .side-tags li { display: inline-block; margin: var(--len-1) var(--len-1); } 380 | 381 | /*****************************/ 382 | /* set up single post layout */ 383 | /*****************************/ 384 | 385 | .single { 386 | display: flex; 387 | flex-direction: column; 388 | align-items: center; 389 | } 390 | 391 | .single a { text-decoration: none; color: var(--color-fg-hyperlink); } 392 | .single a:hover { color: var(--color-fg-hyperlink-hover); } 393 | 394 | .single .title, 395 | .single .tip, 396 | .single .taxonomies, 397 | .single .content 398 | { width: 100%; } 399 | 400 | .single .taxonomies { margin-top: var(--len-1); } 401 | 402 | .single > hr { 403 | border: none; 404 | background-color: var(--color-fg-tiny-line); 405 | height: 1px; 406 | 407 | width: 90%; 408 | margin: var(--len-3) 0; 409 | } 410 | 411 | .single .title, 412 | .single .tip, 413 | .single .taxonomies 414 | { text-align: center; } 415 | 416 | .single .tip, 417 | .single .taxonomies 418 | { color: var(--color-fg-font-normal)} 419 | 420 | .single .taxonomies > * { display: inline-block; } 421 | 422 | .single .taxonomies > * { margin-right: var(--len-3); } 423 | .single .taxonomies > *:last-child { margin-right: 0; } 424 | 425 | .single .title { 426 | margin: var(--len-2) 0 var(--len-3) 0; 427 | font-size: var(--font-size-6); 428 | } 429 | 430 | 431 | /***** set up content style *****/ 432 | 433 | .content { 434 | line-height: 1.5; 435 | } 436 | 437 | .content code { 438 | font-family: var(--fonts-mono); 439 | 440 | background-color: var(--color-bg-block); 441 | 442 | padding: 0 2px; 443 | border: 1px solid var(--color-fg-tiny-line); 444 | border-radius: 2px; 445 | line-height: inherit; 446 | word-wrap: break-word; 447 | } 448 | 449 | /* keep in style with highlighting */ 450 | .content pre { 451 | background-color: var(--color-bg-block); 452 | border-radius: 3px; 453 | 454 | /* The copy button with absolute position need this. 455 | * https://developer.mozilla.org/en-US/docs/Web/CSS/position 456 | * https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 457 | */ 458 | position: relative; 459 | } 460 | 461 | .content pre code { 462 | display: block; 463 | 464 | padding: var(--len-3); 465 | border: none; 466 | background-color: unset; 467 | overflow: auto; 468 | width: 100%; 469 | } 470 | 471 | .content blockquote { 472 | margin-top: 5px; 473 | margin-bottom: 5px; 474 | padding-left: 1em; 475 | margin-left: 0px; 476 | border-left: 3px solid var(--color-fg-marker-quote); 477 | color: var(--color-fg-font-quote); 478 | } 479 | 480 | .content hr { 481 | border: none; 482 | height: 2px; 483 | background-color: var(--color-fg-tiny-line); 484 | 485 | width: 80%; 486 | margin: var(--len-2) auto; 487 | } 488 | 489 | .content table { 490 | width: 100%; 491 | margin: 40px 0; 492 | border-collapse: collapse; 493 | line-height: 1.5em; 494 | } 495 | 496 | .content th, 497 | .content td { 498 | text-align: left; 499 | padding-right: 20px; 500 | vertical-align: top; 501 | } 502 | 503 | .content table td, 504 | .content table td { 505 | border-spacing: none; 506 | border-style: solid; 507 | padding: 10px 15px; 508 | border-width: 1px 0 0 0; 509 | } 510 | .content thead th, 511 | .content thead th { 512 | text-align: left; 513 | padding: 10px 15px; 514 | height: 20px; 515 | font-weight: bold; 516 | color: #444; 517 | cursor: default; 518 | white-space: nowrap; 519 | border: 1px solid #dadadc; 520 | } 521 | 522 | .content tr>td { 523 | border: 1px solid #dadadc; 524 | } 525 | 526 | .content tr:nth-child(odd)>td { 527 | background: #fcfcfc; 528 | } 529 | 530 | .content h1, 531 | .content h2, 532 | .content h3 { 533 | font-weight: bold; 534 | } 535 | .content p, 536 | .content pre { 537 | word-break: normal; 538 | overflow-wrap: anywhere; 539 | } 540 | .content img { 541 | max-width: 92%; 542 | display: block; 543 | margin-left: auto; 544 | margin-right: auto; 545 | } 546 | .content .anchor { 547 | visibility: hidden; 548 | } 549 | .content h1:hover a, 550 | .content h2:hover a, 551 | .content h3:hover a, 552 | .content h4:hover a 553 | { visibility: visible } 554 | 555 | .highlight pre { 556 | overflow-x: auto; 557 | } 558 | 559 | .highlight { 560 | max-width: 100%; 561 | overflow-x: auto; 562 | } 563 | 564 | /* the copy button added by /js/copy-code-button.js */ 565 | pre .copyCodeButton { 566 | position: absolute; 567 | top: var(--len-1); 568 | right: var(--len-3); 569 | 570 | font-family: var(--fonts-mono); 571 | color: var(--color-fg-hyperlink); 572 | cursor: pointer; 573 | visibility: hidden; 574 | } 575 | pre:hover .copyCodeButton { 576 | visibility: visible; 577 | } 578 | pre .copyCodeButton:hover { 579 | color: var(--color-fg-hyperlink-hover); 580 | } 581 | 582 | /**************************/ 583 | /* setup list page layout */ 584 | /**************************/ 585 | 586 | #archive { 587 | padding-left: var(--len-3); 588 | } 589 | 590 | #archive .group { 591 | margin: var(--len-4) auto; 592 | } 593 | #archive .group .key { 594 | font-size: var(--font-size-4); 595 | margin-bottom: var(--len-2); 596 | } 597 | #archive .group .value { 598 | display: block; 599 | font-size: var(--font-size-2); 600 | margin-bottom: 12px; 601 | } 602 | #archive .group .value { text-indent: -60px; padding-left: 60px; } 603 | #archive .group .value * { text-indent: 0; } 604 | #archive .group .value .date { display: inline-block; width: 60px; } 605 | #archive .group .value .title { display: inline; } 606 | 607 | #archive .group .value .date { color: var(--color-fg-font-normal); } 608 | 609 | #archive .group .value a { text-decoration: none; } 610 | 611 | #archive .group .value a { color: var(--color-fg-font-hyper); } 612 | #archive .group .value a:hover { color: var(--color-fg-font-hyper-hover); } 613 | 614 | #archive .group .value .tags { 615 | display: inline-block; 616 | margin-left: 7px; 617 | } 618 | #archive .group .value .tags { 619 | background: var(--color-bg-block); 620 | border-radius: 2px; 621 | padding: 4px 7px; 622 | font-size: var(--font-size-1); 623 | margin-right: 3px; 624 | } 625 | 626 | /**********************/ 627 | /* setup terms layout */ 628 | /**********************/ 629 | 630 | #tags { 631 | max-width: 700px; 632 | margin: 48px auto 0 auto; 633 | padding: 0 12px; 634 | text-align: center; 635 | } 636 | #tags .tag { 637 | display: inline-block; 638 | margin: 7px 7px; 639 | } 640 | @media (max-width: 700px) { 641 | #tags { 642 | margin: 0 auto 0 auto; 643 | } 644 | #tags .tag { 645 | display: inline-block; 646 | margin: 4px 5px; 647 | } 648 | } 649 | 650 | #tags .tag a { 651 | background: #f2f2f2; 652 | padding: 4px 7px; 653 | color: #757575; 654 | color: #404040; 655 | font-size: 14px; 656 | margin-right: 3px; 657 | } 658 | #tags .tag a:hover { 659 | color: #0366d6; 660 | } 661 | 662 | /***************************/ 663 | /* setup pagination layout */ 664 | /***************************/ 665 | 666 | .pagination { 667 | width: 100%; 668 | text-align: center; 669 | 670 | padding-top: var(--len-5); 671 | } 672 | 673 | .pagination a { 674 | display: inline-block; 675 | 676 | font-size: var(--font-size-2); 677 | 678 | border-radius: var(--len-5); 679 | width: var(--len-5); 680 | height: var(--len-5); 681 | line-height: var(--len-5); 682 | 683 | text-align: center; 684 | vertical-align: middle; 685 | 686 | text-decoration: none; 687 | 688 | color: var(--color-fg-font-normal); 689 | background-color: var(--color-bg-pager-normal); 690 | 691 | transition: background-color 0.25s; 692 | } 693 | 694 | .pagination a:hover { 695 | background-color: var(--color-bg-pager-hover); 696 | } 697 | 698 | .pagination a.current { 699 | background-color: var(--color-bg-pager-current); 700 | pointer-events: none; 701 | color: var(--color-fg-font-normal); 702 | cursor: default; 703 | } 704 | 705 | /***************************/ 706 | /* setup commenting layout */ 707 | /***************************/ 708 | 709 | .commenting { 710 | width: 85%; 711 | } 712 | 713 | /**********/ 714 | /** misc **/ 715 | /**********/ 716 | 717 | .archive-hint { 718 | padding-left: var(--len-4); 719 | color: var(--color-fg-font-quote); 720 | } 721 | 722 | .max-wrapper { 723 | width: 100%; 724 | height: 100%; 725 | padding: 0; 726 | margin: 0; 727 | } 728 | -------------------------------------------------------------------------------- /static/lib/katex/katex.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.2"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} 2 | -------------------------------------------------------------------------------- /static/lib/katex/contrib/render-a11y-string.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | /** 4 | * renderA11yString returns a readable string. 5 | * 6 | * In some cases the string will have the proper semantic math 7 | * meaning,: 8 | * renderA11yString("\\frac{1}{2}"") 9 | * -> "start fraction, 1, divided by, 2, end fraction" 10 | * 11 | * However, other cases do not: 12 | * renderA11yString("f(x) = x^2") 13 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared" 14 | * 15 | * The commas in the string aim to increase ease of understanding 16 | * when read by a screenreader. 17 | */ 18 | var stringMap = { 19 | "(": "left parenthesis", 20 | ")": "right parenthesis", 21 | "[": "open bracket", 22 | "]": "close bracket", 23 | "\\{": "left brace", 24 | "\\}": "right brace", 25 | "\\lvert": "open vertical bar", 26 | "\\rvert": "close vertical bar", 27 | "|": "vertical bar", 28 | "\\uparrow": "up arrow", 29 | "\\Uparrow": "up arrow", 30 | "\\downarrow": "down arrow", 31 | "\\Downarrow": "down arrow", 32 | "\\updownarrow": "up down arrow", 33 | "\\leftarrow": "left arrow", 34 | "\\Leftarrow": "left arrow", 35 | "\\rightarrow": "right arrow", 36 | "\\Rightarrow": "right arrow", 37 | "\\langle": "open angle", 38 | "\\rangle": "close angle", 39 | "\\lfloor": "open floor", 40 | "\\rfloor": "close floor", 41 | "\\int": "integral", 42 | "\\intop": "integral", 43 | "\\lim": "limit", 44 | "\\ln": "natural log", 45 | "\\log": "log", 46 | "\\sin": "sine", 47 | "\\cos": "cosine", 48 | "\\tan": "tangent", 49 | "\\cot": "cotangent", 50 | "\\sum": "sum", 51 | "/": "slash", 52 | ",": "comma", 53 | ".": "point", 54 | "-": "negative", 55 | "+": "plus", 56 | "~": "tilde", 57 | ":": "colon", 58 | "?": "question mark", 59 | "'": "apostrophe", 60 | "\\%": "percent", 61 | " ": "space", 62 | "\\ ": "space", 63 | "\\$": "dollar sign", 64 | "\\angle": "angle", 65 | "\\degree": "degree", 66 | "\\circ": "circle", 67 | "\\vec": "vector", 68 | "\\triangle": "triangle", 69 | "\\pi": "pi", 70 | "\\prime": "prime", 71 | "\\infty": "infinity", 72 | "\\alpha": "alpha", 73 | "\\beta": "beta", 74 | "\\gamma": "gamma", 75 | "\\omega": "omega", 76 | "\\theta": "theta", 77 | "\\sigma": "sigma", 78 | "\\lambda": "lambda", 79 | "\\tau": "tau", 80 | "\\Delta": "delta", 81 | "\\delta": "delta", 82 | "\\mu": "mu", 83 | "\\rho": "rho", 84 | "\\nabla": "del", 85 | "\\ell": "ell", 86 | "\\ldots": "dots", 87 | // TODO: add entries for all accents 88 | "\\hat": "hat", 89 | "\\acute": "acute" 90 | }; 91 | var powerMap = { 92 | "prime": "prime", 93 | "degree": "degrees", 94 | "circle": "degrees", 95 | "2": "squared", 96 | "3": "cubed" 97 | }; 98 | var openMap = { 99 | "|": "open vertical bar", 100 | ".": "" 101 | }; 102 | var closeMap = { 103 | "|": "close vertical bar", 104 | ".": "" 105 | }; 106 | var binMap = { 107 | "+": "plus", 108 | "-": "minus", 109 | "\\pm": "plus minus", 110 | "\\cdot": "dot", 111 | "*": "times", 112 | "/": "divided by", 113 | "\\times": "times", 114 | "\\div": "divided by", 115 | "\\circ": "circle", 116 | "\\bullet": "bullet" 117 | }; 118 | var relMap = { 119 | "=": "equals", 120 | "\\approx": "approximately equals", 121 | "≠": "does not equal", 122 | "\\geq": "is greater than or equal to", 123 | "\\ge": "is greater than or equal to", 124 | "\\leq": "is less than or equal to", 125 | "\\le": "is less than or equal to", 126 | ">": "is greater than", 127 | "<": "is less than", 128 | "\\leftarrow": "left arrow", 129 | "\\Leftarrow": "left arrow", 130 | "\\rightarrow": "right arrow", 131 | "\\Rightarrow": "right arrow", 132 | ":": "colon" 133 | }; 134 | var accentUnderMap = { 135 | "\\underleftarrow": "left arrow", 136 | "\\underrightarrow": "right arrow", 137 | "\\underleftrightarrow": "left-right arrow", 138 | "\\undergroup": "group", 139 | "\\underlinesegment": "line segment", 140 | "\\utilde": "tilde" 141 | }; 142 | 143 | var buildString = (str, type, a11yStrings) => { 144 | if (!str) { 145 | return; 146 | } 147 | 148 | var ret; 149 | 150 | if (type === "open") { 151 | ret = str in openMap ? openMap[str] : stringMap[str] || str; 152 | } else if (type === "close") { 153 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str; 154 | } else if (type === "bin") { 155 | ret = binMap[str] || str; 156 | } else if (type === "rel") { 157 | ret = relMap[str] || str; 158 | } else { 159 | ret = stringMap[str] || str; 160 | } // If the text to add is a number and there is already a string 161 | // in the list and the last string is a number then we should 162 | // combine them into a single number 163 | 164 | 165 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string 166 | // I think we might be able to drop the nested arrays, which would make 167 | // this easier to type 168 | // $FlowFixMe 169 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) { 170 | a11yStrings[a11yStrings.length - 1] += ret; 171 | } else if (ret) { 172 | a11yStrings.push(ret); 173 | } 174 | }; 175 | 176 | var buildRegion = (a11yStrings, callback) => { 177 | var regionStrings = []; 178 | a11yStrings.push(regionStrings); 179 | callback(regionStrings); 180 | }; 181 | 182 | var handleObject = (tree, a11yStrings, atomType) => { 183 | // Everything else is assumed to be an object... 184 | switch (tree.type) { 185 | case "accent": 186 | { 187 | buildRegion(a11yStrings, a11yStrings => { 188 | buildA11yStrings(tree.base, a11yStrings, atomType); 189 | a11yStrings.push("with"); 190 | buildString(tree.label, "normal", a11yStrings); 191 | a11yStrings.push("on top"); 192 | }); 193 | break; 194 | } 195 | 196 | case "accentUnder": 197 | { 198 | buildRegion(a11yStrings, a11yStrings => { 199 | buildA11yStrings(tree.base, a11yStrings, atomType); 200 | a11yStrings.push("with"); 201 | buildString(accentUnderMap[tree.label], "normal", a11yStrings); 202 | a11yStrings.push("underneath"); 203 | }); 204 | break; 205 | } 206 | 207 | case "accent-token": 208 | { 209 | // Used internally by accent symbols. 210 | break; 211 | } 212 | 213 | case "atom": 214 | { 215 | var { 216 | text 217 | } = tree; 218 | 219 | switch (tree.family) { 220 | case "bin": 221 | { 222 | buildString(text, "bin", a11yStrings); 223 | break; 224 | } 225 | 226 | case "close": 227 | { 228 | buildString(text, "close", a11yStrings); 229 | break; 230 | } 231 | // TODO(kevinb): figure out what should be done for inner 232 | 233 | case "inner": 234 | { 235 | buildString(tree.text, "inner", a11yStrings); 236 | break; 237 | } 238 | 239 | case "open": 240 | { 241 | buildString(text, "open", a11yStrings); 242 | break; 243 | } 244 | 245 | case "punct": 246 | { 247 | buildString(text, "punct", a11yStrings); 248 | break; 249 | } 250 | 251 | case "rel": 252 | { 253 | buildString(text, "rel", a11yStrings); 254 | break; 255 | } 256 | 257 | default: 258 | { 259 | tree.family; 260 | throw new Error("\"" + tree.family + "\" is not a valid atom type"); 261 | } 262 | } 263 | 264 | break; 265 | } 266 | 267 | case "color": 268 | { 269 | var color = tree.color.replace(/katex-/, ""); 270 | buildRegion(a11yStrings, regionStrings => { 271 | regionStrings.push("start color " + color); 272 | buildA11yStrings(tree.body, regionStrings, atomType); 273 | regionStrings.push("end color " + color); 274 | }); 275 | break; 276 | } 277 | 278 | case "color-token": 279 | { 280 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered. 281 | // It's a leaf node and has no children so just break. 282 | break; 283 | } 284 | 285 | case "delimsizing": 286 | { 287 | if (tree.delim && tree.delim !== ".") { 288 | buildString(tree.delim, "normal", a11yStrings); 289 | } 290 | 291 | break; 292 | } 293 | 294 | case "genfrac": 295 | { 296 | buildRegion(a11yStrings, regionStrings => { 297 | // genfrac can have unbalanced delimiters 298 | var { 299 | leftDelim, 300 | rightDelim 301 | } = tree; // NOTE: Not sure if this is a safe assumption 302 | // hasBarLine true -> fraction, false -> binomial 303 | 304 | if (tree.hasBarLine) { 305 | regionStrings.push("start fraction"); 306 | leftDelim && buildString(leftDelim, "open", regionStrings); 307 | buildA11yStrings(tree.numer, regionStrings, atomType); 308 | regionStrings.push("divided by"); 309 | buildA11yStrings(tree.denom, regionStrings, atomType); 310 | rightDelim && buildString(rightDelim, "close", regionStrings); 311 | regionStrings.push("end fraction"); 312 | } else { 313 | regionStrings.push("start binomial"); 314 | leftDelim && buildString(leftDelim, "open", regionStrings); 315 | buildA11yStrings(tree.numer, regionStrings, atomType); 316 | regionStrings.push("over"); 317 | buildA11yStrings(tree.denom, regionStrings, atomType); 318 | rightDelim && buildString(rightDelim, "close", regionStrings); 319 | regionStrings.push("end binomial"); 320 | } 321 | }); 322 | break; 323 | } 324 | 325 | case "hbox": 326 | { 327 | buildA11yStrings(tree.body, a11yStrings, atomType); 328 | break; 329 | } 330 | 331 | case "kern": 332 | { 333 | // No op: we don't attempt to present kerning information 334 | // to the screen reader. 335 | break; 336 | } 337 | 338 | case "leftright": 339 | { 340 | buildRegion(a11yStrings, regionStrings => { 341 | buildString(tree.left, "open", regionStrings); 342 | buildA11yStrings(tree.body, regionStrings, atomType); 343 | buildString(tree.right, "close", regionStrings); 344 | }); 345 | break; 346 | } 347 | 348 | case "leftright-right": 349 | { 350 | // TODO: double check that this is a no-op 351 | break; 352 | } 353 | 354 | case "lap": 355 | { 356 | buildA11yStrings(tree.body, a11yStrings, atomType); 357 | break; 358 | } 359 | 360 | case "mathord": 361 | { 362 | buildString(tree.text, "normal", a11yStrings); 363 | break; 364 | } 365 | 366 | case "op": 367 | { 368 | var { 369 | body, 370 | name 371 | } = tree; 372 | 373 | if (body) { 374 | buildA11yStrings(body, a11yStrings, atomType); 375 | } else if (name) { 376 | buildString(name, "normal", a11yStrings); 377 | } 378 | 379 | break; 380 | } 381 | 382 | case "op-token": 383 | { 384 | // Used internally by operator symbols. 385 | buildString(tree.text, atomType, a11yStrings); 386 | break; 387 | } 388 | 389 | case "ordgroup": 390 | { 391 | buildA11yStrings(tree.body, a11yStrings, atomType); 392 | break; 393 | } 394 | 395 | case "overline": 396 | { 397 | buildRegion(a11yStrings, function (a11yStrings) { 398 | a11yStrings.push("start overline"); 399 | buildA11yStrings(tree.body, a11yStrings, atomType); 400 | a11yStrings.push("end overline"); 401 | }); 402 | break; 403 | } 404 | 405 | case "pmb": 406 | { 407 | a11yStrings.push("bold"); 408 | break; 409 | } 410 | 411 | case "phantom": 412 | { 413 | a11yStrings.push("empty space"); 414 | break; 415 | } 416 | 417 | case "raisebox": 418 | { 419 | buildA11yStrings(tree.body, a11yStrings, atomType); 420 | break; 421 | } 422 | 423 | case "rule": 424 | { 425 | a11yStrings.push("rectangle"); 426 | break; 427 | } 428 | 429 | case "sizing": 430 | { 431 | buildA11yStrings(tree.body, a11yStrings, atomType); 432 | break; 433 | } 434 | 435 | case "spacing": 436 | { 437 | a11yStrings.push("space"); 438 | break; 439 | } 440 | 441 | case "styling": 442 | { 443 | // We ignore the styling and just pass through the contents 444 | buildA11yStrings(tree.body, a11yStrings, atomType); 445 | break; 446 | } 447 | 448 | case "sqrt": 449 | { 450 | buildRegion(a11yStrings, regionStrings => { 451 | var { 452 | body, 453 | index 454 | } = tree; 455 | 456 | if (index) { 457 | var indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); 458 | 459 | if (indexString === "3") { 460 | regionStrings.push("cube root of"); 461 | buildA11yStrings(body, regionStrings, atomType); 462 | regionStrings.push("end cube root"); 463 | return; 464 | } 465 | 466 | regionStrings.push("root"); 467 | regionStrings.push("start index"); 468 | buildA11yStrings(index, regionStrings, atomType); 469 | regionStrings.push("end index"); 470 | return; 471 | } 472 | 473 | regionStrings.push("square root of"); 474 | buildA11yStrings(body, regionStrings, atomType); 475 | regionStrings.push("end square root"); 476 | }); 477 | break; 478 | } 479 | 480 | case "supsub": 481 | { 482 | var { 483 | base, 484 | sub, 485 | sup 486 | } = tree; 487 | var isLog = false; 488 | 489 | if (base) { 490 | buildA11yStrings(base, a11yStrings, atomType); 491 | isLog = base.type === "op" && base.name === "\\log"; 492 | } 493 | 494 | if (sub) { 495 | var regionName = isLog ? "base" : "subscript"; 496 | buildRegion(a11yStrings, function (regionStrings) { 497 | regionStrings.push("start " + regionName); 498 | buildA11yStrings(sub, regionStrings, atomType); 499 | regionStrings.push("end " + regionName); 500 | }); 501 | } 502 | 503 | if (sup) { 504 | buildRegion(a11yStrings, function (regionStrings) { 505 | var supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); 506 | 507 | if (supString in powerMap) { 508 | regionStrings.push(powerMap[supString]); 509 | return; 510 | } 511 | 512 | regionStrings.push("start superscript"); 513 | buildA11yStrings(sup, regionStrings, atomType); 514 | regionStrings.push("end superscript"); 515 | }); 516 | } 517 | 518 | break; 519 | } 520 | 521 | case "text": 522 | { 523 | // TODO: handle other fonts 524 | if (tree.font === "\\textbf") { 525 | buildRegion(a11yStrings, function (regionStrings) { 526 | regionStrings.push("start bold text"); 527 | buildA11yStrings(tree.body, regionStrings, atomType); 528 | regionStrings.push("end bold text"); 529 | }); 530 | break; 531 | } 532 | 533 | buildRegion(a11yStrings, function (regionStrings) { 534 | regionStrings.push("start text"); 535 | buildA11yStrings(tree.body, regionStrings, atomType); 536 | regionStrings.push("end text"); 537 | }); 538 | break; 539 | } 540 | 541 | case "textord": 542 | { 543 | buildString(tree.text, atomType, a11yStrings); 544 | break; 545 | } 546 | 547 | case "smash": 548 | { 549 | buildA11yStrings(tree.body, a11yStrings, atomType); 550 | break; 551 | } 552 | 553 | case "enclose": 554 | { 555 | // TODO: create a map for these. 556 | // TODO: differentiate between a body with a single atom, e.g. 557 | // "cancel a" instead of "start cancel, a, end cancel" 558 | if (/cancel/.test(tree.label)) { 559 | buildRegion(a11yStrings, function (regionStrings) { 560 | regionStrings.push("start cancel"); 561 | buildA11yStrings(tree.body, regionStrings, atomType); 562 | regionStrings.push("end cancel"); 563 | }); 564 | break; 565 | } else if (/box/.test(tree.label)) { 566 | buildRegion(a11yStrings, function (regionStrings) { 567 | regionStrings.push("start box"); 568 | buildA11yStrings(tree.body, regionStrings, atomType); 569 | regionStrings.push("end box"); 570 | }); 571 | break; 572 | } else if (/sout/.test(tree.label)) { 573 | buildRegion(a11yStrings, function (regionStrings) { 574 | regionStrings.push("start strikeout"); 575 | buildA11yStrings(tree.body, regionStrings, atomType); 576 | regionStrings.push("end strikeout"); 577 | }); 578 | break; 579 | } else if (/phase/.test(tree.label)) { 580 | buildRegion(a11yStrings, function (regionStrings) { 581 | regionStrings.push("start phase angle"); 582 | buildA11yStrings(tree.body, regionStrings, atomType); 583 | regionStrings.push("end phase angle"); 584 | }); 585 | break; 586 | } 587 | 588 | throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet"); 589 | } 590 | 591 | case "vcenter": 592 | { 593 | buildA11yStrings(tree.body, a11yStrings, atomType); 594 | break; 595 | } 596 | 597 | case "vphantom": 598 | { 599 | throw new Error("KaTeX-a11y: vphantom not implemented yet"); 600 | } 601 | 602 | case "hphantom": 603 | { 604 | throw new Error("KaTeX-a11y: hphantom not implemented yet"); 605 | } 606 | 607 | case "operatorname": 608 | { 609 | buildA11yStrings(tree.body, a11yStrings, atomType); 610 | break; 611 | } 612 | 613 | case "array": 614 | { 615 | throw new Error("KaTeX-a11y: array not implemented yet"); 616 | } 617 | 618 | case "raw": 619 | { 620 | throw new Error("KaTeX-a11y: raw not implemented yet"); 621 | } 622 | 623 | case "size": 624 | { 625 | // Although there are nodes of type "size" in the parse tree, they have 626 | // no semantic meaning and should be ignored. 627 | break; 628 | } 629 | 630 | case "url": 631 | { 632 | throw new Error("KaTeX-a11y: url not implemented yet"); 633 | } 634 | 635 | case "tag": 636 | { 637 | throw new Error("KaTeX-a11y: tag not implemented yet"); 638 | } 639 | 640 | case "verb": 641 | { 642 | buildString("start verbatim", "normal", a11yStrings); 643 | buildString(tree.body, "normal", a11yStrings); 644 | buildString("end verbatim", "normal", a11yStrings); 645 | break; 646 | } 647 | 648 | case "environment": 649 | { 650 | throw new Error("KaTeX-a11y: environment not implemented yet"); 651 | } 652 | 653 | case "horizBrace": 654 | { 655 | buildString("start " + tree.label.slice(1), "normal", a11yStrings); 656 | buildA11yStrings(tree.base, a11yStrings, atomType); 657 | buildString("end " + tree.label.slice(1), "normal", a11yStrings); 658 | break; 659 | } 660 | 661 | case "infix": 662 | { 663 | // All infix nodes are replace with other nodes. 664 | break; 665 | } 666 | 667 | case "includegraphics": 668 | { 669 | throw new Error("KaTeX-a11y: includegraphics not implemented yet"); 670 | } 671 | 672 | case "font": 673 | { 674 | // TODO: callout the start/end of specific fonts 675 | // TODO: map \BBb{N} to "the naturals" or something like that 676 | buildA11yStrings(tree.body, a11yStrings, atomType); 677 | break; 678 | } 679 | 680 | case "href": 681 | { 682 | throw new Error("KaTeX-a11y: href not implemented yet"); 683 | } 684 | 685 | case "cr": 686 | { 687 | // This is used by environments. 688 | throw new Error("KaTeX-a11y: cr not implemented yet"); 689 | } 690 | 691 | case "underline": 692 | { 693 | buildRegion(a11yStrings, function (a11yStrings) { 694 | a11yStrings.push("start underline"); 695 | buildA11yStrings(tree.body, a11yStrings, atomType); 696 | a11yStrings.push("end underline"); 697 | }); 698 | break; 699 | } 700 | 701 | case "xArrow": 702 | { 703 | throw new Error("KaTeX-a11y: xArrow not implemented yet"); 704 | } 705 | 706 | case "cdlabel": 707 | { 708 | throw new Error("KaTeX-a11y: cdlabel not implemented yet"); 709 | } 710 | 711 | case "cdlabelparent": 712 | { 713 | throw new Error("KaTeX-a11y: cdlabelparent not implemented yet"); 714 | } 715 | 716 | case "mclass": 717 | { 718 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal 719 | // side of things and extract the text from that. 720 | var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass 721 | 722 | 723 | buildA11yStrings(tree.body, a11yStrings, _atomType); 724 | break; 725 | } 726 | 727 | case "mathchoice": 728 | { 729 | // TODO: track which which style we're using, e.g. dispaly, text, etc. 730 | // default to text style if even that may not be the correct style 731 | buildA11yStrings(tree.text, a11yStrings, atomType); 732 | break; 733 | } 734 | 735 | case "htmlmathml": 736 | { 737 | buildA11yStrings(tree.mathml, a11yStrings, atomType); 738 | break; 739 | } 740 | 741 | case "middle": 742 | { 743 | buildString(tree.delim, atomType, a11yStrings); 744 | break; 745 | } 746 | 747 | case "internal": 748 | { 749 | // internal nodes are never included in the parse tree 750 | break; 751 | } 752 | 753 | case "html": 754 | { 755 | buildA11yStrings(tree.body, a11yStrings, atomType); 756 | break; 757 | } 758 | 759 | default: 760 | tree.type; 761 | throw new Error("KaTeX a11y un-recognized type: " + tree.type); 762 | } 763 | }; 764 | 765 | var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) { 766 | if (a11yStrings === void 0) { 767 | a11yStrings = []; 768 | } 769 | 770 | if (tree instanceof Array) { 771 | for (var i = 0; i < tree.length; i++) { 772 | buildA11yStrings(tree[i], a11yStrings, atomType); 773 | } 774 | } else { 775 | handleObject(tree, a11yStrings, atomType); 776 | } 777 | 778 | return a11yStrings; 779 | }; 780 | 781 | var flatten = function flatten(array) { 782 | var result = []; 783 | array.forEach(function (item) { 784 | if (item instanceof Array) { 785 | result = result.concat(flatten(item)); 786 | } else { 787 | result.push(item); 788 | } 789 | }); 790 | return result; 791 | }; 792 | 793 | var renderA11yString = function renderA11yString(text, settings) { 794 | var tree = katex.__parse(text, settings); 795 | 796 | var a11yStrings = buildA11yStrings(tree, [], "normal"); 797 | return flatten(a11yStrings).join(", "); 798 | }; 799 | 800 | export { renderA11yString as default }; 801 | --------------------------------------------------------------------------------