Skip to content

Commit d0aef9d

Browse files
committed
Upgrade docs some more.
1 parent 95dc66e commit d0aef9d

3 files changed

Lines changed: 51 additions & 16 deletions

File tree

docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
node_modules/
3+
package-lock.json
4+
Manifest.toml

docs/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"devDependencies": {
3+
"@types/d3-format": "^3.0.4",
4+
"@types/node": "^25.3.5",
5+
"@types/markdown-it-footnote": "^3.0.4"
6+
},
7+
"scripts": {
8+
"docs:dev": "vitepress dev build/.documenter",
9+
"docs:build": "vitepress build build/.documenter",
10+
"docs:preview": "vitepress preview build/.documenter"
11+
},
12+
"dependencies": {
13+
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.18.2",
14+
"@mdit/plugin-mathjax": "^0.26.1",
15+
"@mdit/plugin-tex": "^0.24.1",
16+
"d3-format": "^3.1.0",
17+
"markdown-it-footnote": "^4.0.0",
18+
"markdown-it": "^14.1.0",
19+
"vitepress": "^1.6.4",
20+
"vitepress-plugin-tabs": "^0.8.0"
21+
}
22+
}

docs/src/.vitepress/config.mts

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { defineConfig } from 'vitepress'
22
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
3-
import mathjax3 from "markdown-it-mathjax3";
3+
import { mathjaxPlugin } from './mathjax-plugin'
4+
import { juliaReplTransformer } from './julia-repl-transformer'
45
import footnote from "markdown-it-footnote";
56
import path from 'path'
67

8+
const mathjax = mathjaxPlugin()
9+
710
function getBaseRepository(base: string): string {
811
if (!base || base === '/') return '/';
912
const parts = base.split('/').filter(Boolean);
@@ -32,18 +35,34 @@ export default defineConfig({
3235
description: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
3336
lastUpdated: true,
3437
cleanUrls: true,
38+
ignoreDeadLinks: true,
3539
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
3640
head: [
3741
['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }],
3842
['script', {src: `${getBaseRepository(baseTemp.base)}versions.js`}],
3943
// ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
40-
['script', {src: `${baseTemp.base}siteinfo.js`}]
44+
['script', {src: `${baseTemp.base}siteinfo.js`}],
45+
// REPLACE_ME_DOCUMENTER_VITEPRESS_NOINDEX
4146
],
42-
ignoreDeadLinks: true,
43-
47+
48+
markdown: {
49+
codeTransformers: [juliaReplTransformer()],
50+
config(md) {
51+
md.use(tabsMarkdownPlugin);
52+
md.use(footnote);
53+
mathjax.markdownConfig(md);
54+
},
55+
theme: {
56+
light: "github-light",
57+
dark: "github-dark"
58+
},
59+
},
4460
vite: {
61+
plugins: [
62+
mathjax.vitePlugin,
63+
],
4564
define: {
46-
__DEPLOY_ABSPATH__: JSON.stringify('/GeoDataFrames.jl/'),
65+
__DEPLOY_ABSPATH__: JSON.stringify('REPLACE_ME_DOCUMENTER_VITEPRESS_DEPLOY_ABSPATH'),
4766
},
4867
resolve: {
4968
alias: {
@@ -65,17 +84,6 @@ export default defineConfig({
6584
],
6685
},
6786
},
68-
markdown: {
69-
math: true,
70-
config(md) {
71-
md.use(tabsMarkdownPlugin),
72-
md.use(mathjax3),
73-
md.use(footnote)
74-
},
75-
theme: {
76-
light: "github-light",
77-
dark: "github-dark"}
78-
},
7987
themeConfig: {
8088
outline: 'deep',
8189
logo: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
@@ -87,6 +95,7 @@ export default defineConfig({
8795
},
8896
nav,
8997
sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
98+
sidebarDrawer: 'REPLACE_ME_DOCUMENTER_VITEPRESS_SIDEBAR_DRAWER',
9099
editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
91100
socialLinks: [
92101
{ icon: 'github', link: 'https://github.com/evetion/GeoDataFrames.jl' },

0 commit comments

Comments
 (0)