11import { themes as prismThemes } from "prism-react-renderer" ;
22import type { Config } from "@docusaurus/types" ;
33import type * as Preset from "@docusaurus/preset-classic" ;
4+ const remarkMath = require ( "remark-math" ) ;
5+ const rehypeKatex = require ( "rehype-katex" ) ;
46
57// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
68
@@ -68,7 +70,7 @@ const config: Config = {
6870 ] ,
6971 ] ,
7072
71- stylesheets : [
73+ stylesheets : [
7274 {
7375 href : "https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css" ,
7476 type : "text/css" ,
@@ -91,12 +93,13 @@ const config: Config = {
9193 src : "img/js.svg" ,
9294 } ,
9395 items : [
94- {
95- type : "docSidebar" ,
96- sidebarId : "tutorialSidebar" ,
97- position : "left" ,
98- label : "Tutorial" ,
99- } ,
96+ // {
97+ // type: "docSidebar",
98+ // sidebarId: "tutorialSidebar",
99+ // position: "left",
100+ // label: "Tutorial",
101+ // },
102+ { to : "/tutorial" , label : "Tutorial" , position : "left" } ,
100103 { to : "/blog" , label : "Blog" , position : "left" } ,
101104 {
102105 href : "#" ,
@@ -151,24 +154,50 @@ const config: Config = {
151154 copyright : `Copyright © ${ new Date ( ) . getFullYear ( ) } JavaScript Mastery. All rights reserved.` ,
152155 } ,
153156 prism : {
154- theme : prismThemes . github ,
155- darkTheme : prismThemes . dracula ,
156- additionalLanguages : [
157- "java" ,
158- "latex" ,
159- "haskell" ,
160- "matlab" ,
161- "PHp" ,
162- "powershell" ,
163- "bash" ,
164- "diff" ,
165- "json" ,
166- "scss" ,
167- ] ,
168- } ,
157+ theme : prismThemes . github ,
158+ darkTheme : prismThemes . dracula ,
159+ additionalLanguages : [
160+ "java" ,
161+ "latex" ,
162+ "haskell" ,
163+ "matlab" ,
164+ "PHp" ,
165+ "powershell" ,
166+ "bash" ,
167+ "diff" ,
168+ "json" ,
169+ "scss" ,
170+ ] ,
171+ } ,
169172 } satisfies Preset . ThemeConfig ,
170173
171- plugins : [ "./src/plugins/tailwind-config.js" ] ,
174+ markdown : {
175+ mermaid : true ,
176+ hooks : {
177+ onBrokenMarkdownLinks : "warn" ,
178+ } ,
179+ } ,
180+ themes : [ "@docusaurus/theme-mermaid" ] ,
181+
182+ plugins : [
183+ "./src/plugins/tailwind-config.js" ,
184+ [
185+ "@docusaurus/plugin-content-docs" ,
186+ /** @type {import('@docusaurus/plugin-content-docs').Options } */
187+ {
188+ id : "tutorial" ,
189+ path : "tutorial" ,
190+ routeBasePath : "tutorial" ,
191+ // breadcrumbs: true,
192+ // editUrl: "#",
193+ sidebarPath : require . resolve ( "./sidebars.ts" ) ,
194+ remarkPlugins : [ remarkMath ] ,
195+ rehypePlugins : [ rehypeKatex ] ,
196+ showLastUpdateAuthor : true ,
197+ showLastUpdateTime : true ,
198+ } ,
199+ ] ,
200+ ] ,
172201} ;
173202
174203export default config ;
0 commit comments