Skip to content

Commit 4429521

Browse files
add swagger-sharing (#116)
Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
1 parent efed35e commit 4429521

23 files changed

Lines changed: 672 additions & 3 deletions

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"@types/node": "^22.9.0",
3434
"prettier": "^3.4.2",
3535
"sharp": "^0.33.5",
36-
"simple-git-hooks": "^2.11.1"
36+
"simple-git-hooks": "^2.11.1",
37+
"markdown-it-mathjax3": "^4.3.2"
3738
},
3839
"simple-git-hooks": {
3940
"pre-commit": "pnpm run fmt"

pnpm-lock.yaml

Lines changed: 284 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.vitepress/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfigWithTheme } from 'vitepress'
22
import { withPwa } from '@vite-pwa/vitepress'
33
import tailwindcss from '@tailwindcss/vite'
44
import { genFeed } from './genFeed.js'
5+
import mathjax3 from 'markdown-it-mathjax3'
56

67
interface ThemeConfig {
78
postsPerPage?: number
@@ -23,6 +24,12 @@ export default withPwa(
2324
description: metaInfo.description,
2425
lang: 'zh-CN',
2526
cleanUrls: true,
27+
markdown: {
28+
math: true,
29+
config: (md) => {
30+
md.use(mathjax3)
31+
},
32+
},
2633
head: [
2734
[
2835
'link',

src/.vitepress/theme/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import './style.css'
2+
import './mathjax3.css'
23
import { h } from 'vue'
34

45
import Layout from './Layout.vue'

src/.vitepress/theme/mathjax3.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mjx-container {
2+
display: inline-block;
3+
margin: auto 2px -2px;
4+
}
5+
mjx-container > svg {
6+
margin: auto;
7+
display: inline-block;
8+
}
25 KB
Loading
19.2 KB
Loading
60 KB
Loading
128 KB
Loading
41.8 KB
Loading

0 commit comments

Comments
 (0)