Skip to content

Commit 9de22d9

Browse files
authored
updates for DVpress 0.3 (#225)
* updates for DVpress 0.3 * no math entry
1 parent 3ba8bd5 commit 9de22d9

File tree

4 files changed

+58
-27
lines changed

4 files changed

+58
-27
lines changed

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ EasyHybrid = {path = ".."}
1616

1717
[compat]
1818
Documenter = "1"
19-
DocumenterVitepress = "0.2"
19+
DocumenterVitepress = "0.3"

docs/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"docs:preview": "vitepress preview build/.documenter"
66
},
77
"dependencies": {
8-
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.17.1",
8+
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.18.2",
99
"markdown-it": "^14.1.0",
1010
"markdown-it-footnote": "^4.0.0",
11-
"markdown-it-mathjax3": "^4.3.2",
12-
"vitepress": "^1.6.3",
11+
"vitepress": "^1.6.4",
12+
"@mdit/plugin-mathjax": "^0.25.0",
13+
"@mdit/plugin-tex": "^0.23.1",
1314
"vitepress-plugin-tabs": "^0.6.0"
1415
}
15-
}
16+
}

docs/src/.vitepress/config.mts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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'
44
import footnote from "markdown-it-footnote";
55
import path from 'path'
66

77
// console.log(process.env)
8+
const mathjax = mathjaxPlugin()
89

910
function getBaseRepository(base: string): string {
1011
if (!base || base === '/') return '/';
@@ -41,7 +42,21 @@ export default defineConfig({
4142
// ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
4243
['script', {src: `${baseTemp.base}siteinfo.js`}]
4344
],
45+
markdown: {
46+
config(md) {
47+
md.use(tabsMarkdownPlugin);
48+
md.use(footnote);
49+
mathjax.markdownConfig(md);
50+
},
51+
theme: {
52+
light: "github-light",
53+
dark: "github-dark"
54+
},
55+
},
4456
vite: {
57+
plugins: [
58+
mathjax.vitePlugin,
59+
],
4560
define: {
4661
__DEPLOY_ABSPATH__: JSON.stringify('REPLACE_ME_DOCUMENTER_VITEPRESS_DEPLOY_ABSPATH'),
4762
},
@@ -68,19 +83,6 @@ export default defineConfig({
6883
],
6984
},
7085
},
71-
72-
markdown: {
73-
math: true,
74-
config(md) {
75-
md.use(tabsMarkdownPlugin),
76-
md.use(mathjax3),
77-
md.use(footnote)
78-
},
79-
theme: {
80-
light: "github-light",
81-
dark: "github-dark"
82-
},
83-
},
8486
themeConfig: {
8587
outline: 'deep',
8688
// https://vitepress.dev/reference/default-theme-config

docs/src/.vitepress/theme/style.css

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/var
1515
}
1616

1717
:root {
18+
scroll-behavior: smooth;
1819
/* Typography */
1920
--vp-font-family-base: "Barlow", "Inter var experimental", "Inter var",
2021
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
@@ -145,25 +146,52 @@ font-feature-settings: "calt" off;
145146
--vp-home-hero-image-filter: blur(72px);
146147
}
147148
}
148-
/* Component: MathJax */
149149

150-
mjx-container > svg {
150+
/* plugin-mathjax overwrites */
151+
.mjx-scroll-wrapper {
151152
display: block;
152-
margin: auto;
153+
max-width: 100%;
154+
overflow-x: auto;
155+
overflow-y: hidden;
156+
text-align: center;
153157
}
154158

155159
mjx-container {
160+
display: inline-block;
156161
padding: 0.5rem 0;
157-
}
158-
159-
mjx-container {
160-
display: inline;
161162
margin: auto 2px -2px;
163+
overflow: visible !important; /* Override MathJax's overflow */
164+
text-align: left;
162165
}
163166

164167
mjx-container > svg {
165-
margin: auto;
166168
display: inline-block;
169+
height: auto;
170+
}
171+
172+
mjx-container > svg[data-labels="true"] {
173+
position: absolute;
174+
left: 0;
175+
top: 0;
176+
width: 100%;
177+
height: 100%;
178+
pointer-events: none;
179+
}
180+
181+
/* @mdit/plugin-mathjax theming refs */
182+
183+
mjx-container svg path {
184+
fill: currentColor !important;
185+
stroke: currentColor !important;
186+
}
187+
188+
.MathJax_ref {
189+
color: var(--vp-c-brand-1);
190+
}
191+
192+
.MathJax_ref:hover {
193+
color: var(--vp-c-brand-2);
194+
cursor: pointer;
167195
}
168196

169197
.highlight-link {

0 commit comments

Comments
 (0)