Add KaTeX support

This commit is contained in:
Hendrik Eeckhaut
2025-05-13 21:36:02 +02:00
parent e4101bdd79
commit 7dd42235cc
5 changed files with 343 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
@@ -41,6 +43,9 @@ const config: Config = {
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/tlsnotary/landing-page',
// Enable math support in docs
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
blog: {
showReadingTime: true,
@@ -48,6 +53,8 @@ const config: Config = {
type: ['rss', 'atom'],
xslt: true,
},
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
@@ -64,6 +71,16 @@ const config: Config = {
],
],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+',
crossorigin: 'anonymous',
},
],
themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',