Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
6d1af74593 | |||
cf454bd96d | |||
cd622975d5 | |||
af446242d9 | |||
f73dde6f1a |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
exampleSite/public/
|
||||||
|
exampleSite/resources/
|
||||||
|
exampleSite/.hugo_build.lock
|
|
@ -1,9 +0,0 @@
|
||||||
# hugo-theme-blank
|
|
||||||
|
|
||||||
This is a theme I personally use.
|
|
||||||
|
|
||||||
## Special Thanks
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
261
about/index.html
Normal file
261
about/index.html
Normal file
|
@ -0,0 +1,261 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>About | Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<section class="single">
|
||||||
|
<h1 class="title">About</h1>
|
||||||
|
|
||||||
|
<div class="tip">
|
||||||
|
<time datetime="2022-04-27 21:01:43 +0800 CST">2022/04/27</time>
|
||||||
|
<span class="split">·</span>
|
||||||
|
<span> 396 words </span>
|
||||||
|
<span class="split">·</span>
|
||||||
|
<span>
|
||||||
|
1 minutes to read
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="taxonomies">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<h2 id="about-this-demo-site">About this demo site <a href="#about-this-demo-site" class="anchor">🔗</a></h2><p>This is the <em>about page</em> of this theme. The content of this demo site is come from <a href="https://github.com/nodejh/hugo-theme-mini/">hugo-theme-mini</a>, whose license is <a href="https://github.com/nodejh/hugo-theme-mini/blob/39be4727b355bc8cabd919c6684d79064690a5c6/LICENSE.md">MIT</a></p>
|
||||||
|
<p>This site is built by hugo, which is a fast static site generator writen in go. You can go to its <a href="https://gohugo.io">offical site</a> to get more information.</p>
|
||||||
|
<h2 id="cjk-supported">CJK supported <a href="#cjk-supported" class="anchor">🔗</a></h2><p>This hugo theme support CJK language, but some right to left language may not act as expected. Let’s just test CJK layout!</p>
|
||||||
|
<p>这一句话是用中文写的,一般情况下,中英文排版如果字体设置不当,显示出来的字号会有相当的差距,即便实际上的字号是相同的。这个问题暂时看来无法彻底解决,唯一能做的就是挑选合适的字体,使相同字号下,中英文在展示出来后肉眼感官大小差别不大。</p>
|
||||||
|
<p>Try another typography, which make English and Chinese lay down in a single line. The word <em>Chinese</em> in Chinese is “中文”.</p>
|
||||||
|
<h2 id="what-is-hugo">What is hugo <a href="#what-is-hugo" class="anchor">🔗</a></h2><p>Written in Go, Hugo is an open source static site generator available under the <a href="https://github.com/gohugoio/hugo/blob/master/LICENSE">Apache Licence 2.0.</a> 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.</p>
|
||||||
|
<p>Hugo makes use of a variety of open source projects including:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/yuin/goldmark">https://github.com/yuin/goldmark</a></li>
|
||||||
|
<li><a href="https://github.com/alecthomas/chroma">https://github.com/alecthomas/chroma</a></li>
|
||||||
|
<li><a href="https://github.com/muesli/smartcrop">https://github.com/muesli/smartcrop</a></li>
|
||||||
|
<li><a href="https://github.com/spf13/cobra">https://github.com/spf13/cobra</a></li>
|
||||||
|
<li><a href="https://github.com/spf13/viper">https://github.com/spf13/viper</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages.</p>
|
||||||
|
<p>Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.</p>
|
||||||
|
<p>Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.</p>
|
||||||
|
<p>Learn more and contribute on <a href="https://github.com/gohugoio">GitHub</a>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
240
categories/index.html
Normal file
240
categories/index.html
Normal file
|
@ -0,0 +1,240 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="https://leafee98.github.io/hugo-theme-flat/categories/index.xml" title="Flat theme" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
<section id="tags">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="tag">
|
||||||
|
<a href="syntax">
|
||||||
|
syntax <span>(1)</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="tag">
|
||||||
|
<a href="themes">
|
||||||
|
themes <span>(1)</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/categories/index.xml">
|
||||||
|
Feed of "Categories"
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
28
categories/index.xml
Normal file
28
categories/index.xml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>Categories on Flat theme</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/categories/</link>
|
||||||
|
<description>Recent content in Categories on Flat theme</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<lastBuildDate>Mon, 11 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://leafee98.github.io/hugo-theme-flat/categories/index.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<item>
|
||||||
|
<title>syntax</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/categories/syntax/</link>
|
||||||
|
<pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/categories/syntax/</guid>
|
||||||
|
<description></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>themes</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/categories/themes/</link>
|
||||||
|
<pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/categories/themes/</guid>
|
||||||
|
<description></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
</rss>
|
259
categories/syntax/index.html
Normal file
259
categories/syntax/index.html
Normal file
|
@ -0,0 +1,259 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>syntax | Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="https://leafee98.github.io/hugo-theme-flat/categories/syntax/index.xml" title="Flat theme" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
<section id="archive">
|
||||||
|
|
||||||
|
<div class="group">
|
||||||
|
<h3 class="key">
|
||||||
|
2019
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="value">
|
||||||
|
<time class="date" datetime="2019-03-11 00:00:00 +0000 UTC">03/11</time>
|
||||||
|
|
||||||
|
<div class="title">
|
||||||
|
|
||||||
|
<a href="https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/markdown">markdown</a>
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/css">css</a>
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/html">html</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/categories/syntax/index.xml">
|
||||||
|
Feed of "syntax"
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
135
categories/syntax/index.xml
Normal file
135
categories/syntax/index.xml
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>syntax on Flat theme</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/categories/syntax/</link>
|
||||||
|
<description>Recent content in syntax on Flat theme</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<lastBuildDate>Mon, 11 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://leafee98.github.io/hugo-theme-flat/categories/syntax/index.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<item>
|
||||||
|
<title>Markdown Syntax Guide</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</link>
|
||||||
|
<pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</guid>
|
||||||
|
<description><p>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.</p>
|
||||||
|
<h2 id="headings">Headings <a href="#headings" class="anchor">🔗</a></h2><p>The following HTML <code>&lt;h1&gt;</code>—<code>&lt;h6&gt;</code> elements represent six levels of section headings. <code>&lt;h1&gt;</code> is the highest section level while <code>&lt;h6&gt;</code> is the lowest.</p>
|
||||||
|
<h1 id="h1">H1 <a href="#h1" class="anchor">🔗</a></h1><h2 id="h2">H2 <a href="#h2" class="anchor">🔗</a></h2><h3 id="h3">H3 <a href="#h3" class="anchor">🔗</a></h3><h4 id="h4">H4 <a href="#h4" class="anchor">🔗</a></h4><h5 id="h5">H5 <a href="#h5" class="anchor">🔗</a></h5><h6 id="h6">H6 <a href="#h6" class="anchor">🔗</a></h6><h2 id="paragraph">Paragraph <a href="#paragraph" class="anchor">🔗</a></h2><p>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.</p>
|
||||||
|
<p>Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.</p>
|
||||||
|
<h2 id="blockquotes">Blockquotes <a href="#blockquotes" class="anchor">🔗</a></h2><p>The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a <code>footer</code> or <code>cite</code> element, and optionally with in-line changes such as annotations and abbreviations.</p>
|
||||||
|
<h4 id="blockquote-without-attribution">Blockquote without attribution <a href="#blockquote-without-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||||
|
<strong>Note</strong> that you can use <em>Markdown syntax</em> within a blockquote.</p>
|
||||||
|
</blockquote>
|
||||||
|
<h4 id="blockquote-with-attribution">Blockquote with attribution <a href="#blockquote-with-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Don&rsquo;t communicate by sharing memory, share memory by communicating.<!-- raw HTML omitted -->
|
||||||
|
— <!-- raw HTML omitted -->Rob Pike<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup><!-- raw HTML omitted --></p>
|
||||||
|
</blockquote>
|
||||||
|
<h2 id="tables">Tables <a href="#tables" class="anchor">🔗</a></h2><p>Tables aren&rsquo;t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.</p>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Age</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Bob</td>
|
||||||
|
<td>27</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Alice</td>
|
||||||
|
<td>23</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h4 id="inline-markdown-within-tables">Inline Markdown within tables <a href="#inline-markdown-within-tables" class="anchor">🔗</a></h4><table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Italics</th>
|
||||||
|
<th>Bold</th>
|
||||||
|
<th>Code</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><em>italics</em></td>
|
||||||
|
<td><strong>bold</strong></td>
|
||||||
|
<td><code>code</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h2 id="code-blocks">Code Blocks <a href="#code-blocks" class="anchor">🔗</a></h2><h4 id="code-block-with-backticks">Code block with backticks <a href="#code-block-with-backticks" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span>
|
||||||
|
</span></span></code></pre></div><h4 id="code-block-indented-with-four-spaces">Code block indented with four spaces <a href="#code-block-indented-with-four-spaces" class="anchor">🔗</a></h4><pre><code>&lt;!doctype html&gt;
|
||||||
|
&lt;html lang=&quot;en&quot;&gt;
|
||||||
|
&lt;head&gt;
|
||||||
|
&lt;meta charset=&quot;utf-8&quot;&gt;
|
||||||
|
&lt;title&gt;Example HTML5 Document&lt;/title&gt;
|
||||||
|
&lt;/head&gt;
|
||||||
|
&lt;body&gt;
|
||||||
|
&lt;p&gt;Test&lt;/p&gt;
|
||||||
|
&lt;/body&gt;
|
||||||
|
&lt;/html&gt;
|
||||||
|
</code></pre>
|
||||||
|
<h4 id="code-block-with-hugos-internal-highlight-shortcode">Code block with Hugo&rsquo;s internal highlight shortcode <a href="#code-block-with-hugos-internal-highlight-shortcode" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span></span></span></code></pre></div>
|
||||||
|
<h2 id="list-types">List Types <a href="#list-types" class="anchor">🔗</a></h2><h4 id="ordered-list">Ordered List <a href="#ordered-list" class="anchor">🔗</a></h4><ol>
|
||||||
|
<li>First item</li>
|
||||||
|
<li>Second item</li>
|
||||||
|
<li>Third item</li>
|
||||||
|
</ol>
|
||||||
|
<h4 id="unordered-list">Unordered List <a href="#unordered-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>List item</li>
|
||||||
|
<li>Another item</li>
|
||||||
|
<li>And another item</li>
|
||||||
|
</ul>
|
||||||
|
<h4 id="nested-list">Nested list <a href="#nested-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>Fruit
|
||||||
|
<ul>
|
||||||
|
<li>Apple</li>
|
||||||
|
<li>Orange</li>
|
||||||
|
<li>Banana</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Dairy
|
||||||
|
<ul>
|
||||||
|
<li>Milk</li>
|
||||||
|
<li>Cheese</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="other-elements--abbr-sub-sup-kbd-mark">Other Elements — abbr, sub, sup, kbd, mark <a href="#other-elements--abbr-sub-sup-kbd-mark" class="anchor">🔗</a></h2><p><!-- raw HTML omitted -->GIF<!-- raw HTML omitted --> is a bitmap image format.</p>
|
||||||
|
<p>H<!-- raw HTML omitted -->2<!-- raw HTML omitted -->O</p>
|
||||||
|
<p>X<!-- raw HTML omitted -->n<!-- raw HTML omitted --> + Y<!-- raw HTML omitted -->n<!-- raw HTML omitted --> = Z<!-- raw HTML omitted -->n<!-- raw HTML omitted --></p>
|
||||||
|
<p>Press <!-- raw HTML omitted --><!-- raw HTML omitted -->CTRL<!-- raw HTML omitted -->+<!-- raw HTML omitted -->ALT<!-- raw HTML omitted -->+<!-- raw HTML omitted -->Delete<!-- raw HTML omitted --><!-- raw HTML omitted --> to end the session.</p>
|
||||||
|
<p>Most <!-- raw HTML omitted -->salamanders<!-- raw HTML omitted --> are nocturnal, and hunt for insects, worms, and other small creatures.</p>
|
||||||
|
<div class="footnotes" role="doc-endnotes">
|
||||||
|
<hr>
|
||||||
|
<ol>
|
||||||
|
<li id="fn:1">
|
||||||
|
<p>The above quote is excerpted from Rob Pike&rsquo;s <a href="https://www.youtube.com/watch?v=PAAkCSZUG1c">talk</a> during Gopherfest, November 18, 2015.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
</rss>
|
259
categories/themes/index.html
Normal file
259
categories/themes/index.html
Normal file
|
@ -0,0 +1,259 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>themes | Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="https://leafee98.github.io/hugo-theme-flat/categories/themes/index.xml" title="Flat theme" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
<section id="archive">
|
||||||
|
|
||||||
|
<div class="group">
|
||||||
|
<h3 class="key">
|
||||||
|
2019
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="value">
|
||||||
|
<time class="date" datetime="2019-03-11 00:00:00 +0000 UTC">03/11</time>
|
||||||
|
|
||||||
|
<div class="title">
|
||||||
|
|
||||||
|
<a href="https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/markdown">markdown</a>
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/css">css</a>
|
||||||
|
|
||||||
|
<a class="tags" href="/hugo-theme-flat/tags/html">html</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/categories/themes/index.xml">
|
||||||
|
Feed of "themes"
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
135
categories/themes/index.xml
Normal file
135
categories/themes/index.xml
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>themes on Flat theme</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/categories/themes/</link>
|
||||||
|
<description>Recent content in themes on Flat theme</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<lastBuildDate>Mon, 11 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://leafee98.github.io/hugo-theme-flat/categories/themes/index.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<item>
|
||||||
|
<title>Markdown Syntax Guide</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</link>
|
||||||
|
<pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</guid>
|
||||||
|
<description><p>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.</p>
|
||||||
|
<h2 id="headings">Headings <a href="#headings" class="anchor">🔗</a></h2><p>The following HTML <code>&lt;h1&gt;</code>—<code>&lt;h6&gt;</code> elements represent six levels of section headings. <code>&lt;h1&gt;</code> is the highest section level while <code>&lt;h6&gt;</code> is the lowest.</p>
|
||||||
|
<h1 id="h1">H1 <a href="#h1" class="anchor">🔗</a></h1><h2 id="h2">H2 <a href="#h2" class="anchor">🔗</a></h2><h3 id="h3">H3 <a href="#h3" class="anchor">🔗</a></h3><h4 id="h4">H4 <a href="#h4" class="anchor">🔗</a></h4><h5 id="h5">H5 <a href="#h5" class="anchor">🔗</a></h5><h6 id="h6">H6 <a href="#h6" class="anchor">🔗</a></h6><h2 id="paragraph">Paragraph <a href="#paragraph" class="anchor">🔗</a></h2><p>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.</p>
|
||||||
|
<p>Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.</p>
|
||||||
|
<h2 id="blockquotes">Blockquotes <a href="#blockquotes" class="anchor">🔗</a></h2><p>The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a <code>footer</code> or <code>cite</code> element, and optionally with in-line changes such as annotations and abbreviations.</p>
|
||||||
|
<h4 id="blockquote-without-attribution">Blockquote without attribution <a href="#blockquote-without-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||||
|
<strong>Note</strong> that you can use <em>Markdown syntax</em> within a blockquote.</p>
|
||||||
|
</blockquote>
|
||||||
|
<h4 id="blockquote-with-attribution">Blockquote with attribution <a href="#blockquote-with-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Don&rsquo;t communicate by sharing memory, share memory by communicating.<!-- raw HTML omitted -->
|
||||||
|
— <!-- raw HTML omitted -->Rob Pike<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup><!-- raw HTML omitted --></p>
|
||||||
|
</blockquote>
|
||||||
|
<h2 id="tables">Tables <a href="#tables" class="anchor">🔗</a></h2><p>Tables aren&rsquo;t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.</p>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Age</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Bob</td>
|
||||||
|
<td>27</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Alice</td>
|
||||||
|
<td>23</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h4 id="inline-markdown-within-tables">Inline Markdown within tables <a href="#inline-markdown-within-tables" class="anchor">🔗</a></h4><table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Italics</th>
|
||||||
|
<th>Bold</th>
|
||||||
|
<th>Code</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><em>italics</em></td>
|
||||||
|
<td><strong>bold</strong></td>
|
||||||
|
<td><code>code</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h2 id="code-blocks">Code Blocks <a href="#code-blocks" class="anchor">🔗</a></h2><h4 id="code-block-with-backticks">Code block with backticks <a href="#code-block-with-backticks" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span>
|
||||||
|
</span></span></code></pre></div><h4 id="code-block-indented-with-four-spaces">Code block indented with four spaces <a href="#code-block-indented-with-four-spaces" class="anchor">🔗</a></h4><pre><code>&lt;!doctype html&gt;
|
||||||
|
&lt;html lang=&quot;en&quot;&gt;
|
||||||
|
&lt;head&gt;
|
||||||
|
&lt;meta charset=&quot;utf-8&quot;&gt;
|
||||||
|
&lt;title&gt;Example HTML5 Document&lt;/title&gt;
|
||||||
|
&lt;/head&gt;
|
||||||
|
&lt;body&gt;
|
||||||
|
&lt;p&gt;Test&lt;/p&gt;
|
||||||
|
&lt;/body&gt;
|
||||||
|
&lt;/html&gt;
|
||||||
|
</code></pre>
|
||||||
|
<h4 id="code-block-with-hugos-internal-highlight-shortcode">Code block with Hugo&rsquo;s internal highlight shortcode <a href="#code-block-with-hugos-internal-highlight-shortcode" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span></span></span></code></pre></div>
|
||||||
|
<h2 id="list-types">List Types <a href="#list-types" class="anchor">🔗</a></h2><h4 id="ordered-list">Ordered List <a href="#ordered-list" class="anchor">🔗</a></h4><ol>
|
||||||
|
<li>First item</li>
|
||||||
|
<li>Second item</li>
|
||||||
|
<li>Third item</li>
|
||||||
|
</ol>
|
||||||
|
<h4 id="unordered-list">Unordered List <a href="#unordered-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>List item</li>
|
||||||
|
<li>Another item</li>
|
||||||
|
<li>And another item</li>
|
||||||
|
</ul>
|
||||||
|
<h4 id="nested-list">Nested list <a href="#nested-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>Fruit
|
||||||
|
<ul>
|
||||||
|
<li>Apple</li>
|
||||||
|
<li>Orange</li>
|
||||||
|
<li>Banana</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Dairy
|
||||||
|
<ul>
|
||||||
|
<li>Milk</li>
|
||||||
|
<li>Cheese</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="other-elements--abbr-sub-sup-kbd-mark">Other Elements — abbr, sub, sup, kbd, mark <a href="#other-elements--abbr-sub-sup-kbd-mark" class="anchor">🔗</a></h2><p><!-- raw HTML omitted -->GIF<!-- raw HTML omitted --> is a bitmap image format.</p>
|
||||||
|
<p>H<!-- raw HTML omitted -->2<!-- raw HTML omitted -->O</p>
|
||||||
|
<p>X<!-- raw HTML omitted -->n<!-- raw HTML omitted --> + Y<!-- raw HTML omitted -->n<!-- raw HTML omitted --> = Z<!-- raw HTML omitted -->n<!-- raw HTML omitted --></p>
|
||||||
|
<p>Press <!-- raw HTML omitted --><!-- raw HTML omitted -->CTRL<!-- raw HTML omitted -->+<!-- raw HTML omitted -->ALT<!-- raw HTML omitted -->+<!-- raw HTML omitted -->Delete<!-- raw HTML omitted --><!-- raw HTML omitted --> to end the session.</p>
|
||||||
|
<p>Most <!-- raw HTML omitted -->salamanders<!-- raw HTML omitted --> are nocturnal, and hunt for insects, worms, and other small creatures.</p>
|
||||||
|
<div class="footnotes" role="doc-endnotes">
|
||||||
|
<hr>
|
||||||
|
<ol>
|
||||||
|
<li id="fn:1">
|
||||||
|
<p>The above quote is excerpted from Rob Pike&rsquo;s <a href="https://www.youtube.com/watch?v=PAAkCSZUG1c">talk</a> during Gopherfest, November 18, 2015.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
</rss>
|
652
css/style.css
Normal file
652
css/style.css
Normal file
|
@ -0,0 +1,652 @@
|
||||||
|
:root {
|
||||||
|
--fonts-sans-serif: Roboto, Helvetica, Tahoma, Arial,
|
||||||
|
"DejaVu Sans", "Liberation Sans",
|
||||||
|
|
||||||
|
"WenQuanYi Zen Hei", "WenQuanYi Micro Hei",
|
||||||
|
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
|
||||||
|
"Noto Sans CJK",
|
||||||
|
sans-serif;
|
||||||
|
|
||||||
|
--fonts-serif: PMingLiu, "Times New Roman",
|
||||||
|
"Noto Serif CJK", STSong, SimSun,
|
||||||
|
serif;
|
||||||
|
|
||||||
|
--fonts-mono: "DejaVu Sans Mono", "Liberation Mono", "Noto Sans Mono", "Consolas", "Courier",
|
||||||
|
"Noto Sans Mono CJK",
|
||||||
|
"WenQuanYi Zen Hei Mono",
|
||||||
|
"WenQuanYi Micro Hei Mono",
|
||||||
|
monospace;
|
||||||
|
|
||||||
|
--color-light-1: #e0e0e0;
|
||||||
|
--color-light-2: #e8e8e8;
|
||||||
|
--color-light-3: #f0f0f0;
|
||||||
|
--color-light-4: #f4f4f4;
|
||||||
|
--color-light-5: #fefefe;
|
||||||
|
|
||||||
|
--color-black-0: #909090;
|
||||||
|
--color-black-1: #686868;
|
||||||
|
--color-black-2: #404040;
|
||||||
|
--color-black-3: #282828;
|
||||||
|
--color-black-4: #101010;
|
||||||
|
--color-black-5: #020202;
|
||||||
|
|
||||||
|
--color-fav-0: #EDD5DD;
|
||||||
|
--color-fav-1: #F0B3B2;
|
||||||
|
--color-fav-2: #DE629E;
|
||||||
|
--color-fav-3: #CB3E50;
|
||||||
|
|
||||||
|
--len-0: 0.00rem;
|
||||||
|
--len-1: 0.25rem;
|
||||||
|
--len-2: 0.50rem;
|
||||||
|
--len-3: 1.00rem;
|
||||||
|
--len-4: 1.50rem;
|
||||||
|
--len-5: 3.00rem;
|
||||||
|
|
||||||
|
--font-size-0: 0.8125rem;
|
||||||
|
--font-size-1: 0.875rem;
|
||||||
|
--font-size-2: 1.000rem;
|
||||||
|
--font-size-3: 1.125rem;
|
||||||
|
--font-size-4: 1.250rem;
|
||||||
|
--font-size-5: 1.500rem;
|
||||||
|
--font-size-6: 2.000rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
*, ::before, ::after {
|
||||||
|
font-family: inherit;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: var(--fonts-sans-serif);
|
||||||
|
font-size: 16px;
|
||||||
|
color: var(--color-black-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
/* approximately set up the layout of header, footer and main */
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
background-color: var(--color-light-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set up padding and margin of some main elements */
|
||||||
|
.main-wrapper {
|
||||||
|
margin-top: var(--len-5);
|
||||||
|
margin-bottom: var(--len-5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-wrapper { display: flex; flex-wrap: wrap; }
|
||||||
|
.main-wrapper > * { height: fit-content; }
|
||||||
|
|
||||||
|
.main { padding: var(--len-4); }
|
||||||
|
.side { padding-left: var(--len-4); }
|
||||||
|
.main { flex: 0 0 72%; width: 72%; }
|
||||||
|
.side { flex: 0 0 28%; width: 28%; }
|
||||||
|
|
||||||
|
@media (max-width: 991px) {
|
||||||
|
.main { padding: var(--len-4); }
|
||||||
|
.side { padding-left: 0; padding-top: var(--len-4); }
|
||||||
|
.main { flex: 0 0 100%; width: 100%; }
|
||||||
|
.side { flex: 0 0 100%; width: 100%; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set light background */
|
||||||
|
.header-wrapper,
|
||||||
|
.footer,
|
||||||
|
.main,
|
||||||
|
.side-recent,
|
||||||
|
.side-categories,
|
||||||
|
.side-tags
|
||||||
|
{ background-color: var(--color-light-5); }
|
||||||
|
|
||||||
|
/* place header in the center of header-wrapper */
|
||||||
|
.header-wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* let footer stay at bottom of screen */
|
||||||
|
.footer {
|
||||||
|
margin-top: auto;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********** set up break point **********/
|
||||||
|
|
||||||
|
.main-wrapper, .header { max-width: 1320px; }
|
||||||
|
@media (max-width: 1399px) { .main-wrapper, .header { max-width: 1140px; } }
|
||||||
|
@media (max-width: 1199px) { .main-wrapper, .header { max-width: 960px; } }
|
||||||
|
@media (max-width: 991px) { .main-wrapper, .header { max-width: 720px; } }
|
||||||
|
@media (max-width: 767px) { .main-wrapper, .header { max-width: 540px; } }
|
||||||
|
@media (max-width: 575px) { .main-wrapper, .header { max-width: none; } }
|
||||||
|
|
||||||
|
/* size the element who has breakpoint limitation */
|
||||||
|
/* .header, .main-wrapper, .main { width: 100vw; } */
|
||||||
|
/* .header-wrapper, .footer { width: 100vw; } */
|
||||||
|
.header-wrapper, .footer { width: 100vw;}
|
||||||
|
.main-wrapper { width: calc(100vw - 2 * var(--len-3));}
|
||||||
|
|
||||||
|
/************************/
|
||||||
|
/* set up header layout */
|
||||||
|
/************************/
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: var(--len-3);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* place title and menus horizonally */
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .menu { justify-content: center; align-items: center; }
|
||||||
|
.header .site-title { text-align: center; }
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.header .site-title {
|
||||||
|
padding-top: var(--len-4);
|
||||||
|
|
||||||
|
flex: 0 0 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .menu {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
|
||||||
|
margin-top: var(--len-3);
|
||||||
|
padding-top: var(--len-3);
|
||||||
|
border-top: 1px solid var(--color-light-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* setup hyper link style */
|
||||||
|
.header .site-title {
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--fonts-serif);
|
||||||
|
font-size: var(--font-size-6);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/********** set up menus layout **********/
|
||||||
|
|
||||||
|
/* menus and submenus, hover to display, and setup animation */
|
||||||
|
.header .menu-item .sub-menu { visibility: hidden; opacity: 0; transition: opacity 0.25s, visibility 0.25s; }
|
||||||
|
.header .menu-item:hover .sub-menu { visibility: visible; opacity: 1; }
|
||||||
|
.header .sub-menu { position: absolute; }
|
||||||
|
|
||||||
|
/* menu direction */
|
||||||
|
.header .menu {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.header .sub-menu {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* remove the unwanted default css in menus */
|
||||||
|
.header ul { list-style: none; margin: 0; padding: 0; }
|
||||||
|
.header li { list-style: none; }
|
||||||
|
|
||||||
|
/* set up spacing of menu items in menu and sub-menu */
|
||||||
|
.header .menu > * { margin-right: var(--len-3); }
|
||||||
|
.header .menu > *:last-child { margin-right: 0; }
|
||||||
|
.header .sub-menu > * { margin-bottom: var(--len-2); }
|
||||||
|
.header .sub-menu > *:last-child { margin-bottom: 0; }
|
||||||
|
|
||||||
|
/* beautify sub menu style */
|
||||||
|
.header .sub-menu {
|
||||||
|
background-color: var(--color-light-5);
|
||||||
|
padding: var(--len-2) var(--len-4);
|
||||||
|
box-shadow: var(--color-light-1) 0px 0px 3px 1px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* beautify menu item */
|
||||||
|
.header .menu-item {
|
||||||
|
font-family: var(--fonts-serif);
|
||||||
|
font-size: var(--font-size-3);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header a { color: var(--color-black-3); text-decoration: none; }
|
||||||
|
.header a:hover { color: var(--color-fav-2); }
|
||||||
|
|
||||||
|
/************************/
|
||||||
|
/* set up footer layout */
|
||||||
|
/************************/
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
padding: var(--len-4) 0;
|
||||||
|
font-size: var(--font-size-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer > * {
|
||||||
|
margin-top: var(--len-2);
|
||||||
|
margin-bottom: var(--len-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* credit, license and social layout */
|
||||||
|
.footer .footer-row { display: flex; justify-content: center; }
|
||||||
|
|
||||||
|
.footer .footer-item { margin-right: var(--len-3); }
|
||||||
|
.footer .footer-item:last-child { margin-right: 0; }
|
||||||
|
|
||||||
|
/* beautify hyper link style */
|
||||||
|
.footer { color: var(--color-black-1) }
|
||||||
|
|
||||||
|
.footer a { color: var(--color-fav-2); text-decoration: none; }
|
||||||
|
.footer a:hover { color: var(--color-fav-3); }
|
||||||
|
|
||||||
|
.footer img {
|
||||||
|
display: inline;
|
||||||
|
height: var(--font-size-1);
|
||||||
|
color: var(--color-fav-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************/
|
||||||
|
/* set up home page's list layout */
|
||||||
|
/**********************************/
|
||||||
|
|
||||||
|
.list-item .tips {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
font-size: var(--font-size-1);
|
||||||
|
color: var(--color-black-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item .tips > * { margin-right: var(--len-3); }
|
||||||
|
.list-item .tips > *:last-child { margin-right: 0; }
|
||||||
|
|
||||||
|
.list-item .title a { text-decoration: none; color: var(--color-black-2); }
|
||||||
|
.list-item .title a:hover { color: var(--color-fav-2); }
|
||||||
|
.list-item .tips a { text-decoration: none; color: var(--color-fav-2) }
|
||||||
|
.list-item .tips a:hover { color: var(--color-fav-3) }
|
||||||
|
|
||||||
|
.list-item .title { margin: var(--len-2) 0 var(--len-3) 0; }
|
||||||
|
|
||||||
|
.list-item .tags > *,
|
||||||
|
.list-item .categories > *
|
||||||
|
{ margin: 0 var(--len-1); }
|
||||||
|
|
||||||
|
.list-item .summary > * { margin: 0; }
|
||||||
|
.list-item .title { margin: 0 0 var(--len-2) 0; }
|
||||||
|
.list-item .tips { margin: 0 0 var(--len-3) 0; }
|
||||||
|
|
||||||
|
.list-item { border-bottom: 1px solid var(--color-light-2); }
|
||||||
|
.list-item:last-child { border-bottom: 0; }
|
||||||
|
|
||||||
|
.list-item:first-child { padding-top: 0;}
|
||||||
|
.list-item { padding: var(--len-3) 0; }
|
||||||
|
.list-item:last-child { padding-bottom: 0;}
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* set up side layout */
|
||||||
|
/**********************/
|
||||||
|
|
||||||
|
.side h2 { margin: 0; }
|
||||||
|
|
||||||
|
.side ul { list-style: none; margin: 0; padding: 0; }
|
||||||
|
|
||||||
|
.side li { margin-bottom: var(--len-3); }
|
||||||
|
.side li:last-child { margin-bottom: 0; }
|
||||||
|
|
||||||
|
.side hr {
|
||||||
|
border: none;
|
||||||
|
height: 1px;
|
||||||
|
background-color: var(--color-light-2);
|
||||||
|
|
||||||
|
margin: var(--len-2) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side > * { padding: var(--len-4); }
|
||||||
|
|
||||||
|
.side > * { margin-bottom: var(--len-3); }
|
||||||
|
.side > *:last-child { margin-bottom: 0; }
|
||||||
|
|
||||||
|
.side a { color: var(--color-black-3); text-decoration: none; }
|
||||||
|
.side a:hover { color: var(--color-fav-2); }
|
||||||
|
|
||||||
|
/* horizontally place tags */
|
||||||
|
.side .side-tags li { display: inline-block; margin: var(--len-1) var(--len-1); }
|
||||||
|
|
||||||
|
/*****************************/
|
||||||
|
/* set up single post layout */
|
||||||
|
/*****************************/
|
||||||
|
|
||||||
|
.single {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.single a { text-decoration: none; color: var(--color-fav-2); }
|
||||||
|
.single a:hover { color: var(--color-fav-3); }
|
||||||
|
|
||||||
|
.single .title,
|
||||||
|
.single .tip,
|
||||||
|
.single .taxonomies,
|
||||||
|
.single .content
|
||||||
|
{ width: 100%; }
|
||||||
|
|
||||||
|
.single .taxonomies { margin-top: var(--len-1); }
|
||||||
|
|
||||||
|
.single > hr {
|
||||||
|
border: none;
|
||||||
|
background-color: var(--color-fav-1);
|
||||||
|
height: 1px;
|
||||||
|
|
||||||
|
width: 90%;
|
||||||
|
margin: var(--len-3) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.single .title,
|
||||||
|
.single .tip,
|
||||||
|
.single .taxonomies
|
||||||
|
{ text-align: center; }
|
||||||
|
|
||||||
|
.single .tip,
|
||||||
|
.single .taxonomies
|
||||||
|
{ color: var(--color-black-1)}
|
||||||
|
|
||||||
|
.single .taxonomies > * { display: inline-block; }
|
||||||
|
|
||||||
|
.single .taxonomies > * { margin-right: var(--len-3); }
|
||||||
|
.single .taxonomies > *:last-child { margin-right: 0; }
|
||||||
|
|
||||||
|
.single .title {
|
||||||
|
margin: var(--len-2) 0 var(--len-3) 0;
|
||||||
|
font-size: var(--font-size-6);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***** set up content style *****/
|
||||||
|
|
||||||
|
.content p code {
|
||||||
|
font-family: var(--fonts-mono);
|
||||||
|
|
||||||
|
background-color: var(--color-light-4);
|
||||||
|
|
||||||
|
padding: 0 2px;
|
||||||
|
border: 1px solid var(--color-light-1);
|
||||||
|
border-radius: 2px;
|
||||||
|
line-height: inherit;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* keep in style with highlighting */
|
||||||
|
.content pre { padding: 7px; }
|
||||||
|
|
||||||
|
.content pre code {
|
||||||
|
font-family: var(--fonts-mono);
|
||||||
|
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
padding: var(--len-3);
|
||||||
|
|
||||||
|
background-color: var(--color-light-4);
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
overflow: auto;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content blockquote {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding-left: 1em;
|
||||||
|
margin-left: 0px;
|
||||||
|
border-left: 3px solid #eee;
|
||||||
|
color: var(--color-black-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content hr {
|
||||||
|
border: none;
|
||||||
|
height: 2px;
|
||||||
|
background-color: var(--color-light-4);
|
||||||
|
|
||||||
|
width: 80%;
|
||||||
|
margin: var(--len-2) auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table {
|
||||||
|
width: 100%;
|
||||||
|
margin: 40px 0;
|
||||||
|
border-collapse: collapse;
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content th, td {
|
||||||
|
text-align: left;
|
||||||
|
padding-right: 20px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table td, td {
|
||||||
|
border-spacing: none;
|
||||||
|
border-style: solid;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
.content thead th, th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 10px 15px;
|
||||||
|
height: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #444;
|
||||||
|
cursor: default;
|
||||||
|
white-space: nowrap;
|
||||||
|
border: 1px solid #dadadc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content tr>td {
|
||||||
|
border: 1px solid #dadadc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content tr:nth-child(odd)>td {
|
||||||
|
background: #fcfcfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1,
|
||||||
|
.content h2,
|
||||||
|
.content h3 {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.content p,
|
||||||
|
.content pre {
|
||||||
|
word-break: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
.content .markdown-image img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.content .anchor {
|
||||||
|
visibility: hidden;
|
||||||
|
color: var(--color-fav-2);
|
||||||
|
}
|
||||||
|
.content h1:hover a,
|
||||||
|
.content h2:hover a,
|
||||||
|
.content h3:hover a,
|
||||||
|
.content h4:hover a
|
||||||
|
{ visibility: visible }
|
||||||
|
|
||||||
|
.highlight pre {
|
||||||
|
padding: 7px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************/
|
||||||
|
/* setup list page layout */
|
||||||
|
/**************************/
|
||||||
|
|
||||||
|
#archive {
|
||||||
|
padding-left: var(--len-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
#archive .group {
|
||||||
|
margin: var(--len-4) auto;
|
||||||
|
}
|
||||||
|
#archive .group .key {
|
||||||
|
font-size: var(--font-size-4);
|
||||||
|
margin-bottom: var(--len-2);
|
||||||
|
}
|
||||||
|
#archive .group .value {
|
||||||
|
display: block;
|
||||||
|
font-size: var(--font-size-2);
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
#archive .group .value { text-indent: -60px; padding-left: 60px; }
|
||||||
|
#archive .group .value * { text-indent: 0; }
|
||||||
|
#archive .group .value .date { display: inline-block; width: 60px; }
|
||||||
|
#archive .group .value .title { display: inline; }
|
||||||
|
|
||||||
|
#archive .group .value .date { color: var(--color-black-0); }
|
||||||
|
|
||||||
|
#archive .group .value a { text-decoration: none; }
|
||||||
|
|
||||||
|
#archive .group .value a { color: var(--color-black-3); }
|
||||||
|
#archive .group .value a:hover { color: var(--color-fav-2); }
|
||||||
|
|
||||||
|
#archive .group .value .tags {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 7px;
|
||||||
|
}
|
||||||
|
#archive .group .value .tags {
|
||||||
|
background: var(--color-light-4);
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 4px 7px;
|
||||||
|
font-size: var(--font-size-1);
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* setup terms layout */
|
||||||
|
/**********************/
|
||||||
|
|
||||||
|
#tags {
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 48px auto 0 auto;
|
||||||
|
padding: 0 12px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#tags .tag {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 7px 7px;
|
||||||
|
}
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
#tags {
|
||||||
|
margin: 0 auto 0 auto;
|
||||||
|
}
|
||||||
|
#tags .tag {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#tags .tag a {
|
||||||
|
background: #f2f2f2;
|
||||||
|
padding: 4px 7px;
|
||||||
|
color: #757575;
|
||||||
|
color: #404040;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
#tags .tag a:hover {
|
||||||
|
color: #0366d6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***************************/
|
||||||
|
/* setup pagination layout */
|
||||||
|
/***************************/
|
||||||
|
|
||||||
|
.pagination {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
padding-top: var(--len-5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination a {
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
font-size: var(--font-size-2);
|
||||||
|
|
||||||
|
border-radius: var(--len-5);
|
||||||
|
width: var(--len-5);
|
||||||
|
height: var(--len-5);
|
||||||
|
line-height: var(--len-5);
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
color: var(--color-black-2);
|
||||||
|
background-color: var(--color-light-3);
|
||||||
|
|
||||||
|
transition: background-color 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination a:hover {
|
||||||
|
background-color: var(--color-fav-0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination a.current {
|
||||||
|
background-color: var(--color-fav-1);
|
||||||
|
pointer-events: none;
|
||||||
|
color: var(--color-black-1);
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***************************/
|
||||||
|
/* setup commenting layout */
|
||||||
|
/***************************/
|
||||||
|
|
||||||
|
.commenting {
|
||||||
|
width: 85%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* keep content style from being affected by remark42 style */
|
||||||
|
.content pre {
|
||||||
|
background-color: transparent;
|
||||||
|
color: var(--color-black-3)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********/
|
||||||
|
/** misc **/
|
||||||
|
/**********/
|
||||||
|
|
||||||
|
.archive-hint {
|
||||||
|
padding-left: var(--len-4);
|
||||||
|
color: var(--color-fav-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.max-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
85
css/syntax.css
Normal file
85
css/syntax.css
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
/* Background */ .bg { color: #272822; }
|
||||||
|
/* PreWrapper */ .chroma { color: #272822; }
|
||||||
|
/* Other */ .chroma .x { }
|
||||||
|
/* Error */ .chroma .err { color: #960050; background-color: #1e0010 }
|
||||||
|
/* CodeLine */ .chroma .cl { }
|
||||||
|
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||||
|
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||||
|
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
|
||||||
|
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||||
|
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||||
|
/* Line */ .chroma .line { display: flex; }
|
||||||
|
/* Keyword */ .chroma .k { color: #00a8c8 }
|
||||||
|
/* KeywordConstant */ .chroma .kc { color: #00a8c8 }
|
||||||
|
/* KeywordDeclaration */ .chroma .kd { color: #00a8c8 }
|
||||||
|
/* KeywordNamespace */ .chroma .kn { color: #f92672 }
|
||||||
|
/* KeywordPseudo */ .chroma .kp { color: #00a8c8 }
|
||||||
|
/* KeywordReserved */ .chroma .kr { color: #00a8c8 }
|
||||||
|
/* KeywordType */ .chroma .kt { color: #00a8c8 }
|
||||||
|
/* Name */ .chroma .n { color: #111111 }
|
||||||
|
/* NameAttribute */ .chroma .na { color: #75af00 }
|
||||||
|
/* NameBuiltin */ .chroma .nb { color: #111111 }
|
||||||
|
/* NameBuiltinPseudo */ .chroma .bp { color: #111111 }
|
||||||
|
/* NameClass */ .chroma .nc { color: #75af00 }
|
||||||
|
/* NameConstant */ .chroma .no { color: #00a8c8 }
|
||||||
|
/* NameDecorator */ .chroma .nd { color: #75af00 }
|
||||||
|
/* NameEntity */ .chroma .ni { color: #111111 }
|
||||||
|
/* NameException */ .chroma .ne { color: #75af00 }
|
||||||
|
/* NameFunction */ .chroma .nf { color: #75af00 }
|
||||||
|
/* NameFunctionMagic */ .chroma .fm { color: #111111 }
|
||||||
|
/* NameLabel */ .chroma .nl { color: #111111 }
|
||||||
|
/* NameNamespace */ .chroma .nn { color: #111111 }
|
||||||
|
/* NameOther */ .chroma .nx { color: #75af00 }
|
||||||
|
/* NameProperty */ .chroma .py { color: #111111 }
|
||||||
|
/* NameTag */ .chroma .nt { color: #f92672 }
|
||||||
|
/* NameVariable */ .chroma .nv { color: #111111 }
|
||||||
|
/* NameVariableClass */ .chroma .vc { color: #111111 }
|
||||||
|
/* NameVariableGlobal */ .chroma .vg { color: #111111 }
|
||||||
|
/* NameVariableInstance */ .chroma .vi { color: #111111 }
|
||||||
|
/* NameVariableMagic */ .chroma .vm { color: #111111 }
|
||||||
|
/* Literal */ .chroma .l { color: #ae81ff }
|
||||||
|
/* LiteralDate */ .chroma .ld { color: #d88200 }
|
||||||
|
/* LiteralString */ .chroma .s { color: #d88200 }
|
||||||
|
/* LiteralStringAffix */ .chroma .sa { color: #d88200 }
|
||||||
|
/* LiteralStringBacktick */ .chroma .sb { color: #d88200 }
|
||||||
|
/* LiteralStringChar */ .chroma .sc { color: #d88200 }
|
||||||
|
/* LiteralStringDelimiter */ .chroma .dl { color: #d88200 }
|
||||||
|
/* LiteralStringDoc */ .chroma .sd { color: #d88200 }
|
||||||
|
/* LiteralStringDouble */ .chroma .s2 { color: #d88200 }
|
||||||
|
/* LiteralStringEscape */ .chroma .se { color: #8045ff }
|
||||||
|
/* LiteralStringHeredoc */ .chroma .sh { color: #d88200 }
|
||||||
|
/* LiteralStringInterpol */ .chroma .si { color: #d88200 }
|
||||||
|
/* LiteralStringOther */ .chroma .sx { color: #d88200 }
|
||||||
|
/* LiteralStringRegex */ .chroma .sr { color: #d88200 }
|
||||||
|
/* LiteralStringSingle */ .chroma .s1 { color: #d88200 }
|
||||||
|
/* LiteralStringSymbol */ .chroma .ss { color: #d88200 }
|
||||||
|
/* LiteralNumber */ .chroma .m { color: #ae81ff }
|
||||||
|
/* LiteralNumberBin */ .chroma .mb { color: #ae81ff }
|
||||||
|
/* LiteralNumberFloat */ .chroma .mf { color: #ae81ff }
|
||||||
|
/* LiteralNumberHex */ .chroma .mh { color: #ae81ff }
|
||||||
|
/* LiteralNumberInteger */ .chroma .mi { color: #ae81ff }
|
||||||
|
/* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff }
|
||||||
|
/* LiteralNumberOct */ .chroma .mo { color: #ae81ff }
|
||||||
|
/* Operator */ .chroma .o { color: #f92672 }
|
||||||
|
/* OperatorWord */ .chroma .ow { color: #f92672 }
|
||||||
|
/* Punctuation */ .chroma .p { color: #111111 }
|
||||||
|
/* Comment */ .chroma .c { color: #75715e }
|
||||||
|
/* CommentHashbang */ .chroma .ch { color: #75715e }
|
||||||
|
/* CommentMultiline */ .chroma .cm { color: #75715e }
|
||||||
|
/* CommentSingle */ .chroma .c1 { color: #75715e }
|
||||||
|
/* CommentSpecial */ .chroma .cs { color: #75715e }
|
||||||
|
/* CommentPreproc */ .chroma .cp { color: #75715e }
|
||||||
|
/* CommentPreprocFile */ .chroma .cpf { color: #75715e }
|
||||||
|
/* Generic */ .chroma .g { }
|
||||||
|
/* GenericDeleted */ .chroma .gd { }
|
||||||
|
/* GenericEmph */ .chroma .ge { font-style: italic }
|
||||||
|
/* GenericError */ .chroma .gr { }
|
||||||
|
/* GenericHeading */ .chroma .gh { }
|
||||||
|
/* GenericInserted */ .chroma .gi { }
|
||||||
|
/* GenericOutput */ .chroma .go { }
|
||||||
|
/* GenericPrompt */ .chroma .gp { }
|
||||||
|
/* GenericStrong */ .chroma .gs { font-weight: bold }
|
||||||
|
/* GenericSubheading */ .chroma .gu { }
|
||||||
|
/* GenericTraceback */ .chroma .gt { }
|
||||||
|
/* GenericUnderline */ .chroma .gl { }
|
||||||
|
/* TextWhitespace */ .chroma .w { }
|
245
essays/index.html
Normal file
245
essays/index.html
Normal file
|
@ -0,0 +1,245 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Essays | Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml" title="Flat theme" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="content archive-hint"><p><em>There are some short articles.</em></p></div>
|
||||||
|
|
||||||
|
|
||||||
|
<section id="archive">
|
||||||
|
|
||||||
|
<div class="group">
|
||||||
|
<h3 class="key">
|
||||||
|
2022
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="value">
|
||||||
|
<time class="date" datetime="2022-05-16 21:57:50 +0800 CST">05/16</time>
|
||||||
|
|
||||||
|
<div class="title">
|
||||||
|
|
||||||
|
<a href="https://leafee98.github.io/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
24
essays/index.xml
Normal file
24
essays/index.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>Essays on Flat theme</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/essays/</link>
|
||||||
|
<description>Recent content in Essays on Flat theme</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<lastBuildDate>Wed, 18 May 2022 11:19:08 +0800</lastBuildDate><atom:link href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<item>
|
||||||
|
<title>What Is Hugo</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/essays/what-is-hugo/</link>
|
||||||
|
<pubDate>Mon, 16 May 2022 21:57:50 +0800</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/essays/what-is-hugo/</guid>
|
||||||
|
<description><p>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]</p>
|
||||||
|
<p>Being able to generate most websites within seconds (at &lt; 1 ms per page), Hugo&rsquo;s official website states it is &ldquo;the world’s fastest framework for building websites&rdquo;. 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]</p>
|
||||||
|
<blockquote>
|
||||||
|
<p>Source: <a href="https://en.wikipedia.org/wiki/Hugo_(software)">https://en.wikipedia.org/wiki/Hugo_(software)</a></p>
|
||||||
|
<p>License: <a href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">CC-BY-SA 3.0</a></p>
|
||||||
|
</blockquote></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
</rss>
|
248
essays/what-is-hugo/index.html
Normal file
248
essays/what-is-hugo/index.html
Normal file
|
@ -0,0 +1,248 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>What Is Hugo | Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<section class="single">
|
||||||
|
<h1 class="title">What Is Hugo</h1>
|
||||||
|
|
||||||
|
<div class="tip">
|
||||||
|
<time datetime="2022-05-16 21:57:50 +0800 CST">2022/05/16</time>
|
||||||
|
<span class="split">·</span>
|
||||||
|
<span> 114 words </span>
|
||||||
|
<span class="split">·</span>
|
||||||
|
<span>
|
||||||
|
1 minutes to read
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="taxonomies">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<p>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]</p>
|
||||||
|
<p>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]</p>
|
||||||
|
<blockquote>
|
||||||
|
<p>Source: <a href="https://en.wikipedia.org/wiki/Hugo_(software)">https://en.wikipedia.org/wiki/Hugo_(software)</a></p>
|
||||||
|
<p>License: <a href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">CC-BY-SA 3.0</a></p>
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
359
index.html
Normal file
359
index.html
Normal file
|
@ -0,0 +1,359 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="Hugo 0.102.3" />
|
||||||
|
<title>Flat theme</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="https://leafee98.github.io/hugo-theme-flat/index.xml" title="Flat theme" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/lib/icofont/icofont.min.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/syntax.css" />
|
||||||
|
<link rel="stylesheet" href="/hugo-theme-flat/css/style.css" />
|
||||||
|
<link rel="shortcut icon" href="/hugo-theme-flat/images/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="header-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<a class="site-title" href="https://leafee98.github.io/hugo-theme-flat/">Flat theme</a>
|
||||||
|
|
||||||
|
<ul class="menu">
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/posts/">Posts</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/essays/">Essays</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a>Services↓</a>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service A</a></li>
|
||||||
|
|
||||||
|
<li class="menu-item"><a href="#">Service B</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/about/">About</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main-wrapper">
|
||||||
|
<div class="main">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="max-wrapper">
|
||||||
|
<div id="list-page">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<section class="list-item">
|
||||||
|
<h1 class="title"><a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a></h1>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
<div class="date">
|
||||||
|
<time datetime="2022-09-20 09:36:26 +0800 CST">2022/09/20</time>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary"><p>This article contians some test for latex support. Currently the lib used for rendering LaTeX is <a href="https://katex.org/">\(\KaTeX\)</a></p></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="list-item">
|
||||||
|
<h1 class="title"><a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a></h1>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
<div class="date">
|
||||||
|
<time datetime="2019-03-11 00:00:00 +0000 UTC">2019/03/11</time>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="categories">
|
||||||
|
<span>Categories:</span>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes</a>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tags">
|
||||||
|
<span>Tags:</span>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown</a>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css</a>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary"><p>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.</p></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="list-item">
|
||||||
|
<h1 class="title"><a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a></h1>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
<div class="date">
|
||||||
|
<time datetime="2019-03-09 00:00:00 +0000 UTC">2019/03/09</time>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tags">
|
||||||
|
<span>Tags:</span>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown</a>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary"><p>Lorem est tota propiore conpellat pectoribus de pectora summo.</p></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="list-item">
|
||||||
|
<h1 class="title"><a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a></h1>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
<div class="date">
|
||||||
|
<time datetime="2019-03-08 00:00:00 +0000 UTC">2019/03/08</time>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary"><p>Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.</p></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="list-item">
|
||||||
|
<h1 class="title"><a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a></h1>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
<div class="date">
|
||||||
|
<time datetime="2019-03-05 00:00:00 +0000 UTC">2019/03/05</time>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tags">
|
||||||
|
<span>Tags:</span>
|
||||||
|
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary"><p>Emoji can be enabled in a Hugo project in a number of ways.</p></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="pagination">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="enabled current" href="/hugo-theme-flat/">1</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="side">
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Posts</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/latex-support/">Latex Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/markdown-syntax/">Markdown Syntax Guide</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/placeholder-text/">Placeholder Text</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/math-typesetting/">Math Typesetting</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/posts/emoji-support/">Emoji Support</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-recent">
|
||||||
|
<h2 class="side-title">Recent Essays</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/essays/what-is-hugo/">What Is Hugo</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="side-categories">
|
||||||
|
<h2>Categories</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/syntax">syntax(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/categories/themes">themes(1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side-tags">
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/css">css (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/emoji">emoji (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/html">html (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/markdown">markdown (2)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/hugo-theme-flat/tags/text">text (1)</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/posts/index.xml">
|
||||||
|
Feed of Posts
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="footer-item" href="https://leafee98.github.io/hugo-theme-flat/essays/index.xml">
|
||||||
|
Feed of Essays
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Copyright <a href="https://creativecommons.org/licenses/by/4.0/">CC BY-4.0</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer-row">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span class="footer-item">Theme <a href="https://cgit.leafee98.com/hugo-theme-flat.git">hugo-theme-flat</a></span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
245
index.xml
Normal file
245
index.xml
Normal file
|
@ -0,0 +1,245 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>Flat theme</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/</link>
|
||||||
|
<description>Recent content on Flat theme</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<lastBuildDate>Tue, 20 Sep 2022 09:36:26 +0800</lastBuildDate><atom:link href="https://leafee98.github.io/hugo-theme-flat/index.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<item>
|
||||||
|
<title>Latex Support</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/latex-support/</link>
|
||||||
|
<pubDate>Tue, 20 Sep 2022 09:36:26 +0800</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/latex-support/</guid>
|
||||||
|
<description><p>This article contians some test for latex support. Currently the lib used for rendering LaTeX is <a href="https://katex.org/">\(\KaTeX\)</a></p>
|
||||||
|
<p>$$
|
||||||
|
\pi=\int_{-\infty}^\infty\frac{dx}{1+x^2}
|
||||||
|
$$</p>
|
||||||
|
<h2 id="the-code-which-render-the-above">The code which render the above <a href="#the-code-which-render-the-above" class="anchor">🔗</a></h2><pre tabindex="0"><code>This article contians some test for latex support. Currently the lib used for rendering LaTeX is [\\(\KaTeX\\)](https://katex.org/)
|
||||||
|
|
||||||
|
$$
|
||||||
|
\pi=\int_{-\infty}^\infty\frac{dx}{1+x^2}
|
||||||
|
$$
|
||||||
|
|
||||||
|
We support \\(\LaTeX\\) now!
|
||||||
|
</code></pre></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>What Is Hugo</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/essays/what-is-hugo/</link>
|
||||||
|
<pubDate>Mon, 16 May 2022 21:57:50 +0800</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/essays/what-is-hugo/</guid>
|
||||||
|
<description><p>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]</p>
|
||||||
|
<p>Being able to generate most websites within seconds (at &lt; 1 ms per page), Hugo&rsquo;s official website states it is &ldquo;the world’s fastest framework for building websites&rdquo;. 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]</p>
|
||||||
|
<blockquote>
|
||||||
|
<p>Source: <a href="https://en.wikipedia.org/wiki/Hugo_(software)">https://en.wikipedia.org/wiki/Hugo_(software)</a></p>
|
||||||
|
<p>License: <a href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">CC-BY-SA 3.0</a></p>
|
||||||
|
</blockquote></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>Markdown Syntax Guide</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</link>
|
||||||
|
<pubDate>Mon, 11 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/markdown-syntax/</guid>
|
||||||
|
<description><p>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.</p>
|
||||||
|
<h2 id="headings">Headings <a href="#headings" class="anchor">🔗</a></h2><p>The following HTML <code>&lt;h1&gt;</code>—<code>&lt;h6&gt;</code> elements represent six levels of section headings. <code>&lt;h1&gt;</code> is the highest section level while <code>&lt;h6&gt;</code> is the lowest.</p>
|
||||||
|
<h1 id="h1">H1 <a href="#h1" class="anchor">🔗</a></h1><h2 id="h2">H2 <a href="#h2" class="anchor">🔗</a></h2><h3 id="h3">H3 <a href="#h3" class="anchor">🔗</a></h3><h4 id="h4">H4 <a href="#h4" class="anchor">🔗</a></h4><h5 id="h5">H5 <a href="#h5" class="anchor">🔗</a></h5><h6 id="h6">H6 <a href="#h6" class="anchor">🔗</a></h6><h2 id="paragraph">Paragraph <a href="#paragraph" class="anchor">🔗</a></h2><p>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.</p>
|
||||||
|
<p>Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.</p>
|
||||||
|
<h2 id="blockquotes">Blockquotes <a href="#blockquotes" class="anchor">🔗</a></h2><p>The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a <code>footer</code> or <code>cite</code> element, and optionally with in-line changes such as annotations and abbreviations.</p>
|
||||||
|
<h4 id="blockquote-without-attribution">Blockquote without attribution <a href="#blockquote-without-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||||
|
<strong>Note</strong> that you can use <em>Markdown syntax</em> within a blockquote.</p>
|
||||||
|
</blockquote>
|
||||||
|
<h4 id="blockquote-with-attribution">Blockquote with attribution <a href="#blockquote-with-attribution" class="anchor">🔗</a></h4><blockquote>
|
||||||
|
<p>Don&rsquo;t communicate by sharing memory, share memory by communicating.<!-- raw HTML omitted -->
|
||||||
|
— <!-- raw HTML omitted -->Rob Pike<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup><!-- raw HTML omitted --></p>
|
||||||
|
</blockquote>
|
||||||
|
<h2 id="tables">Tables <a href="#tables" class="anchor">🔗</a></h2><p>Tables aren&rsquo;t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.</p>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Age</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Bob</td>
|
||||||
|
<td>27</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Alice</td>
|
||||||
|
<td>23</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h4 id="inline-markdown-within-tables">Inline Markdown within tables <a href="#inline-markdown-within-tables" class="anchor">🔗</a></h4><table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Italics</th>
|
||||||
|
<th>Bold</th>
|
||||||
|
<th>Code</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><em>italics</em></td>
|
||||||
|
<td><strong>bold</strong></td>
|
||||||
|
<td><code>code</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h2 id="code-blocks">Code Blocks <a href="#code-blocks" class="anchor">🔗</a></h2><h4 id="code-block-with-backticks">Code block with backticks <a href="#code-block-with-backticks" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span>
|
||||||
|
</span></span></code></pre></div><h4 id="code-block-indented-with-four-spaces">Code block indented with four spaces <a href="#code-block-indented-with-four-spaces" class="anchor">🔗</a></h4><pre><code>&lt;!doctype html&gt;
|
||||||
|
&lt;html lang=&quot;en&quot;&gt;
|
||||||
|
&lt;head&gt;
|
||||||
|
&lt;meta charset=&quot;utf-8&quot;&gt;
|
||||||
|
&lt;title&gt;Example HTML5 Document&lt;/title&gt;
|
||||||
|
&lt;/head&gt;
|
||||||
|
&lt;body&gt;
|
||||||
|
&lt;p&gt;Test&lt;/p&gt;
|
||||||
|
&lt;/body&gt;
|
||||||
|
&lt;/html&gt;
|
||||||
|
</code></pre>
|
||||||
|
<h4 id="code-block-with-hugos-internal-highlight-shortcode">Code block with Hugo&rsquo;s internal highlight shortcode <a href="#code-block-with-hugos-internal-highlight-shortcode" class="anchor">🔗</a></h4><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="cp">&lt;!doctype html&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">&#34;en&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;</span>Example HTML5 Document<span class="p">&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>Test<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span></span></span></code></pre></div>
|
||||||
|
<h2 id="list-types">List Types <a href="#list-types" class="anchor">🔗</a></h2><h4 id="ordered-list">Ordered List <a href="#ordered-list" class="anchor">🔗</a></h4><ol>
|
||||||
|
<li>First item</li>
|
||||||
|
<li>Second item</li>
|
||||||
|
<li>Third item</li>
|
||||||
|
</ol>
|
||||||
|
<h4 id="unordered-list">Unordered List <a href="#unordered-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>List item</li>
|
||||||
|
<li>Another item</li>
|
||||||
|
<li>And another item</li>
|
||||||
|
</ul>
|
||||||
|
<h4 id="nested-list">Nested list <a href="#nested-list" class="anchor">🔗</a></h4><ul>
|
||||||
|
<li>Fruit
|
||||||
|
<ul>
|
||||||
|
<li>Apple</li>
|
||||||
|
<li>Orange</li>
|
||||||
|
<li>Banana</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Dairy
|
||||||
|
<ul>
|
||||||
|
<li>Milk</li>
|
||||||
|
<li>Cheese</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 id="other-elements--abbr-sub-sup-kbd-mark">Other Elements — abbr, sub, sup, kbd, mark <a href="#other-elements--abbr-sub-sup-kbd-mark" class="anchor">🔗</a></h2><p><!-- raw HTML omitted -->GIF<!-- raw HTML omitted --> is a bitmap image format.</p>
|
||||||
|
<p>H<!-- raw HTML omitted -->2<!-- raw HTML omitted -->O</p>
|
||||||
|
<p>X<!-- raw HTML omitted -->n<!-- raw HTML omitted --> + Y<!-- raw HTML omitted -->n<!-- raw HTML omitted --> = Z<!-- raw HTML omitted -->n<!-- raw HTML omitted --></p>
|
||||||
|
<p>Press <!-- raw HTML omitted --><!-- raw HTML omitted -->CTRL<!-- raw HTML omitted -->+<!-- raw HTML omitted -->ALT<!-- raw HTML omitted -->+<!-- raw HTML omitted -->Delete<!-- raw HTML omitted --><!-- raw HTML omitted --> to end the session.</p>
|
||||||
|
<p>Most <!-- raw HTML omitted -->salamanders<!-- raw HTML omitted --> are nocturnal, and hunt for insects, worms, and other small creatures.</p>
|
||||||
|
<div class="footnotes" role="doc-endnotes">
|
||||||
|
<hr>
|
||||||
|
<ol>
|
||||||
|
<li id="fn:1">
|
||||||
|
<p>The above quote is excerpted from Rob Pike&rsquo;s <a href="https://www.youtube.com/watch?v=PAAkCSZUG1c">talk</a> during Gopherfest, November 18, 2015.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>Placeholder Text</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/placeholder-text/</link>
|
||||||
|
<pubDate>Sat, 09 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/placeholder-text/</guid>
|
||||||
|
<description><p>Lorem est tota propiore conpellat pectoribus de pectora summo.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<ol>
|
||||||
|
<li>Exierant elisi ambit vivere dedere</li>
|
||||||
|
<li>Duce pollice</li>
|
||||||
|
<li>Eris modo</li>
|
||||||
|
<li>Spargitque ferrea quos palude</li>
|
||||||
|
</ol>
|
||||||
|
<p>Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis.</p>
|
||||||
|
<ol>
|
||||||
|
<li>Comas hunc haec pietate fetum procerum dixit</li>
|
||||||
|
<li>Post torum vates letum Tiresia</li>
|
||||||
|
<li>Flumen querellas</li>
|
||||||
|
<li>Arcanaque montibus omnes</li>
|
||||||
|
<li>Quidem et</li>
|
||||||
|
</ol>
|
||||||
|
<h1 id="vagus-elidunt">Vagus elidunt <a href="#vagus-elidunt" class="anchor">🔗</a></h1><p><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
|
||||||
|
<p><a href="https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon">The Van de Graaf Canon</a></p>
|
||||||
|
<h2 id="mane-refeci-capiebant-unda-mulcebat">Mane refeci capiebant unda mulcebat <a href="#mane-refeci-capiebant-unda-mulcebat" class="anchor">🔗</a></h2><p>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. <strong>Faces illo pepulere</strong> tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<p>Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel <strong>mitis temploque</strong> vocatus, inque alis, <em>oculos nomen</em> 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 <strong>parte</strong>.</p></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>Math Typesetting</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/math-typesetting/</link>
|
||||||
|
<pubDate>Fri, 08 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/math-typesetting/</guid>
|
||||||
|
<description><p>Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.</p>
|
||||||
|
<p>In this example we will be using <a href="https://katex.org/">KaTeX</a></p>
|
||||||
|
<ul>
|
||||||
|
<li>Create a partial under <code>/layouts/partials/math.html</code></li>
|
||||||
|
<li>Within this partial reference the <a href="https://katex.org/docs/autorender.html">Auto-render Extension</a> or host these scripts locally.</li>
|
||||||
|
<li>Include the partial in your templates like so:</li>
|
||||||
|
</ul>
|
||||||
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="o">{{</span> <span class="k">if</span> or .Params.math .Site.Params.math <span class="o">}}</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="o">{{</span> partial <span class="s2">&#34;math.html&#34;</span> . <span class="o">}}</span>
|
||||||
|
</span></span><span class="line"><span class="cl"><span class="o">{{</span> end <span class="o">}}</span>
|
||||||
|
</span></span></code></pre></div><ul>
|
||||||
|
<li>To enable KaTex globally set the parameter <code>math</code> to <code>true</code> in a project&rsquo;s configuration</li>
|
||||||
|
<li>To enable KaTex on a per page basis include the parameter <code>math: true</code> in content files</li>
|
||||||
|
</ul>
|
||||||
|
<p><strong>Note:</strong> Use the online reference of <a href="https://katex.org/docs/supported.html">Supported TeX Functions</a></p>
|
||||||
|
|
||||||
|
<h3 id="examples">Examples <a href="#examples" class="anchor">🔗</a></h3>
|
||||||
|
<p>Block math:
|
||||||
|
$$
|
||||||
|
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
|
||||||
|
$$</p></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<title>Emoji Support</title>
|
||||||
|
<link>https://leafee98.github.io/hugo-theme-flat/posts/emoji-support/</link>
|
||||||
|
<pubDate>Tue, 05 Mar 2019 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
|
<guid>https://leafee98.github.io/hugo-theme-flat/posts/emoji-support/</guid>
|
||||||
|
<description><p>Emoji can be enabled in a Hugo project in a number of ways.</p>
|
||||||
|
<p>The <a href="https://gohugo.io/functions/emojify/"><code>emojify</code></a> function can be called directly in templates or <a href="https://gohugo.io/templates/shortcode-templates/#inline-shortcodes">Inline Shortcodes</a>.</p>
|
||||||
|
<p>To enable emoji globally, set <code>enableEmoji</code> to <code>true</code> in your site&rsquo;s <a href="https://gohugo.io/getting-started/configuration/">configuration</a> and then you can type emoji shorthand codes directly in content files; e.g.</p>
|
||||||
|
<!-- raw HTML omitted -->
|
||||||
|
<p>The <a href="http://www.emoji-cheat-sheet.com/">Emoji cheat sheet</a> is a useful reference for emoji shorthand codes.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>N.B.</strong> 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.</p>
|
||||||
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl">.emoji {
|
||||||
|
</span></span><span class="line"><span class="cl"> font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
|
||||||
|
</span></span><span class="line"><span class="cl">}</span></span></code></pre></div></description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
</rss>
|
3
js/mermaid-9.0.0.min.js
vendored
Normal file
3
js/mermaid-9.0.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
96
lib/icofont/demo.html
Normal file
96
lib/icofont/demo.html
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Examples | IcoFont</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="./icofont.min.css">
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background: #F6F6F9;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
border-bottom: 1px solid #DCDCE1;
|
||||||
|
padding: 10px 0;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
width: 980px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.ico-title {
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
.iconlist {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.iconlist li {
|
||||||
|
position: relative;
|
||||||
|
margin: 5px;
|
||||||
|
width: 150px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder {
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid #E4E5EA;
|
||||||
|
transition: all 0.2s linear 0s;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder:hover {
|
||||||
|
background: #00C3DA;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder:hover .icon i {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder .icon {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder .icon i {
|
||||||
|
font-size: 3em;
|
||||||
|
color: #1F1142;
|
||||||
|
}
|
||||||
|
.iconlist li .icon-holder span {
|
||||||
|
font-size: 14px;
|
||||||
|
display: block;
|
||||||
|
margin-top: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="header">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="ico-title"> IcoFont Icons </h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<ul class="iconlist">
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="icon-holder">
|
||||||
|
<div class="icon">
|
||||||
|
<i class="icofont-rss"></i>
|
||||||
|
</div>
|
||||||
|
<span> rss </span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
BIN
lib/icofont/fonts/icofont.eot
Normal file
BIN
lib/icofont/fonts/icofont.eot
Normal file
Binary file not shown.
11
lib/icofont/fonts/icofont.svg
Normal file
11
lib/icofont/fonts/icofont.svg
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<defs>
|
||||||
|
<font id="icofont" horiz-adv-x="1000" >
|
||||||
|
<font-face font-family="IcoFont" font-weight="400" font-style="Regular" units-per-em="1000" ascent="850" descent="-150" />
|
||||||
|
<missing-glyph horiz-adv-x="1000" />
|
||||||
|
<glyph glyph-name="rss" horiz-adv-x="1000" unicode="" d="M64 323c109 0 212-43 288-120 77-78 120-181 120-290h168c0 318-258 577-576 577l0-167z m1 297c388 0 703-317 703-707h168c0 482-391 875-871 875l0-168z m232-590c0-65-52-117-117-117-64 0-116 52-116 117s52 116 116 116c65 0 117-52 117-116z" />
|
||||||
|
</font>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 707 B |
BIN
lib/icofont/fonts/icofont.ttf
Normal file
BIN
lib/icofont/fonts/icofont.ttf
Normal file
Binary file not shown.
BIN
lib/icofont/fonts/icofont.woff
Normal file
BIN
lib/icofont/fonts/icofont.woff
Normal file
Binary file not shown.
BIN
lib/icofont/fonts/icofont.woff2
Normal file
BIN
lib/icofont/fonts/icofont.woff2
Normal file
Binary file not shown.
287
lib/icofont/icofont.css
Normal file
287
lib/icofont/icofont.css
Normal file
|
@ -0,0 +1,287 @@
|
||||||
|
/*!
|
||||||
|
* @package IcoFont
|
||||||
|
* @version 1.0.1
|
||||||
|
* @author IcoFont https://icofont.com
|
||||||
|
* @copyright Copyright (c) 2015 - 2022 IcoFont
|
||||||
|
* @license - https://icofont.com/license/
|
||||||
|
*/
|
||||||
|
|
||||||
|
@font-face
|
||||||
|
{
|
||||||
|
|
||||||
|
font-family: "IcoFont";
|
||||||
|
font-weight: normal;
|
||||||
|
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: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
text-transform: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
word-wrap: normal;
|
||||||
|
direction: ltr;
|
||||||
|
line-height: 1;
|
||||||
|
/* Better Font Rendering =========== */
|
||||||
|
-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 0.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(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100%
|
||||||
|
{
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes icofont-spin
|
||||||
|
{
|
||||||
|
0%
|
||||||
|
{
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100%
|
||||||
|
{
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-rotate-90
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
|
||||||
|
-webkit-transform: rotate(90deg);
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-rotate-180
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
|
||||||
|
-webkit-transform: rotate(180deg);
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-rotate-270
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
|
||||||
|
-webkit-transform: rotate(270deg);
|
||||||
|
transform: rotate(270deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-flip-horizontal
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
|
||||||
|
-webkit-transform: scale(-1, 1);
|
||||||
|
transform: scale(-1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-flip-vertical
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
|
||||||
|
-webkit-transform: scale(1, -1);
|
||||||
|
transform: scale(1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icofont-flip-horizontal.icofont-flip-vertical
|
||||||
|
{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
|
||||||
|
-webkit-transform: scale(-1, -1);
|
||||||
|
transform: scale(-1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
:root .icofont-rotate-90,
|
||||||
|
:root .icofont-rotate-180,
|
||||||
|
:root .icofont-rotate-270,
|
||||||
|
:root .icofont-flip-horizontal,
|
||||||
|
:root .icofont-flip-vertical
|
||||||
|
{
|
||||||
|
-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;
|
||||||
|
}
|
||||||
|
|
7
lib/icofont/icofont.min.css
vendored
Normal file
7
lib/icofont/icofont.min.css
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/*!
|
||||||
|
* @package IcoFont
|
||||||
|
* @version 1.0.1
|
||||||
|
* @author IcoFont https://icofont.com
|
||||||
|
* @copyright Copyright (c) 2015 - 2022 IcoFont
|
||||||
|
* @license - https://icofont.com/license/
|
||||||
|
*/@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}
|
119
lib/katex/README.md
Normal file
119
lib/katex/README.md
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
|
||||||
|
[![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
|
||||||
|
[![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)
|
||||||
|
[![CI](https://github.com/KaTeX/KaTeX/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
|
||||||
|
[![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/main/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX)
|
||||||
|
[![Discussions](https://img.shields.io/badge/Discussions-join-brightgreen)](https://github.com/KaTeX/KaTeX/discussions)
|
||||||
|
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
|
||||||
|
![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip)
|
||||||
|
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX)
|
||||||
|
[![Financial Contributors on Open Collective](https://opencollective.com/katex/all/badge.svg?label=financial+contributors)](https://opencollective.com/katex)
|
||||||
|
|
||||||
|
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
||||||
|
|
||||||
|
* **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).
|
||||||
|
* **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
|
||||||
|
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
|
||||||
|
* **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.
|
||||||
|
|
||||||
|
KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11.
|
||||||
|
|
||||||
|
KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).
|
||||||
|
|
||||||
|
Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
### Starter template
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/katex.min.css" integrity="sha384-bYdxxUwYipFNohQlHt0bjN/LCpueqWz13HufFEV1SUatKs1cm4L6fFgCi1jT643X" crossorigin="anonymous">
|
||||||
|
|
||||||
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/katex.min.js" integrity="sha384-Qsn9KnoKISj6dI8g7p1HBlNpVx0I8p1SvlwOldgi3IorMle61nQy4zEahWYtljaz" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
|
||||||
|
onload="renderMathInElement(document.body);"></script>
|
||||||
|
</head>
|
||||||
|
...
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.
|
||||||
|
|
||||||
|
For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
Call `katex.render` to render a TeX expression directly into a DOM element.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
|
||||||
|
throwOnError: false
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Call `katex.renderToString` to generate an HTML string of the rendered math,
|
||||||
|
e.g., for server-side rendering. For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
|
||||||
|
throwOnError: false
|
||||||
|
});
|
||||||
|
// '<span class="katex">...</span>'
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to include the CSS and font files in both cases.
|
||||||
|
If you are doing all rendering on the server, there is no need to include the
|
||||||
|
JavaScript on the client.
|
||||||
|
|
||||||
|
The examples above use the `throwOnError: false` option, which renders invalid
|
||||||
|
inputs as the TeX source code in red (by default), with the error message as
|
||||||
|
hover text. For other available options, see the
|
||||||
|
[API documentation](https://katex.org/docs/api.html),
|
||||||
|
[options documentation](https://katex.org/docs/options.html), and
|
||||||
|
[handling errors documentation](https://katex.org/docs/error.html).
|
||||||
|
|
||||||
|
## Demo and Documentation
|
||||||
|
|
||||||
|
Learn more about using KaTeX [on the website](https://katex.org)!
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
### Code Contributors
|
||||||
|
|
||||||
|
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).
|
||||||
|
<a href="https://github.com/KaTeX/KaTeX/graphs/contributors"><img src="https://contributors-svg.opencollective.com/katex/contributors.svg?width=890&button=false" alt="Code contributors" /></a>
|
||||||
|
|
||||||
|
### Financial Contributors
|
||||||
|
|
||||||
|
Become a financial contributor and help us sustain our community.
|
||||||
|
|
||||||
|
#### Individuals
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/katex"><img src="https://opencollective.com/katex/individuals.svg?width=890" alt="Contribute on Open Collective"></a>
|
||||||
|
|
||||||
|
#### Organizations
|
||||||
|
|
||||||
|
Support this project with your organization. Your logo will show up here with a link to your website.
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg" alt="Organization 1"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg" alt="Organization 2"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/2/website"><img src="https://opencollective.com/katex/organization/2/avatar.svg" alt="Organization 3"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/3/website"><img src="https://opencollective.com/katex/organization/3/avatar.svg" alt="Organization 4"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/4/website"><img src="https://opencollective.com/katex/organization/4/avatar.svg" alt="Organization 5"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/5/website"><img src="https://opencollective.com/katex/organization/5/avatar.svg" alt="Organization 6"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/6/website"><img src="https://opencollective.com/katex/organization/6/avatar.svg" alt="Organization 7"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/7/website"><img src="https://opencollective.com/katex/organization/7/avatar.svg" alt="Organization 8"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/8/website"><img src="https://opencollective.com/katex/organization/8/avatar.svg" alt="Organization 9"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/9/website"><img src="https://opencollective.com/katex/organization/9/avatar.svg" alt="Organization 10"></a>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
349
lib/katex/contrib/auto-render.js
Normal file
349
lib/katex/contrib/auto-render.js
Normal file
|
@ -0,0 +1,349 @@
|
||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("katex"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["katex"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["renderMathInElement"] = factory(require("katex"));
|
||||||
|
else
|
||||||
|
root["renderMathInElement"] = factory(root["katex"]);
|
||||||
|
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
|
||||||
|
return /******/ (function() { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 771:
|
||||||
|
/***/ (function(module) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function() { return module['default']; } :
|
||||||
|
/******/ function() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, definition) {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
var __webpack_exports__ = {};
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||||
|
!function() {
|
||||||
|
|
||||||
|
// EXPORTS
|
||||||
|
__webpack_require__.d(__webpack_exports__, {
|
||||||
|
"default": function() { return /* binding */ auto_render; }
|
||||||
|
});
|
||||||
|
|
||||||
|
// EXTERNAL MODULE: external "katex"
|
||||||
|
var external_katex_ = __webpack_require__(771);
|
||||||
|
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
|
||||||
|
;// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
|
||||||
|
/* eslint no-constant-condition:0 */
|
||||||
|
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
|
||||||
|
// Adapted from
|
||||||
|
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
|
||||||
|
var index = startIndex;
|
||||||
|
var braceLevel = 0;
|
||||||
|
var delimLength = delimiter.length;
|
||||||
|
|
||||||
|
while (index < text.length) {
|
||||||
|
var character = text[index];
|
||||||
|
|
||||||
|
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
|
||||||
|
return index;
|
||||||
|
} else if (character === "\\") {
|
||||||
|
index++;
|
||||||
|
} else if (character === "{") {
|
||||||
|
braceLevel++;
|
||||||
|
} else if (character === "}") {
|
||||||
|
braceLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
var escapeRegex = function escapeRegex(string) {
|
||||||
|
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
||||||
|
};
|
||||||
|
|
||||||
|
var amsRegex = /^\\begin{/;
|
||||||
|
|
||||||
|
var splitAtDelimiters = function splitAtDelimiters(text, delimiters) {
|
||||||
|
var index;
|
||||||
|
var data = [];
|
||||||
|
var regexLeft = new RegExp("(" + delimiters.map(function (x) {
|
||||||
|
return escapeRegex(x.left);
|
||||||
|
}).join("|") + ")");
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
index = text.search(regexLeft);
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index > 0) {
|
||||||
|
data.push({
|
||||||
|
type: "text",
|
||||||
|
data: text.slice(0, index)
|
||||||
|
});
|
||||||
|
text = text.slice(index); // now text starts with delimiter
|
||||||
|
} // ... so this always succeeds:
|
||||||
|
|
||||||
|
|
||||||
|
var i = delimiters.findIndex(function (delim) {
|
||||||
|
return text.startsWith(delim.left);
|
||||||
|
});
|
||||||
|
index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rawData = text.slice(0, index + delimiters[i].right.length);
|
||||||
|
var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
|
||||||
|
data.push({
|
||||||
|
type: "math",
|
||||||
|
data: math,
|
||||||
|
rawData: rawData,
|
||||||
|
display: delimiters[i].display
|
||||||
|
});
|
||||||
|
text = text.slice(index + delimiters[i].right.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text !== "") {
|
||||||
|
data.push({
|
||||||
|
type: "text",
|
||||||
|
data: text
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
|
||||||
|
;// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js
|
||||||
|
/* eslint no-console:0 */
|
||||||
|
|
||||||
|
|
||||||
|
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
|
||||||
|
* API, we should copy it before mutating.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var renderMathInText = function renderMathInText(text, optionsCopy) {
|
||||||
|
var data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters);
|
||||||
|
|
||||||
|
if (data.length === 1 && data[0].type === 'text') {
|
||||||
|
// There is no formula in the text.
|
||||||
|
// Let's return null which means there is no need to replace
|
||||||
|
// the current text node with a new one.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data[i].type === "text") {
|
||||||
|
fragment.appendChild(document.createTextNode(data[i].data));
|
||||||
|
} else {
|
||||||
|
var span = document.createElement("span");
|
||||||
|
var math = data[i].data; // Override any display mode defined in the settings with that
|
||||||
|
// defined by the text itself
|
||||||
|
|
||||||
|
optionsCopy.displayMode = data[i].display;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (optionsCopy.preProcess) {
|
||||||
|
math = optionsCopy.preProcess(math);
|
||||||
|
}
|
||||||
|
|
||||||
|
external_katex_default().render(math, span, optionsCopy);
|
||||||
|
} catch (e) {
|
||||||
|
if (!(e instanceof (external_katex_default()).ParseError)) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
|
||||||
|
fragment.appendChild(document.createTextNode(data[i].rawData));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment.appendChild(span);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderElem = function renderElem(elem, optionsCopy) {
|
||||||
|
for (var i = 0; i < elem.childNodes.length; i++) {
|
||||||
|
var childNode = elem.childNodes[i];
|
||||||
|
|
||||||
|
if (childNode.nodeType === 3) {
|
||||||
|
// Text node
|
||||||
|
// Concatenate all sibling text nodes.
|
||||||
|
// Webkit browsers split very large text nodes into smaller ones,
|
||||||
|
// so the delimiters may be split across different nodes.
|
||||||
|
var textContentConcat = childNode.textContent;
|
||||||
|
var sibling = childNode.nextSibling;
|
||||||
|
var nSiblings = 0;
|
||||||
|
|
||||||
|
while (sibling && sibling.nodeType === Node.TEXT_NODE) {
|
||||||
|
textContentConcat += sibling.textContent;
|
||||||
|
sibling = sibling.nextSibling;
|
||||||
|
nSiblings++;
|
||||||
|
}
|
||||||
|
|
||||||
|
var frag = renderMathInText(textContentConcat, optionsCopy);
|
||||||
|
|
||||||
|
if (frag) {
|
||||||
|
// Remove extra text nodes
|
||||||
|
for (var j = 0; j < nSiblings; j++) {
|
||||||
|
childNode.nextSibling.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
i += frag.childNodes.length - 1;
|
||||||
|
elem.replaceChild(frag, childNode);
|
||||||
|
} else {
|
||||||
|
// If the concatenated text does not contain math
|
||||||
|
// the siblings will not either
|
||||||
|
i += nSiblings;
|
||||||
|
}
|
||||||
|
} else if (childNode.nodeType === 1) {
|
||||||
|
(function () {
|
||||||
|
// Element node
|
||||||
|
var className = ' ' + childNode.className + ' ';
|
||||||
|
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) {
|
||||||
|
return className.indexOf(' ' + x + ' ') === -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (shouldRender) {
|
||||||
|
renderElem(childNode, optionsCopy);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
} // Otherwise, it's something else, and ignore it.
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderMathInElement = function renderMathInElement(elem, options) {
|
||||||
|
if (!elem) {
|
||||||
|
throw new Error("No element provided to render");
|
||||||
|
}
|
||||||
|
|
||||||
|
var optionsCopy = {}; // Object.assign(optionsCopy, option)
|
||||||
|
|
||||||
|
for (var option in options) {
|
||||||
|
if (options.hasOwnProperty(option)) {
|
||||||
|
optionsCopy[option] = options[option];
|
||||||
|
}
|
||||||
|
} // default options
|
||||||
|
|
||||||
|
|
||||||
|
optionsCopy.delimiters = optionsCopy.delimiters || [{
|
||||||
|
left: "$$",
|
||||||
|
right: "$$",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\(",
|
||||||
|
right: "\\)",
|
||||||
|
display: false
|
||||||
|
}, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
|
||||||
|
// {left: "$", right: "$", display: false},
|
||||||
|
// $ must come after $$
|
||||||
|
// Render AMS environments even if outside $$…$$ delimiters.
|
||||||
|
{
|
||||||
|
left: "\\begin{equation}",
|
||||||
|
right: "\\end{equation}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{align}",
|
||||||
|
right: "\\end{align}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{alignat}",
|
||||||
|
right: "\\end{alignat}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{gather}",
|
||||||
|
right: "\\end{gather}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{CD}",
|
||||||
|
right: "\\end{CD}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\[",
|
||||||
|
right: "\\]",
|
||||||
|
display: true
|
||||||
|
}];
|
||||||
|
optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"];
|
||||||
|
optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
|
||||||
|
optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
|
||||||
|
// math elements within a single call to `renderMathInElement`.
|
||||||
|
|
||||||
|
optionsCopy.macros = optionsCopy.macros || {};
|
||||||
|
renderElem(elem, optionsCopy);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ var auto_render = (renderMathInElement);
|
||||||
|
}();
|
||||||
|
__webpack_exports__ = __webpack_exports__["default"];
|
||||||
|
/******/ return __webpack_exports__;
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
});
|
1
lib/katex/contrib/auto-render.min.js
vendored
Normal file
1
lib/katex/contrib/auto-render.min.js
vendored
Normal file
|
@ -0,0 +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;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(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<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
|
244
lib/katex/contrib/auto-render.mjs
Normal file
244
lib/katex/contrib/auto-render.mjs
Normal file
|
@ -0,0 +1,244 @@
|
||||||
|
import katex from '../katex.mjs';
|
||||||
|
|
||||||
|
/* eslint no-constant-condition:0 */
|
||||||
|
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
|
||||||
|
// Adapted from
|
||||||
|
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
|
||||||
|
var index = startIndex;
|
||||||
|
var braceLevel = 0;
|
||||||
|
var delimLength = delimiter.length;
|
||||||
|
|
||||||
|
while (index < text.length) {
|
||||||
|
var character = text[index];
|
||||||
|
|
||||||
|
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
|
||||||
|
return index;
|
||||||
|
} else if (character === "\\") {
|
||||||
|
index++;
|
||||||
|
} else if (character === "{") {
|
||||||
|
braceLevel++;
|
||||||
|
} else if (character === "}") {
|
||||||
|
braceLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
var escapeRegex = function escapeRegex(string) {
|
||||||
|
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
||||||
|
};
|
||||||
|
|
||||||
|
var amsRegex = /^\\begin{/;
|
||||||
|
|
||||||
|
var splitAtDelimiters = function splitAtDelimiters(text, delimiters) {
|
||||||
|
var index;
|
||||||
|
var data = [];
|
||||||
|
var regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
index = text.search(regexLeft);
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index > 0) {
|
||||||
|
data.push({
|
||||||
|
type: "text",
|
||||||
|
data: text.slice(0, index)
|
||||||
|
});
|
||||||
|
text = text.slice(index); // now text starts with delimiter
|
||||||
|
} // ... so this always succeeds:
|
||||||
|
|
||||||
|
|
||||||
|
var i = delimiters.findIndex(delim => text.startsWith(delim.left));
|
||||||
|
index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rawData = text.slice(0, index + delimiters[i].right.length);
|
||||||
|
var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
|
||||||
|
data.push({
|
||||||
|
type: "math",
|
||||||
|
data: math,
|
||||||
|
rawData,
|
||||||
|
display: delimiters[i].display
|
||||||
|
});
|
||||||
|
text = text.slice(index + delimiters[i].right.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text !== "") {
|
||||||
|
data.push({
|
||||||
|
type: "text",
|
||||||
|
data: text
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* eslint no-console:0 */
|
||||||
|
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
|
||||||
|
* API, we should copy it before mutating.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var renderMathInText = function renderMathInText(text, optionsCopy) {
|
||||||
|
var data = splitAtDelimiters(text, optionsCopy.delimiters);
|
||||||
|
|
||||||
|
if (data.length === 1 && data[0].type === 'text') {
|
||||||
|
// There is no formula in the text.
|
||||||
|
// Let's return null which means there is no need to replace
|
||||||
|
// the current text node with a new one.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data[i].type === "text") {
|
||||||
|
fragment.appendChild(document.createTextNode(data[i].data));
|
||||||
|
} else {
|
||||||
|
var span = document.createElement("span");
|
||||||
|
var math = data[i].data; // Override any display mode defined in the settings with that
|
||||||
|
// defined by the text itself
|
||||||
|
|
||||||
|
optionsCopy.displayMode = data[i].display;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (optionsCopy.preProcess) {
|
||||||
|
math = optionsCopy.preProcess(math);
|
||||||
|
}
|
||||||
|
|
||||||
|
katex.render(math, span, optionsCopy);
|
||||||
|
} catch (e) {
|
||||||
|
if (!(e instanceof katex.ParseError)) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
|
||||||
|
fragment.appendChild(document.createTextNode(data[i].rawData));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment.appendChild(span);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderElem = function renderElem(elem, optionsCopy) {
|
||||||
|
for (var i = 0; i < elem.childNodes.length; i++) {
|
||||||
|
var childNode = elem.childNodes[i];
|
||||||
|
|
||||||
|
if (childNode.nodeType === 3) {
|
||||||
|
// Text node
|
||||||
|
// Concatenate all sibling text nodes.
|
||||||
|
// Webkit browsers split very large text nodes into smaller ones,
|
||||||
|
// so the delimiters may be split across different nodes.
|
||||||
|
var textContentConcat = childNode.textContent;
|
||||||
|
var sibling = childNode.nextSibling;
|
||||||
|
var nSiblings = 0;
|
||||||
|
|
||||||
|
while (sibling && sibling.nodeType === Node.TEXT_NODE) {
|
||||||
|
textContentConcat += sibling.textContent;
|
||||||
|
sibling = sibling.nextSibling;
|
||||||
|
nSiblings++;
|
||||||
|
}
|
||||||
|
|
||||||
|
var frag = renderMathInText(textContentConcat, optionsCopy);
|
||||||
|
|
||||||
|
if (frag) {
|
||||||
|
// Remove extra text nodes
|
||||||
|
for (var j = 0; j < nSiblings; j++) {
|
||||||
|
childNode.nextSibling.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
i += frag.childNodes.length - 1;
|
||||||
|
elem.replaceChild(frag, childNode);
|
||||||
|
} else {
|
||||||
|
// If the concatenated text does not contain math
|
||||||
|
// the siblings will not either
|
||||||
|
i += nSiblings;
|
||||||
|
}
|
||||||
|
} else if (childNode.nodeType === 1) {
|
||||||
|
(function () {
|
||||||
|
// Element node
|
||||||
|
var className = ' ' + childNode.className + ' ';
|
||||||
|
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1);
|
||||||
|
|
||||||
|
if (shouldRender) {
|
||||||
|
renderElem(childNode, optionsCopy);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
} // Otherwise, it's something else, and ignore it.
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderMathInElement = function renderMathInElement(elem, options) {
|
||||||
|
if (!elem) {
|
||||||
|
throw new Error("No element provided to render");
|
||||||
|
}
|
||||||
|
|
||||||
|
var optionsCopy = {}; // Object.assign(optionsCopy, option)
|
||||||
|
|
||||||
|
for (var option in options) {
|
||||||
|
if (options.hasOwnProperty(option)) {
|
||||||
|
optionsCopy[option] = options[option];
|
||||||
|
}
|
||||||
|
} // default options
|
||||||
|
|
||||||
|
|
||||||
|
optionsCopy.delimiters = optionsCopy.delimiters || [{
|
||||||
|
left: "$$",
|
||||||
|
right: "$$",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\(",
|
||||||
|
right: "\\)",
|
||||||
|
display: false
|
||||||
|
}, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
|
||||||
|
// {left: "$", right: "$", display: false},
|
||||||
|
// $ must come after $$
|
||||||
|
// Render AMS environments even if outside $$…$$ delimiters.
|
||||||
|
{
|
||||||
|
left: "\\begin{equation}",
|
||||||
|
right: "\\end{equation}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{align}",
|
||||||
|
right: "\\end{align}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{alignat}",
|
||||||
|
right: "\\end{alignat}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{gather}",
|
||||||
|
right: "\\end{gather}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\begin{CD}",
|
||||||
|
right: "\\end{CD}",
|
||||||
|
display: true
|
||||||
|
}, {
|
||||||
|
left: "\\[",
|
||||||
|
right: "\\]",
|
||||||
|
display: true
|
||||||
|
}];
|
||||||
|
optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"];
|
||||||
|
optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
|
||||||
|
optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
|
||||||
|
// math elements within a single call to `renderMathInElement`.
|
||||||
|
|
||||||
|
optionsCopy.macros = optionsCopy.macros || {};
|
||||||
|
renderElem(elem, optionsCopy);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { renderMathInElement as default };
|
130
lib/katex/contrib/copy-tex.js
Normal file
130
lib/katex/contrib/copy-tex.js
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory();
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define([], factory);
|
||||||
|
else {
|
||||||
|
var a = factory();
|
||||||
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||||
|
}
|
||||||
|
})((typeof self !== 'undefined' ? self : this), function() {
|
||||||
|
return /******/ (function() { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
var __webpack_exports__ = {};
|
||||||
|
|
||||||
|
;// CONCATENATED MODULE: ./contrib/copy-tex/katex2tex.js
|
||||||
|
// Set these to how you want inline and display math to be delimited.
|
||||||
|
var defaultCopyDelimiters = {
|
||||||
|
inline: ['$', '$'],
|
||||||
|
// alternative: ['\(', '\)']
|
||||||
|
display: ['$$', '$$'] // alternative: ['\[', '\]']
|
||||||
|
|
||||||
|
}; // Replace .katex elements with their TeX source (<annotation> element).
|
||||||
|
// Modifies fragment in-place. Useful for writing your own 'copy' handler,
|
||||||
|
// as in copy-tex.js.
|
||||||
|
|
||||||
|
function katexReplaceWithTex(fragment, copyDelimiters) {
|
||||||
|
if (copyDelimiters === void 0) {
|
||||||
|
copyDelimiters = defaultCopyDelimiters;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove .katex-html blocks that are preceded by .katex-mathml blocks
|
||||||
|
// (which will get replaced below).
|
||||||
|
var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
|
||||||
|
|
||||||
|
for (var i = 0; i < katexHtml.length; i++) {
|
||||||
|
var element = katexHtml[i];
|
||||||
|
|
||||||
|
if (element.remove) {
|
||||||
|
element.remove();
|
||||||
|
} else if (element.parentNode) {
|
||||||
|
element.parentNode.removeChild(element);
|
||||||
|
}
|
||||||
|
} // Replace .katex-mathml elements with their annotation (TeX source)
|
||||||
|
// descendant, with inline delimiters.
|
||||||
|
|
||||||
|
|
||||||
|
var katexMathml = fragment.querySelectorAll('.katex-mathml');
|
||||||
|
|
||||||
|
for (var _i = 0; _i < katexMathml.length; _i++) {
|
||||||
|
var _element = katexMathml[_i];
|
||||||
|
|
||||||
|
var texSource = _element.querySelector('annotation');
|
||||||
|
|
||||||
|
if (texSource) {
|
||||||
|
if (_element.replaceWith) {
|
||||||
|
_element.replaceWith(texSource);
|
||||||
|
} else if (_element.parentNode) {
|
||||||
|
_element.parentNode.replaceChild(texSource, _element);
|
||||||
|
}
|
||||||
|
|
||||||
|
texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1];
|
||||||
|
}
|
||||||
|
} // Switch display math to display delimiters.
|
||||||
|
|
||||||
|
|
||||||
|
var displays = fragment.querySelectorAll('.katex-display annotation');
|
||||||
|
|
||||||
|
for (var _i2 = 0; _i2 < displays.length; _i2++) {
|
||||||
|
var _element2 = displays[_i2];
|
||||||
|
_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];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
/* harmony default export */ var katex2tex = (katexReplaceWithTex);
|
||||||
|
;// CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.js
|
||||||
|
// Return <div class="katex"> element containing node, or null if not found.
|
||||||
|
|
||||||
|
function closestKatex(node) {
|
||||||
|
// If node is a Text Node, for example, go up to containing Element,
|
||||||
|
// where we can apply the `closest` method.
|
||||||
|
var element = node instanceof Element ? node : node.parentElement;
|
||||||
|
return element && element.closest('.katex');
|
||||||
|
} // Global copy handler to modify behavior on/within .katex elements.
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('copy', function (event) {
|
||||||
|
var selection = window.getSelection();
|
||||||
|
|
||||||
|
if (selection.isCollapsed || !event.clipboardData) {
|
||||||
|
return; // default action OK if selection is empty or unchangeable
|
||||||
|
}
|
||||||
|
|
||||||
|
var clipboardData = event.clipboardData;
|
||||||
|
var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
|
||||||
|
|
||||||
|
var startKatex = closestKatex(range.startContainer);
|
||||||
|
|
||||||
|
if (startKatex) {
|
||||||
|
range.setStartBefore(startKatex);
|
||||||
|
} // Similarly, when end point is within a formula, expand to entire formula.
|
||||||
|
|
||||||
|
|
||||||
|
var endKatex = closestKatex(range.endContainer);
|
||||||
|
|
||||||
|
if (endKatex) {
|
||||||
|
range.setEndAfter(endKatex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var fragment = range.cloneContents();
|
||||||
|
|
||||||
|
if (!fragment.querySelector('.katex-mathml')) {
|
||||||
|
return; // default action OK if no .katex-mathml elements
|
||||||
|
}
|
||||||
|
|
||||||
|
var htmlContents = Array.prototype.map.call(fragment.childNodes, function (el) {
|
||||||
|
return el instanceof Text ? el.textContent : el.outerHTML;
|
||||||
|
}).join(''); // Preserve usual HTML copy/paste behavior.
|
||||||
|
|
||||||
|
clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.
|
||||||
|
|
||||||
|
clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling.
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
__webpack_exports__ = __webpack_exports__["default"];
|
||||||
|
/******/ return __webpack_exports__;
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
});
|
1
lib/katex/contrib/copy-tex.min.js
vendored
Normal file
1
lib/katex/contrib/copy-tex.min.js
vendored
Normal file
|
@ -0,0 +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;a<r.length;a++){var o=r[a];o.remove?o.remove():o.parentNode&&o.parentNode.removeChild(o)}for(var i=e.querySelectorAll(".katex-mathml"),l=0;l<i.length;l++){var f=i[l],c=f.querySelector("annotation");c&&(f.replaceWith?f.replaceWith(c):f.parentNode&&f.parentNode.replaceChild(c,f),c.innerHTML=n.inline[0]+c.innerHTML+n.inline[1])}for(var d=e.querySelectorAll(".katex-display annotation"),s=0;s<d.length;s++){var p=d[s];p.innerHTML=n.display[0]+p.innerHTML.substr(n.inline[0].length,p.innerHTML.length-n.inline[0].length-n.inline[1].length)+n.display[1]}return e};function r(e){var t=e instanceof Element?e:e.parentElement;return t&&t.closest(".katex")}return document.addEventListener("copy",(function(e){var t=window.getSelection();if(!t.isCollapsed&&e.clipboardData){var a=e.clipboardData,o=t.getRangeAt(0),i=r(o.startContainer);i&&o.setStartBefore(i);var l=r(o.endContainer);l&&o.setEndAfter(l);var f=o.cloneContents();if(f.querySelector(".katex-mathml")){var c=Array.prototype.map.call(f.childNodes,(function(e){return e instanceof Text?e.textContent:e.outerHTML})).join("");a.setData("text/html",c),a.setData("text/plain",n(f).textContent),e.preventDefault()}}})),e=e.default}()}));
|
105
lib/katex/contrib/copy-tex.mjs
Normal file
105
lib/katex/contrib/copy-tex.mjs
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
// Set these to how you want inline and display math to be delimited.
|
||||||
|
var defaultCopyDelimiters = {
|
||||||
|
inline: ['$', '$'],
|
||||||
|
// alternative: ['\(', '\)']
|
||||||
|
display: ['$$', '$$'] // alternative: ['\[', '\]']
|
||||||
|
|
||||||
|
}; // Replace .katex elements with their TeX source (<annotation> element).
|
||||||
|
// Modifies fragment in-place. Useful for writing your own 'copy' handler,
|
||||||
|
// as in copy-tex.js.
|
||||||
|
|
||||||
|
function katexReplaceWithTex(fragment, copyDelimiters) {
|
||||||
|
if (copyDelimiters === void 0) {
|
||||||
|
copyDelimiters = defaultCopyDelimiters;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove .katex-html blocks that are preceded by .katex-mathml blocks
|
||||||
|
// (which will get replaced below).
|
||||||
|
var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
|
||||||
|
|
||||||
|
for (var i = 0; i < katexHtml.length; i++) {
|
||||||
|
var element = katexHtml[i];
|
||||||
|
|
||||||
|
if (element.remove) {
|
||||||
|
element.remove();
|
||||||
|
} else if (element.parentNode) {
|
||||||
|
element.parentNode.removeChild(element);
|
||||||
|
}
|
||||||
|
} // Replace .katex-mathml elements with their annotation (TeX source)
|
||||||
|
// descendant, with inline delimiters.
|
||||||
|
|
||||||
|
|
||||||
|
var katexMathml = fragment.querySelectorAll('.katex-mathml');
|
||||||
|
|
||||||
|
for (var _i = 0; _i < katexMathml.length; _i++) {
|
||||||
|
var _element = katexMathml[_i];
|
||||||
|
|
||||||
|
var texSource = _element.querySelector('annotation');
|
||||||
|
|
||||||
|
if (texSource) {
|
||||||
|
if (_element.replaceWith) {
|
||||||
|
_element.replaceWith(texSource);
|
||||||
|
} else if (_element.parentNode) {
|
||||||
|
_element.parentNode.replaceChild(texSource, _element);
|
||||||
|
}
|
||||||
|
|
||||||
|
texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1];
|
||||||
|
}
|
||||||
|
} // Switch display math to display delimiters.
|
||||||
|
|
||||||
|
|
||||||
|
var displays = fragment.querySelectorAll('.katex-display annotation');
|
||||||
|
|
||||||
|
for (var _i2 = 0; _i2 < displays.length; _i2++) {
|
||||||
|
var _element2 = displays[_i2];
|
||||||
|
_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];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
function closestKatex(node) {
|
||||||
|
// If node is a Text Node, for example, go up to containing Element,
|
||||||
|
// where we can apply the `closest` method.
|
||||||
|
var element = node instanceof Element ? node : node.parentElement;
|
||||||
|
return element && element.closest('.katex');
|
||||||
|
} // Global copy handler to modify behavior on/within .katex elements.
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('copy', function (event) {
|
||||||
|
var selection = window.getSelection();
|
||||||
|
|
||||||
|
if (selection.isCollapsed || !event.clipboardData) {
|
||||||
|
return; // default action OK if selection is empty or unchangeable
|
||||||
|
}
|
||||||
|
|
||||||
|
var clipboardData = event.clipboardData;
|
||||||
|
var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
|
||||||
|
|
||||||
|
var startKatex = closestKatex(range.startContainer);
|
||||||
|
|
||||||
|
if (startKatex) {
|
||||||
|
range.setStartBefore(startKatex);
|
||||||
|
} // Similarly, when end point is within a formula, expand to entire formula.
|
||||||
|
|
||||||
|
|
||||||
|
var endKatex = closestKatex(range.endContainer);
|
||||||
|
|
||||||
|
if (endKatex) {
|
||||||
|
range.setEndAfter(endKatex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var fragment = range.cloneContents();
|
||||||
|
|
||||||
|
if (!fragment.querySelector('.katex-mathml')) {
|
||||||
|
return; // default action OK if no .katex-mathml elements
|
||||||
|
}
|
||||||
|
|
||||||
|
var htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior.
|
||||||
|
|
||||||
|
clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.
|
||||||
|
|
||||||
|
clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent); // Prevent normal copy handling.
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
112
lib/katex/contrib/mathtex-script-type.js
Normal file
112
lib/katex/contrib/mathtex-script-type.js
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("katex"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["katex"], factory);
|
||||||
|
else {
|
||||||
|
var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
|
||||||
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||||
|
}
|
||||||
|
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
|
||||||
|
return /******/ (function() { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 771:
|
||||||
|
/***/ (function(module) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function() { return module['default']; } :
|
||||||
|
/******/ function() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, definition) {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
var __webpack_exports__ = {};
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||||
|
!function() {
|
||||||
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
|
||||||
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
|
||||||
|
var scripts = document.body.getElementsByTagName("script");
|
||||||
|
scripts = Array.prototype.slice.call(scripts);
|
||||||
|
scripts.forEach(function (script) {
|
||||||
|
if (!script.type || !script.type.match(/math\/tex/i)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
|
||||||
|
var katexElement = document.createElement(display ? "div" : "span");
|
||||||
|
katexElement.setAttribute("class", display ? "equation" : "inline-equation");
|
||||||
|
|
||||||
|
try {
|
||||||
|
katex__WEBPACK_IMPORTED_MODULE_0___default().render(script.text, katexElement, {
|
||||||
|
displayMode: display
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
//console.error(err); linter doesn't like this
|
||||||
|
katexElement.textContent = script.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
script.parentNode.replaceChild(katexElement, script);
|
||||||
|
});
|
||||||
|
}();
|
||||||
|
__webpack_exports__ = __webpack_exports__["default"];
|
||||||
|
/******/ return __webpack_exports__;
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
});
|
1
lib/katex/contrib/mathtex-script-type.min.js
vendored
Normal file
1
lib/katex/contrib/mathtex-script-type.min.js
vendored
Normal file
|
@ -0,0 +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}()}));
|
24
lib/katex/contrib/mathtex-script-type.mjs
Normal file
24
lib/katex/contrib/mathtex-script-type.mjs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import katex from '../katex.mjs';
|
||||||
|
|
||||||
|
var scripts = document.body.getElementsByTagName("script");
|
||||||
|
scripts = Array.prototype.slice.call(scripts);
|
||||||
|
scripts.forEach(function (script) {
|
||||||
|
if (!script.type || !script.type.match(/math\/tex/i)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
|
||||||
|
var katexElement = document.createElement(display ? "div" : "span");
|
||||||
|
katexElement.setAttribute("class", display ? "equation" : "inline-equation");
|
||||||
|
|
||||||
|
try {
|
||||||
|
katex.render(script.text, katexElement, {
|
||||||
|
displayMode: display
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
//console.error(err); linter doesn't like this
|
||||||
|
katexElement.textContent = script.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
script.parentNode.replaceChild(katexElement, script);
|
||||||
|
});
|
3216
lib/katex/contrib/mhchem.js
Normal file
3216
lib/katex/contrib/mhchem.js
Normal file
File diff suppressed because it is too large
Load diff
1
lib/katex/contrib/mhchem.min.js
vendored
Normal file
1
lib/katex/contrib/mhchem.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3109
lib/katex/contrib/mhchem.mjs
Normal file
3109
lib/katex/contrib/mhchem.mjs
Normal file
File diff suppressed because it is too large
Load diff
881
lib/katex/contrib/render-a11y-string.js
Normal file
881
lib/katex/contrib/render-a11y-string.js
Normal file
|
@ -0,0 +1,881 @@
|
||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("katex"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["katex"], factory);
|
||||||
|
else {
|
||||||
|
var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
|
||||||
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||||
|
}
|
||||||
|
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
|
||||||
|
return /******/ (function() { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 771:
|
||||||
|
/***/ (function(module) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function() { return module['default']; } :
|
||||||
|
/******/ function() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, definition) {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ !function() {
|
||||||
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
||||||
|
/******/ }();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
var __webpack_exports__ = {};
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||||
|
!function() {
|
||||||
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
|
||||||
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/**
|
||||||
|
* renderA11yString returns a readable string.
|
||||||
|
*
|
||||||
|
* In some cases the string will have the proper semantic math
|
||||||
|
* meaning,:
|
||||||
|
* renderA11yString("\\frac{1}{2}"")
|
||||||
|
* -> "start fraction, 1, divided by, 2, end fraction"
|
||||||
|
*
|
||||||
|
* However, other cases do not:
|
||||||
|
* renderA11yString("f(x) = x^2")
|
||||||
|
* -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
|
||||||
|
*
|
||||||
|
* The commas in the string aim to increase ease of understanding
|
||||||
|
* when read by a screenreader.
|
||||||
|
*/
|
||||||
|
// NOTE: since we're importing types here these files won't actually be
|
||||||
|
// included in the build.
|
||||||
|
// $FlowIgnore: we import the types directly anyways
|
||||||
|
|
||||||
|
var stringMap = {
|
||||||
|
"(": "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",
|
||||||
|
// TODO: add entries for all accents
|
||||||
|
"\\hat": "hat",
|
||||||
|
"\\acute": "acute"
|
||||||
|
};
|
||||||
|
var powerMap = {
|
||||||
|
"prime": "prime",
|
||||||
|
"degree": "degrees",
|
||||||
|
"circle": "degrees",
|
||||||
|
"2": "squared",
|
||||||
|
"3": "cubed"
|
||||||
|
};
|
||||||
|
var openMap = {
|
||||||
|
"|": "open vertical bar",
|
||||||
|
".": ""
|
||||||
|
};
|
||||||
|
var closeMap = {
|
||||||
|
"|": "close vertical bar",
|
||||||
|
".": ""
|
||||||
|
};
|
||||||
|
var binMap = {
|
||||||
|
"+": "plus",
|
||||||
|
"-": "minus",
|
||||||
|
"\\pm": "plus minus",
|
||||||
|
"\\cdot": "dot",
|
||||||
|
"*": "times",
|
||||||
|
"/": "divided by",
|
||||||
|
"\\times": "times",
|
||||||
|
"\\div": "divided by",
|
||||||
|
"\\circ": "circle",
|
||||||
|
"\\bullet": "bullet"
|
||||||
|
};
|
||||||
|
var relMap = {
|
||||||
|
"=": "equals",
|
||||||
|
"\\approx": "approximately equals",
|
||||||
|
"≠": "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"
|
||||||
|
};
|
||||||
|
var accentUnderMap = {
|
||||||
|
"\\underleftarrow": "left arrow",
|
||||||
|
"\\underrightarrow": "right arrow",
|
||||||
|
"\\underleftrightarrow": "left-right arrow",
|
||||||
|
"\\undergroup": "group",
|
||||||
|
"\\underlinesegment": "line segment",
|
||||||
|
"\\utilde": "tilde"
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildString = function buildString(str, type, a11yStrings) {
|
||||||
|
if (!str) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret;
|
||||||
|
|
||||||
|
if (type === "open") {
|
||||||
|
ret = str in openMap ? openMap[str] : stringMap[str] || str;
|
||||||
|
} else if (type === "close") {
|
||||||
|
ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
|
||||||
|
} else if (type === "bin") {
|
||||||
|
ret = binMap[str] || str;
|
||||||
|
} else if (type === "rel") {
|
||||||
|
ret = relMap[str] || str;
|
||||||
|
} else {
|
||||||
|
ret = stringMap[str] || str;
|
||||||
|
} // If the text to add is a number and there is already a string
|
||||||
|
// in the list and the last string is a number then we should
|
||||||
|
// combine them into a single number
|
||||||
|
|
||||||
|
|
||||||
|
if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
|
||||||
|
// I think we might be able to drop the nested arrays, which would make
|
||||||
|
// this easier to type
|
||||||
|
// $FlowFixMe
|
||||||
|
/^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
|
||||||
|
a11yStrings[a11yStrings.length - 1] += ret;
|
||||||
|
} else if (ret) {
|
||||||
|
a11yStrings.push(ret);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildRegion = function buildRegion(a11yStrings, callback) {
|
||||||
|
var regionStrings = [];
|
||||||
|
a11yStrings.push(regionStrings);
|
||||||
|
callback(regionStrings);
|
||||||
|
};
|
||||||
|
|
||||||
|
var handleObject = function handleObject(tree, a11yStrings, atomType) {
|
||||||
|
// Everything else is assumed to be an object...
|
||||||
|
switch (tree.type) {
|
||||||
|
case "accent":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("with");
|
||||||
|
buildString(tree.label, "normal", a11yStrings);
|
||||||
|
a11yStrings.push("on top");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "accentUnder":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("with");
|
||||||
|
buildString(accentUnderMap[tree.label], "normal", a11yStrings);
|
||||||
|
a11yStrings.push("underneath");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "accent-token":
|
||||||
|
{
|
||||||
|
// Used internally by accent symbols.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "atom":
|
||||||
|
{
|
||||||
|
var text = tree.text;
|
||||||
|
|
||||||
|
switch (tree.family) {
|
||||||
|
case "bin":
|
||||||
|
{
|
||||||
|
buildString(text, "bin", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "close":
|
||||||
|
{
|
||||||
|
buildString(text, "close", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// TODO(kevinb): figure out what should be done for inner
|
||||||
|
|
||||||
|
case "inner":
|
||||||
|
{
|
||||||
|
buildString(tree.text, "inner", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "open":
|
||||||
|
{
|
||||||
|
buildString(text, "open", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "punct":
|
||||||
|
{
|
||||||
|
buildString(text, "punct", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "rel":
|
||||||
|
{
|
||||||
|
buildString(text, "rel", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
tree.family;
|
||||||
|
throw new Error("\"" + tree.family + "\" is not a valid atom type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "color":
|
||||||
|
{
|
||||||
|
var color = tree.color.replace(/katex-/, "");
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start color " + color);
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end color " + color);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "color-token":
|
||||||
|
{
|
||||||
|
// Used by \color, \colorbox, and \fcolorbox but not directly rendered.
|
||||||
|
// It's a leaf node and has no children so just break.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "delimsizing":
|
||||||
|
{
|
||||||
|
if (tree.delim && tree.delim !== ".") {
|
||||||
|
buildString(tree.delim, "normal", a11yStrings);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "genfrac":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
// genfrac can have unbalanced delimiters
|
||||||
|
var leftDelim = tree.leftDelim,
|
||||||
|
rightDelim = tree.rightDelim; // NOTE: Not sure if this is a safe assumption
|
||||||
|
// hasBarLine true -> fraction, false -> binomial
|
||||||
|
|
||||||
|
if (tree.hasBarLine) {
|
||||||
|
regionStrings.push("start fraction");
|
||||||
|
leftDelim && buildString(leftDelim, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.numer, regionStrings, atomType);
|
||||||
|
regionStrings.push("divided by");
|
||||||
|
buildA11yStrings(tree.denom, regionStrings, atomType);
|
||||||
|
rightDelim && buildString(rightDelim, "close", regionStrings);
|
||||||
|
regionStrings.push("end fraction");
|
||||||
|
} else {
|
||||||
|
regionStrings.push("start binomial");
|
||||||
|
leftDelim && buildString(leftDelim, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.numer, regionStrings, atomType);
|
||||||
|
regionStrings.push("over");
|
||||||
|
buildA11yStrings(tree.denom, regionStrings, atomType);
|
||||||
|
rightDelim && buildString(rightDelim, "close", regionStrings);
|
||||||
|
regionStrings.push("end binomial");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "hbox":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "kern":
|
||||||
|
{
|
||||||
|
// No op: we don't attempt to present kerning information
|
||||||
|
// to the screen reader.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "leftright":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
buildString(tree.left, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
buildString(tree.right, "close", regionStrings);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "leftright-right":
|
||||||
|
{
|
||||||
|
// TODO: double check that this is a no-op
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "lap":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "mathord":
|
||||||
|
{
|
||||||
|
buildString(tree.text, "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "op":
|
||||||
|
{
|
||||||
|
var body = tree.body,
|
||||||
|
name = tree.name;
|
||||||
|
|
||||||
|
if (body) {
|
||||||
|
buildA11yStrings(body, a11yStrings, atomType);
|
||||||
|
} else if (name) {
|
||||||
|
buildString(name, "normal", a11yStrings);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "op-token":
|
||||||
|
{
|
||||||
|
// Used internally by operator symbols.
|
||||||
|
buildString(tree.text, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "ordgroup":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "overline":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
a11yStrings.push("start overline");
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("end overline");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "pmb":
|
||||||
|
{
|
||||||
|
a11yStrings.push("bold");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "phantom":
|
||||||
|
{
|
||||||
|
a11yStrings.push("empty space");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "raisebox":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "rule":
|
||||||
|
{
|
||||||
|
a11yStrings.push("rectangle");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "sizing":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "spacing":
|
||||||
|
{
|
||||||
|
a11yStrings.push("space");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "styling":
|
||||||
|
{
|
||||||
|
// We ignore the styling and just pass through the contents
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "sqrt":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
var body = tree.body,
|
||||||
|
index = tree.index;
|
||||||
|
|
||||||
|
if (index) {
|
||||||
|
var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
|
||||||
|
|
||||||
|
if (indexString === "3") {
|
||||||
|
regionStrings.push("cube root of");
|
||||||
|
buildA11yStrings(body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end cube root");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("root");
|
||||||
|
regionStrings.push("start index");
|
||||||
|
buildA11yStrings(index, regionStrings, atomType);
|
||||||
|
regionStrings.push("end index");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("square root of");
|
||||||
|
buildA11yStrings(body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end square root");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "supsub":
|
||||||
|
{
|
||||||
|
var base = tree.base,
|
||||||
|
sub = tree.sub,
|
||||||
|
sup = tree.sup;
|
||||||
|
var isLog = false;
|
||||||
|
|
||||||
|
if (base) {
|
||||||
|
buildA11yStrings(base, a11yStrings, atomType);
|
||||||
|
isLog = base.type === "op" && base.name === "\\log";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sub) {
|
||||||
|
var regionName = isLog ? "base" : "subscript";
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start " + regionName);
|
||||||
|
buildA11yStrings(sub, regionStrings, atomType);
|
||||||
|
regionStrings.push("end " + regionName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sup) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
|
||||||
|
|
||||||
|
if (supString in powerMap) {
|
||||||
|
regionStrings.push(powerMap[supString]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("start superscript");
|
||||||
|
buildA11yStrings(sup, regionStrings, atomType);
|
||||||
|
regionStrings.push("end superscript");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "text":
|
||||||
|
{
|
||||||
|
// TODO: handle other fonts
|
||||||
|
if (tree.font === "\\textbf") {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start bold text");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end bold text");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start text");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end text");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "textord":
|
||||||
|
{
|
||||||
|
buildString(tree.text, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "smash":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "enclose":
|
||||||
|
{
|
||||||
|
// TODO: create a map for these.
|
||||||
|
// TODO: differentiate between a body with a single atom, e.g.
|
||||||
|
// "cancel a" instead of "start cancel, a, end cancel"
|
||||||
|
if (/cancel/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start cancel");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end cancel");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/box/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start box");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end box");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/sout/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start strikeout");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end strikeout");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/phase/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start phase angle");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end phase angle");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "vcenter":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
// Although there are nodes of type "size" in the parse tree, they have
|
||||||
|
// no semantic meaning and should be ignored.
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
buildString("start verbatim", "normal", a11yStrings);
|
||||||
|
buildString(tree.body, "normal", a11yStrings);
|
||||||
|
buildString("end verbatim", "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "environment":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: environment not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "horizBrace":
|
||||||
|
{
|
||||||
|
buildString("start " + tree.label.slice(1), "normal", a11yStrings);
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
buildString("end " + tree.label.slice(1), "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "infix":
|
||||||
|
{
|
||||||
|
// All infix nodes are replace with other nodes.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "includegraphics":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: includegraphics not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "font":
|
||||||
|
{
|
||||||
|
// TODO: callout the start/end of specific fonts
|
||||||
|
// TODO: map \BBb{N} to "the naturals" or something like that
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "href":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: href not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "cr":
|
||||||
|
{
|
||||||
|
// This is used by environments.
|
||||||
|
throw new Error("KaTeX-a11y: cr not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "underline":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
a11yStrings.push("start underline");
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
a11yStrings.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":
|
||||||
|
{
|
||||||
|
// \neq and \ne are macros so we let "htmlmathml" render the mathmal
|
||||||
|
// side of things and extract the text from that.
|
||||||
|
var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
|
||||||
|
|
||||||
|
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, _atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "mathchoice":
|
||||||
|
{
|
||||||
|
// TODO: track which which style we're using, e.g. dispaly, text, etc.
|
||||||
|
// default to text style if even that may not be the correct style
|
||||||
|
buildA11yStrings(tree.text, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "htmlmathml":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.mathml, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "middle":
|
||||||
|
{
|
||||||
|
buildString(tree.delim, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "internal":
|
||||||
|
{
|
||||||
|
// internal nodes are never included in the parse tree
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "html":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
tree.type;
|
||||||
|
throw new Error("KaTeX a11y un-recognized type: " + tree.type);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
|
||||||
|
if (a11yStrings === void 0) {
|
||||||
|
a11yStrings = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tree instanceof Array) {
|
||||||
|
for (var i = 0; i < tree.length; i++) {
|
||||||
|
buildA11yStrings(tree[i], a11yStrings, atomType);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleObject(tree, a11yStrings, atomType);
|
||||||
|
}
|
||||||
|
|
||||||
|
return a11yStrings;
|
||||||
|
};
|
||||||
|
|
||||||
|
var flatten = function flatten(array) {
|
||||||
|
var result = [];
|
||||||
|
array.forEach(function (item) {
|
||||||
|
if (item instanceof Array) {
|
||||||
|
result = result.concat(flatten(item));
|
||||||
|
} else {
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderA11yString = function renderA11yString(text, settings) {
|
||||||
|
var tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings);
|
||||||
|
|
||||||
|
var a11yStrings = buildA11yStrings(tree, [], "normal");
|
||||||
|
return flatten(a11yStrings).join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (renderA11yString);
|
||||||
|
}();
|
||||||
|
__webpack_exports__ = __webpack_exports__["default"];
|
||||||
|
/******/ return __webpack_exports__;
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
});
|
1
lib/katex/contrib/render-a11y-string.min.js
vendored
Normal file
1
lib/katex/contrib/render-a11y-string.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
800
lib/katex/contrib/render-a11y-string.mjs
Normal file
800
lib/katex/contrib/render-a11y-string.mjs
Normal file
|
@ -0,0 +1,800 @@
|
||||||
|
import katex from '../katex.mjs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* renderA11yString returns a readable string.
|
||||||
|
*
|
||||||
|
* In some cases the string will have the proper semantic math
|
||||||
|
* meaning,:
|
||||||
|
* renderA11yString("\\frac{1}{2}"")
|
||||||
|
* -> "start fraction, 1, divided by, 2, end fraction"
|
||||||
|
*
|
||||||
|
* However, other cases do not:
|
||||||
|
* renderA11yString("f(x) = x^2")
|
||||||
|
* -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
|
||||||
|
*
|
||||||
|
* The commas in the string aim to increase ease of understanding
|
||||||
|
* when read by a screenreader.
|
||||||
|
*/
|
||||||
|
var stringMap = {
|
||||||
|
"(": "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",
|
||||||
|
// TODO: add entries for all accents
|
||||||
|
"\\hat": "hat",
|
||||||
|
"\\acute": "acute"
|
||||||
|
};
|
||||||
|
var powerMap = {
|
||||||
|
"prime": "prime",
|
||||||
|
"degree": "degrees",
|
||||||
|
"circle": "degrees",
|
||||||
|
"2": "squared",
|
||||||
|
"3": "cubed"
|
||||||
|
};
|
||||||
|
var openMap = {
|
||||||
|
"|": "open vertical bar",
|
||||||
|
".": ""
|
||||||
|
};
|
||||||
|
var closeMap = {
|
||||||
|
"|": "close vertical bar",
|
||||||
|
".": ""
|
||||||
|
};
|
||||||
|
var binMap = {
|
||||||
|
"+": "plus",
|
||||||
|
"-": "minus",
|
||||||
|
"\\pm": "plus minus",
|
||||||
|
"\\cdot": "dot",
|
||||||
|
"*": "times",
|
||||||
|
"/": "divided by",
|
||||||
|
"\\times": "times",
|
||||||
|
"\\div": "divided by",
|
||||||
|
"\\circ": "circle",
|
||||||
|
"\\bullet": "bullet"
|
||||||
|
};
|
||||||
|
var relMap = {
|
||||||
|
"=": "equals",
|
||||||
|
"\\approx": "approximately equals",
|
||||||
|
"≠": "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"
|
||||||
|
};
|
||||||
|
var accentUnderMap = {
|
||||||
|
"\\underleftarrow": "left arrow",
|
||||||
|
"\\underrightarrow": "right arrow",
|
||||||
|
"\\underleftrightarrow": "left-right arrow",
|
||||||
|
"\\undergroup": "group",
|
||||||
|
"\\underlinesegment": "line segment",
|
||||||
|
"\\utilde": "tilde"
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildString = (str, type, a11yStrings) => {
|
||||||
|
if (!str) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret;
|
||||||
|
|
||||||
|
if (type === "open") {
|
||||||
|
ret = str in openMap ? openMap[str] : stringMap[str] || str;
|
||||||
|
} else if (type === "close") {
|
||||||
|
ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
|
||||||
|
} else if (type === "bin") {
|
||||||
|
ret = binMap[str] || str;
|
||||||
|
} else if (type === "rel") {
|
||||||
|
ret = relMap[str] || str;
|
||||||
|
} else {
|
||||||
|
ret = stringMap[str] || str;
|
||||||
|
} // If the text to add is a number and there is already a string
|
||||||
|
// in the list and the last string is a number then we should
|
||||||
|
// combine them into a single number
|
||||||
|
|
||||||
|
|
||||||
|
if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
|
||||||
|
// I think we might be able to drop the nested arrays, which would make
|
||||||
|
// this easier to type
|
||||||
|
// $FlowFixMe
|
||||||
|
/^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
|
||||||
|
a11yStrings[a11yStrings.length - 1] += ret;
|
||||||
|
} else if (ret) {
|
||||||
|
a11yStrings.push(ret);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildRegion = (a11yStrings, callback) => {
|
||||||
|
var regionStrings = [];
|
||||||
|
a11yStrings.push(regionStrings);
|
||||||
|
callback(regionStrings);
|
||||||
|
};
|
||||||
|
|
||||||
|
var handleObject = (tree, a11yStrings, atomType) => {
|
||||||
|
// Everything else is assumed to be an object...
|
||||||
|
switch (tree.type) {
|
||||||
|
case "accent":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, a11yStrings => {
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("with");
|
||||||
|
buildString(tree.label, "normal", a11yStrings);
|
||||||
|
a11yStrings.push("on top");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "accentUnder":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, a11yStrings => {
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("with");
|
||||||
|
buildString(accentUnderMap[tree.label], "normal", a11yStrings);
|
||||||
|
a11yStrings.push("underneath");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "accent-token":
|
||||||
|
{
|
||||||
|
// Used internally by accent symbols.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "atom":
|
||||||
|
{
|
||||||
|
var {
|
||||||
|
text
|
||||||
|
} = tree;
|
||||||
|
|
||||||
|
switch (tree.family) {
|
||||||
|
case "bin":
|
||||||
|
{
|
||||||
|
buildString(text, "bin", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "close":
|
||||||
|
{
|
||||||
|
buildString(text, "close", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// TODO(kevinb): figure out what should be done for inner
|
||||||
|
|
||||||
|
case "inner":
|
||||||
|
{
|
||||||
|
buildString(tree.text, "inner", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "open":
|
||||||
|
{
|
||||||
|
buildString(text, "open", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "punct":
|
||||||
|
{
|
||||||
|
buildString(text, "punct", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "rel":
|
||||||
|
{
|
||||||
|
buildString(text, "rel", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
tree.family;
|
||||||
|
throw new Error("\"" + tree.family + "\" is not a valid atom type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "color":
|
||||||
|
{
|
||||||
|
var color = tree.color.replace(/katex-/, "");
|
||||||
|
buildRegion(a11yStrings, regionStrings => {
|
||||||
|
regionStrings.push("start color " + color);
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end color " + color);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "color-token":
|
||||||
|
{
|
||||||
|
// Used by \color, \colorbox, and \fcolorbox but not directly rendered.
|
||||||
|
// It's a leaf node and has no children so just break.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "delimsizing":
|
||||||
|
{
|
||||||
|
if (tree.delim && tree.delim !== ".") {
|
||||||
|
buildString(tree.delim, "normal", a11yStrings);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "genfrac":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, regionStrings => {
|
||||||
|
// genfrac can have unbalanced delimiters
|
||||||
|
var {
|
||||||
|
leftDelim,
|
||||||
|
rightDelim
|
||||||
|
} = tree; // NOTE: Not sure if this is a safe assumption
|
||||||
|
// hasBarLine true -> fraction, false -> binomial
|
||||||
|
|
||||||
|
if (tree.hasBarLine) {
|
||||||
|
regionStrings.push("start fraction");
|
||||||
|
leftDelim && buildString(leftDelim, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.numer, regionStrings, atomType);
|
||||||
|
regionStrings.push("divided by");
|
||||||
|
buildA11yStrings(tree.denom, regionStrings, atomType);
|
||||||
|
rightDelim && buildString(rightDelim, "close", regionStrings);
|
||||||
|
regionStrings.push("end fraction");
|
||||||
|
} else {
|
||||||
|
regionStrings.push("start binomial");
|
||||||
|
leftDelim && buildString(leftDelim, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.numer, regionStrings, atomType);
|
||||||
|
regionStrings.push("over");
|
||||||
|
buildA11yStrings(tree.denom, regionStrings, atomType);
|
||||||
|
rightDelim && buildString(rightDelim, "close", regionStrings);
|
||||||
|
regionStrings.push("end binomial");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "hbox":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "kern":
|
||||||
|
{
|
||||||
|
// No op: we don't attempt to present kerning information
|
||||||
|
// to the screen reader.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "leftright":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, regionStrings => {
|
||||||
|
buildString(tree.left, "open", regionStrings);
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
buildString(tree.right, "close", regionStrings);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "leftright-right":
|
||||||
|
{
|
||||||
|
// TODO: double check that this is a no-op
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "lap":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "mathord":
|
||||||
|
{
|
||||||
|
buildString(tree.text, "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "op":
|
||||||
|
{
|
||||||
|
var {
|
||||||
|
body,
|
||||||
|
name
|
||||||
|
} = tree;
|
||||||
|
|
||||||
|
if (body) {
|
||||||
|
buildA11yStrings(body, a11yStrings, atomType);
|
||||||
|
} else if (name) {
|
||||||
|
buildString(name, "normal", a11yStrings);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "op-token":
|
||||||
|
{
|
||||||
|
// Used internally by operator symbols.
|
||||||
|
buildString(tree.text, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "ordgroup":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "overline":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
a11yStrings.push("start overline");
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
a11yStrings.push("end overline");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "pmb":
|
||||||
|
{
|
||||||
|
a11yStrings.push("bold");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "phantom":
|
||||||
|
{
|
||||||
|
a11yStrings.push("empty space");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "raisebox":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "rule":
|
||||||
|
{
|
||||||
|
a11yStrings.push("rectangle");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "sizing":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "spacing":
|
||||||
|
{
|
||||||
|
a11yStrings.push("space");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "styling":
|
||||||
|
{
|
||||||
|
// We ignore the styling and just pass through the contents
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "sqrt":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, regionStrings => {
|
||||||
|
var {
|
||||||
|
body,
|
||||||
|
index
|
||||||
|
} = tree;
|
||||||
|
|
||||||
|
if (index) {
|
||||||
|
var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
|
||||||
|
|
||||||
|
if (indexString === "3") {
|
||||||
|
regionStrings.push("cube root of");
|
||||||
|
buildA11yStrings(body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end cube root");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("root");
|
||||||
|
regionStrings.push("start index");
|
||||||
|
buildA11yStrings(index, regionStrings, atomType);
|
||||||
|
regionStrings.push("end index");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("square root of");
|
||||||
|
buildA11yStrings(body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end square root");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "supsub":
|
||||||
|
{
|
||||||
|
var {
|
||||||
|
base,
|
||||||
|
sub,
|
||||||
|
sup
|
||||||
|
} = tree;
|
||||||
|
var isLog = false;
|
||||||
|
|
||||||
|
if (base) {
|
||||||
|
buildA11yStrings(base, a11yStrings, atomType);
|
||||||
|
isLog = base.type === "op" && base.name === "\\log";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sub) {
|
||||||
|
var regionName = isLog ? "base" : "subscript";
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start " + regionName);
|
||||||
|
buildA11yStrings(sub, regionStrings, atomType);
|
||||||
|
regionStrings.push("end " + regionName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sup) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
|
||||||
|
|
||||||
|
if (supString in powerMap) {
|
||||||
|
regionStrings.push(powerMap[supString]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionStrings.push("start superscript");
|
||||||
|
buildA11yStrings(sup, regionStrings, atomType);
|
||||||
|
regionStrings.push("end superscript");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "text":
|
||||||
|
{
|
||||||
|
// TODO: handle other fonts
|
||||||
|
if (tree.font === "\\textbf") {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start bold text");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end bold text");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start text");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end text");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "textord":
|
||||||
|
{
|
||||||
|
buildString(tree.text, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "smash":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "enclose":
|
||||||
|
{
|
||||||
|
// TODO: create a map for these.
|
||||||
|
// TODO: differentiate between a body with a single atom, e.g.
|
||||||
|
// "cancel a" instead of "start cancel, a, end cancel"
|
||||||
|
if (/cancel/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start cancel");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end cancel");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/box/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start box");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end box");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/sout/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start strikeout");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end strikeout");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
} else if (/phase/.test(tree.label)) {
|
||||||
|
buildRegion(a11yStrings, function (regionStrings) {
|
||||||
|
regionStrings.push("start phase angle");
|
||||||
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
||||||
|
regionStrings.push("end phase angle");
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "vcenter":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
// Although there are nodes of type "size" in the parse tree, they have
|
||||||
|
// no semantic meaning and should be ignored.
|
||||||
|
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":
|
||||||
|
{
|
||||||
|
buildString("start verbatim", "normal", a11yStrings);
|
||||||
|
buildString(tree.body, "normal", a11yStrings);
|
||||||
|
buildString("end verbatim", "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "environment":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: environment not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "horizBrace":
|
||||||
|
{
|
||||||
|
buildString("start " + tree.label.slice(1), "normal", a11yStrings);
|
||||||
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
||||||
|
buildString("end " + tree.label.slice(1), "normal", a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "infix":
|
||||||
|
{
|
||||||
|
// All infix nodes are replace with other nodes.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "includegraphics":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: includegraphics not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "font":
|
||||||
|
{
|
||||||
|
// TODO: callout the start/end of specific fonts
|
||||||
|
// TODO: map \BBb{N} to "the naturals" or something like that
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "href":
|
||||||
|
{
|
||||||
|
throw new Error("KaTeX-a11y: href not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "cr":
|
||||||
|
{
|
||||||
|
// This is used by environments.
|
||||||
|
throw new Error("KaTeX-a11y: cr not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
case "underline":
|
||||||
|
{
|
||||||
|
buildRegion(a11yStrings, function (a11yStrings) {
|
||||||
|
a11yStrings.push("start underline");
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
a11yStrings.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":
|
||||||
|
{
|
||||||
|
// \neq and \ne are macros so we let "htmlmathml" render the mathmal
|
||||||
|
// side of things and extract the text from that.
|
||||||
|
var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
|
||||||
|
|
||||||
|
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, _atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "mathchoice":
|
||||||
|
{
|
||||||
|
// TODO: track which which style we're using, e.g. dispaly, text, etc.
|
||||||
|
// default to text style if even that may not be the correct style
|
||||||
|
buildA11yStrings(tree.text, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "htmlmathml":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.mathml, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "middle":
|
||||||
|
{
|
||||||
|
buildString(tree.delim, atomType, a11yStrings);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "internal":
|
||||||
|
{
|
||||||
|
// internal nodes are never included in the parse tree
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "html":
|
||||||
|
{
|
||||||
|
buildA11yStrings(tree.body, a11yStrings, atomType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
tree.type;
|
||||||
|
throw new Error("KaTeX a11y un-recognized type: " + tree.type);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
|
||||||
|
if (a11yStrings === void 0) {
|
||||||
|
a11yStrings = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tree instanceof Array) {
|
||||||
|
for (var i = 0; i < tree.length; i++) {
|
||||||
|
buildA11yStrings(tree[i], a11yStrings, atomType);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleObject(tree, a11yStrings, atomType);
|
||||||
|
}
|
||||||
|
|
||||||
|
return a11yStrings;
|
||||||
|
};
|
||||||
|
|
||||||
|
var flatten = function flatten(array) {
|
||||||
|
var result = [];
|
||||||
|
array.forEach(function (item) {
|
||||||
|
if (item instanceof Array) {
|
||||||
|
result = result.concat(flatten(item));
|
||||||
|
} else {
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
var renderA11yString = function renderA11yString(text, settings) {
|
||||||
|
var tree = katex.__parse(text, settings);
|
||||||
|
|
||||||
|
var a11yStrings = buildA11yStrings(tree, [], "normal");
|
||||||
|
return flatten(a11yStrings).join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
|
export { renderA11yString as default };
|
BIN
lib/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Bold.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Italic.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-Italic.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Script-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
BIN
lib/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
lib/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
BIN
lib/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
BIN
lib/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue