From 03610c8145a49690c456ecbe1adaed5502232d6b Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 5 Oct 2026 12:45:53 -0400 Subject: [PATCH 1/3] Raise minimum documentation citation dependencies --- docs/Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index dc5e8d2bc..87a66b634 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -20,5 +20,6 @@ MPSKit = {path = ".."} [compat] Documenter = "1.11" +DocumenterCitations = "1.5" DocumenterInterLinks = "1" -DocumenterVitepress = "0.3" +DocumenterVitepress = "0.3.7" From 22069a084c47d637227b0c35fcb59eb1aafd89ef Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 5 Oct 2026 12:46:03 -0400 Subject: [PATCH 2/3] Fix citation hover previews in documentation --- docs/citation_previews.jl | 13 ++ docs/make.jl | 4 +- docs/src/.vitepress/theme/index.ts | 4 +- docs/src/components/CitationPreview.vue | 264 ++++++++++++++++++++++++ 4 files changed, 283 insertions(+), 2 deletions(-) create mode 100644 docs/citation_previews.jl create mode 100644 docs/src/components/CitationPreview.vue diff --git a/docs/citation_previews.jl b/docs/citation_previews.jl new file mode 100644 index 000000000..034c290f7 --- /dev/null +++ b/docs/citation_previews.jl @@ -0,0 +1,13 @@ +# Keep the default DocumenterVitepress config, but parse citations as inline Vue components. +# Otherwise citations at the start of a list item are treated as raw HTML blocks. +struct CitationPreviews <: Documenter.Plugin end + +function DocumenterVitepress.vitepress_config_transform(::CitationPreviews, config::String) + markdown = r"\bmarkdown\s*:\s*\{" + occursin(markdown, config) || error("Cannot configure citation previews: no markdown config") + return replace( + config, + markdown => "markdown: {\n component: { inlineTags: ['CitationPreview'] },"; + count = 1, + ) +end diff --git a/docs/make.jl b/docs/make.jl index 2549e0060..806420235 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,6 +12,8 @@ using DocumenterVitepress using DocumenterCitations using DocumenterInterLinks +include("citation_previews.jl") + # examples example_dir = joinpath(@__DIR__, "src", "examples") classic_pages = map(readdir(joinpath(example_dir, "classic2d"))) do dir @@ -78,7 +80,7 @@ makedocs(; ], checkdocs = :exports, doctest = true, - plugins = [bib, links] + plugins = [bib, links, CitationPreviews()] ) DocumenterVitepress.deploydocs(; diff --git a/docs/src/.vitepress/theme/index.ts b/docs/src/.vitepress/theme/index.ts index b300a6900..2cf606e33 100644 --- a/docs/src/.vitepress/theme/index.ts +++ b/docs/src/.vitepress/theme/index.ts @@ -13,6 +13,7 @@ import VersionPicker from "@/VersionPicker.vue" import AuthorBadge from '@/AuthorBadge.vue' import Authors from '@/Authors.vue' import SidebarDrawerToggle from '@/SidebarDrawerToggle.vue' +// __DV_PLUGIN_COMPONENT_IMPORTS__ import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' @@ -39,6 +40,7 @@ export const Theme: ThemeConfig = { app.component('VersionPicker', VersionPicker); app.component('AuthorBadge', AuthorBadge) app.component('Authors', Authors) + // __DV_PLUGIN_COMPONENT_REGISTRATIONS__ } } -export default Theme \ No newline at end of file +export default Theme diff --git a/docs/src/components/CitationPreview.vue b/docs/src/components/CitationPreview.vue new file mode 100644 index 000000000..42ec3b1e9 --- /dev/null +++ b/docs/src/components/CitationPreview.vue @@ -0,0 +1,264 @@ + + + + + + + + + From c8465b02fa38e6783f3225943f8b718369d9f7ff Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 5 Oct 2026 13:25:16 -0400 Subject: [PATCH 3/3] Disable citation hover previews pending upstream fix --- docs/citation_previews.jl | 13 -- docs/make.jl | 8 +- docs/src/.vitepress/theme/index.ts | 2 - docs/src/components/CitationPreview.vue | 264 ------------------------ 4 files changed, 4 insertions(+), 283 deletions(-) delete mode 100644 docs/citation_previews.jl delete mode 100644 docs/src/components/CitationPreview.vue diff --git a/docs/citation_previews.jl b/docs/citation_previews.jl deleted file mode 100644 index 034c290f7..000000000 --- a/docs/citation_previews.jl +++ /dev/null @@ -1,13 +0,0 @@ -# Keep the default DocumenterVitepress config, but parse citations as inline Vue components. -# Otherwise citations at the start of a list item are treated as raw HTML blocks. -struct CitationPreviews <: Documenter.Plugin end - -function DocumenterVitepress.vitepress_config_transform(::CitationPreviews, config::String) - markdown = r"\bmarkdown\s*:\s*\{" - occursin(markdown, config) || error("Cannot configure citation previews: no markdown config") - return replace( - config, - markdown => "markdown: {\n component: { inlineTags: ['CitationPreview'] },"; - count = 1, - ) -end diff --git a/docs/make.jl b/docs/make.jl index 806420235..59ded9221 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,8 +12,6 @@ using DocumenterVitepress using DocumenterCitations using DocumenterInterLinks -include("citation_previews.jl") - # examples example_dir = joinpath(@__DIR__, "src", "examples") classic_pages = map(readdir(joinpath(example_dir, "classic2d"))) do dir @@ -39,7 +37,9 @@ end # bibliography bibpath = joinpath(@__DIR__, "src", "assets", "mpskit.bib") -bib = CitationBibliography(bibpath; style = :authoryear) +# TODO: Re-enable hover previews once the upstream fix is released: +# https://github.com/LuxDL/DocumenterVitepress.jl/pull/399 +bib = CitationBibliography(bibpath; style = :authoryear, show_hover = false) # interlinks links = InterLinks( @@ -80,7 +80,7 @@ makedocs(; ], checkdocs = :exports, doctest = true, - plugins = [bib, links, CitationPreviews()] + plugins = [bib, links] ) DocumenterVitepress.deploydocs(; diff --git a/docs/src/.vitepress/theme/index.ts b/docs/src/.vitepress/theme/index.ts index 2cf606e33..ada1bbeae 100644 --- a/docs/src/.vitepress/theme/index.ts +++ b/docs/src/.vitepress/theme/index.ts @@ -13,7 +13,6 @@ import VersionPicker from "@/VersionPicker.vue" import AuthorBadge from '@/AuthorBadge.vue' import Authors from '@/Authors.vue' import SidebarDrawerToggle from '@/SidebarDrawerToggle.vue' -// __DV_PLUGIN_COMPONENT_IMPORTS__ import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' @@ -40,7 +39,6 @@ export const Theme: ThemeConfig = { app.component('VersionPicker', VersionPicker); app.component('AuthorBadge', AuthorBadge) app.component('Authors', Authors) - // __DV_PLUGIN_COMPONENT_REGISTRATIONS__ } } export default Theme diff --git a/docs/src/components/CitationPreview.vue b/docs/src/components/CitationPreview.vue deleted file mode 100644 index 42ec3b1e9..000000000 --- a/docs/src/components/CitationPreview.vue +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - -