Skip to content

Commit e9ea205

Browse files
committed
Support LaTeX/KaTeX
1 parent da72bb1 commit e9ea205

File tree

3 files changed

+285
-3
lines changed

3 files changed

+285
-3
lines changed

docusaurus.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {themes as prismThemes} from 'prism-react-renderer';
22
import type {Config} from '@docusaurus/types';
33
import type * as Preset from '@docusaurus/preset-classic';
4+
import remarkMath from 'remark-math';
5+
import rehypeKatex from 'rehype-katex';
46

57
const config: Config = {
68
title: 'Graphics Programming Discord Server',
@@ -29,7 +31,15 @@ const config: Config = {
2931
defaultLocale: 'en',
3032
locales: ['en'],
3133
},
32-
34+
stylesheets: [
35+
{
36+
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css',
37+
type: 'text/css',
38+
integrity:
39+
'sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+',
40+
crossorigin: 'anonymous',
41+
}
42+
],
3343
presets: [
3444
[
3545
'classic',
@@ -50,6 +60,8 @@ const config: Config = {
5060
onUntruncatedBlogPosts: 'warn',
5161
routeBasePath: '/',
5262
blogSidebarCount: 'ALL',
63+
remarkPlugins: [remarkMath],
64+
rehypePlugins: [rehypeKatex],
5365
},
5466
theme: {
5567
customCss: './src/css/custom.css',

package-lock.json

Lines changed: 269 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"clsx": "^2.0.0",
2222
"prism-react-renderer": "^2.3.0",
2323
"react": "^18.0.0",
24-
"react-dom": "^18.0.0"
24+
"react-dom": "^18.0.0",
25+
"rehype-katex": "^7.0.1",
26+
"remark-math": "^6.0.0"
2527
},
2628
"devDependencies": {
2729
"@docusaurus/module-type-aliases": "3.5.2",

0 commit comments

Comments
 (0)