diff --git a/docs/.npmrc b/docs/.npmrc index b999ab9..b222479 100644 --- a/docs/.npmrc +++ b/docs/.npmrc @@ -1,6 +1,11 @@ # VitePress + vitepress-plugin-mermaid force mermaid's transitive deps -# (cytoscape, dayjs, @braintree/sanitize-url, ...) into Vite's optimizeDeps. -# pnpm's default isolated node_modules does not hoist them to the top level, -# so the dev server fails to pre-bundle and renders a blank page. Flatten the -# docs package's node_modules so Vite can resolve them. Dev-tooling only. -shamefully-hoist=true +# (cytoscape, dayjs, @braintree/sanitize-url, …) into Vite's optimizeDeps, but +# pnpm's isolated node_modules does not expose them at the top level, so the dev +# server fails to pre-bundle them and renders a blank page. +# +# Hoist ONLY those specific deps. Do NOT use `shamefully-hoist=true`: hoisting +# everything shadows VitePress's @vue/* packages with mismatched copies, which +# breaks SSR template compilation and ships raw `{{ }}` in the built HTML. +public-hoist-pattern[]=*cytoscape* +public-hoist-pattern[]=dayjs +public-hoist-pattern[]=@braintree/sanitize-url diff --git a/docs/.vitepress/config/shared.ts b/docs/.vitepress/config/shared.ts index b609dfd..699859c 100644 --- a/docs/.vitepress/config/shared.ts +++ b/docs/.vitepress/config/shared.ts @@ -29,15 +29,21 @@ export const shared: UserConfig = { 'zh/README.md': 'zh/index.md', }, - // The reused docs contain literal mustache examples in inline code - // (e.g. `${{src.service_id}}` in fields_mapping). Move Vue's delimiters to - // unused tokens so `{{ }}` renders literally — no source edits, GitHub - // rendering preserved. - vue: { - template: { - compilerOptions: { - delimiters: ['__vp_no_interp_open__', '__vp_no_interp_close__'], - }, + // The reused docs use literal `{{ }}` inside inline code (e.g. + // `${{src.service_id}}`). Vue would treat those as interpolation and break the + // build. Entity-escape braces in inline code only, so they render literally — + // without changing Vue's global delimiters (which breaks the theme's own + // `{{ }}`) and without editing the source docs. GitHub rendering is unaffected. + markdown: { + config: (md) => { + md.renderer.rules.code_inline = (tokens, idx, _options, _env, self) => { + const token = tokens[idx] + const content = md.utils + .escapeHtml(token.content) + .replace(/{/g, '{') + .replace(/}/g, '}') + return `${content}` + } }, }, diff --git a/docs/public/openumodel-mark.svg b/docs/public/openumodel-mark.svg index d569095..d4c2c1d 100644 --- a/docs/public/openumodel-mark.svg +++ b/docs/public/openumodel-mark.svg @@ -1,3 +1,3 @@ - +