Skip to content

Commit 98563cd

Browse files
committed
chore: latex syntax 하이라이팅을 위한 설정
1 parent 4018a9a commit 98563cd

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

.vitepress/config.mts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { defineConfig } from "vitepress";
22
import { generateSidebar } from "./plugins/sidebar";
33

4+
// @ts-ignore
5+
import markdownItKatex from "markdown-it-katex";
6+
47
import { createAutoGeneratePostsPlugin } from "./plugins/posts";
58

69
const isProduction = process.env.NODE_ENV === "production";
@@ -52,6 +55,12 @@ export default defineConfig({
5255
"contents/projects/:slug*": "projects/:slug*",
5356
},
5457

58+
markdown: {
59+
config: (md) => {
60+
md.use(markdownItKatex);
61+
},
62+
},
63+
5564
vite: {
5665
resolve: {
5766
alias: [{ find: "@", replacement: "/src" }],

.vitepress/theme/style.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "katex/dist/katex.min.css";
2+
13
/**
24
* Customize default theme styling by overriding CSS variables:
35
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"vitepress": "^1.6.4"
1515
},
1616
"dependencies": {
17-
"@giscus/vue": "^3.1.1"
17+
"@giscus/vue": "^3.1.1",
18+
"katex": "^0.16.25",
19+
"markdown-it-katex": "^2.0.3"
1820
}
1921
}

yarn.lock

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,11 @@ comma-separated-tokens@^2.0.0:
873873
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
874874
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
875875

876+
commander@^8.3.0:
877+
version "8.3.0"
878+
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
879+
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
880+
876881
copy-anything@^3.0.2:
877882
version "3.0.5"
878883
resolved "https://registry.yarnpkg.com/copy-anything/-/copy-anything-3.0.5.tgz#2d92dce8c498f790fa7ad16b01a1ae5a45b020a0"
@@ -1144,6 +1149,20 @@ js-yaml@^3.13.1:
11441149
argparse "^1.0.7"
11451150
esprima "^4.0.0"
11461151

1152+
katex@^0.16.25:
1153+
version "0.16.25"
1154+
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.25.tgz#61699984277e3bdb3e89e0e446b83cd0a57d87db"
1155+
integrity sha512-woHRUZ/iF23GBP1dkDQMh1QBad9dmr8/PAwNA54VrSOVYgI12MAcE14TqnDdQOdzyEonGzMepYnqBMYdsoAr8Q==
1156+
dependencies:
1157+
commander "^8.3.0"
1158+
1159+
katex@^0.6.0:
1160+
version "0.6.0"
1161+
resolved "https://registry.yarnpkg.com/katex/-/katex-0.6.0.tgz#12418e09121c05c92041b6b3b9fb6bab213cb6f3"
1162+
integrity sha512-rS4mY3SvHYg5LtQV6RBcK0if7ur6plyEukAOV+jGGPqFImuzu8fHL6M752iBmRGoUyF0bhZbAPoezehn7xYksA==
1163+
dependencies:
1164+
match-at "^0.1.0"
1165+
11471166
kind-of@^6.0.0, kind-of@^6.0.2:
11481167
version "6.0.3"
11491168
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
@@ -1191,6 +1210,18 @@ [email protected]:
11911210
resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5"
11921211
integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==
11931212

1213+
markdown-it-katex@^2.0.3:
1214+
version "2.0.3"
1215+
resolved "https://registry.yarnpkg.com/markdown-it-katex/-/markdown-it-katex-2.0.3.tgz#d7b86a1aea0b9d6496fab4e7919a18fdef589c39"
1216+
integrity sha512-nUkkMtRWeg7OpdflamflE/Ho/pWl64Lk9wNBKOmaj33XkQdumhXAIYhI0WO03GeiycPCsxbmX536V5NEXpC3Ng==
1217+
dependencies:
1218+
katex "^0.6.0"
1219+
1220+
match-at@^0.1.0:
1221+
version "0.1.1"
1222+
resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540"
1223+
integrity sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q==
1224+
11941225
mdast-util-to-hast@^13.0.0:
11951226
version "13.2.0"
11961227
resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4"

0 commit comments

Comments
 (0)