added footnote feature

This commit is contained in:
Kim, Jimin 2021-12-19 20:49:39 +09:00
parent e838ac59f7
commit b49b6e67d3
5 changed files with 17 additions and 0 deletions

View file

@ -5,6 +5,8 @@ import markdownItTaskCheckbox from "markdown-it-task-checkbox" // a TODO list ch
import markDownItMark from "markdown-it-mark" // text highlighting
import markdownItSub from "markdown-it-sub" // markdown subscript
import markdownItSup from "markdown-it-sup" // markdown superscript
import markdownItFootnote from "markdown-it-footnote" // markdown footnote
import highlightLines from "markdown-it-highlight-lines" // highlighting specific lines in code blocks
import toc from "markdown-toc" // table of contents generation
@ -42,6 +44,7 @@ const md = markdownIt({
.use(markdownItSub)
.use(markdownItSup)
.use(highlightLines)
.use(markdownItFootnote)
export default function parseMarkdown(markdownRaw: string): string {
return (

View file

@ -50,6 +50,10 @@ A post have title, post date, tags, and content.
1. [ ] Ordered list task sub-item (unchecked)
2. [x] Ordered list task sub-item (checked)
## Footnote
css only causes pain[^css_bad] and python is overrated[^python_is_overrated].
## Code
Here's a `code`.
@ -115,3 +119,6 @@ $e=mc^2$ is actually $e^2=(mc^2)^2 + (pc)^2$.
$$
\ce{6 CO2 + 6 H2O <=>[{photosynthesis}][{respiration}] C6H12O6 + 6 O2}
$$
[^css_bad]: Based on my experience building this website, Dec 2021.
[^python_is_overrated]: Based on my infinite wisdom, Dec 2021.

View file

@ -31,6 +31,7 @@
"markdown-it": "^12.3.0",
"markdown-it-anchor": "^8.4.1",
"markdown-it-attrs": "^4.1.0",
"markdown-it-footnote": "^3.0.3",
"markdown-it-highlight-lines": "^1.0.2",
"markdown-it-mark": "^3.0.1",
"markdown-it-sub": "^1.0.0",

View file

@ -0,0 +1 @@
declare module "markdown-it-footnote"

View file

@ -8011,6 +8011,11 @@ markdown-it-attrs@^4.1.0:
resolved "https://registry.yarnpkg.com/markdown-it-attrs/-/markdown-it-attrs-4.1.0.tgz#e27f023cd8731b15b4a5e971d51e6f45b3b947bc"
integrity sha512-xd1SuNQPArGYl3SN1bsOHRnmMenkqeLDbTR0udeyGMSFBnaOtxP4yz1SEKrjsV/XYFygFAeKFHgbbj6AwxbTfA==
markdown-it-footnote@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8"
integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==
markdown-it-highlight-lines@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/markdown-it-highlight-lines/-/markdown-it-highlight-lines-1.0.2.tgz#33ecf51cd9d9e741cd86f583cb95b67de81fc9c7"