mordoc 0.1.13 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/bin/cli.js +24 -71
- package/dist/cli/asset-rewrite.d.ts +40 -0
- package/dist/cli/asset-rewrite.d.ts.map +1 -0
- package/dist/cli/asset-rewrite.js +67 -0
- package/dist/cli/asset-rewrite.js.map +1 -0
- package/dist/cli/build.d.ts +45 -15
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/build.js +186 -101
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/dev.d.ts +26 -14
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +116 -159
- package/dist/cli/dev.js.map +1 -1
- package/dist/cli/pagefind-indexer.d.ts +15 -0
- package/dist/cli/pagefind-indexer.d.ts.map +1 -0
- package/dist/cli/pagefind-indexer.js +68 -0
- package/dist/cli/pagefind-indexer.js.map +1 -0
- package/dist/cli/paths.d.ts +26 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +32 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/ssg-runner.d.ts +58 -0
- package/dist/cli/ssg-runner.d.ts.map +1 -0
- package/dist/cli/ssg-runner.js +126 -0
- package/dist/cli/ssg-runner.js.map +1 -0
- package/dist/config/assets-loader.d.ts +11 -0
- package/dist/config/assets-loader.d.ts.map +1 -0
- package/dist/config/assets-loader.js +46 -0
- package/dist/config/assets-loader.js.map +1 -0
- package/dist/config/language-loader.d.ts +11 -0
- package/dist/config/language-loader.d.ts.map +1 -0
- package/dist/config/language-loader.js +61 -0
- package/dist/config/language-loader.js.map +1 -0
- package/dist/config/language.d.ts +11 -0
- package/dist/config/language.d.ts.map +1 -0
- package/dist/config/language.js +61 -0
- package/dist/config/language.js.map +1 -0
- package/dist/config/sidenav-loader.d.ts +14 -0
- package/dist/config/sidenav-loader.d.ts.map +1 -0
- package/dist/config/sidenav-loader.js +78 -0
- package/dist/config/sidenav-loader.js.map +1 -0
- package/dist/config/site-loader.d.ts +11 -0
- package/dist/config/site-loader.d.ts.map +1 -0
- package/dist/config/site-loader.js +72 -0
- package/dist/config/site-loader.js.map +1 -0
- package/dist/config/site.d.ts +11 -0
- package/dist/config/site.d.ts.map +1 -0
- package/dist/config/site.js +72 -0
- package/dist/config/site.js.map +1 -0
- package/dist/config/topnav-loader.d.ts +10 -0
- package/dist/config/topnav-loader.d.ts.map +1 -0
- package/dist/config/topnav-loader.js +78 -0
- package/dist/config/topnav-loader.js.map +1 -0
- package/dist/config/translations-loader.d.ts +7 -0
- package/dist/config/translations-loader.d.ts.map +1 -0
- package/dist/config/translations-loader.js +51 -0
- package/dist/config/translations-loader.js.map +1 -0
- package/dist/content/content-loader.d.ts +16 -0
- package/dist/content/content-loader.d.ts.map +1 -0
- package/dist/content/content-loader.js +126 -0
- package/dist/content/content-loader.js.map +1 -0
- package/dist/content/content-parser.d.ts +12 -0
- package/dist/content/content-parser.d.ts.map +1 -0
- package/dist/content/content-parser.js +54 -0
- package/dist/content/content-parser.js.map +1 -0
- package/dist/content/content-transformer.d.ts +17 -0
- package/dist/content/content-transformer.d.ts.map +1 -0
- package/dist/content/content-transformer.js +94 -0
- package/dist/content/content-transformer.js.map +1 -0
- package/dist/content/markdoc-config.d.ts +13 -0
- package/dist/content/markdoc-config.d.ts.map +1 -0
- package/dist/content/markdoc-config.js +210 -0
- package/dist/content/markdoc-config.js.map +1 -0
- package/dist/content/slug.d.ts +26 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +31 -0
- package/dist/content/slug.js.map +1 -0
- package/dist/pipeline.d.ts +61 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +123 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/types/assets.d.ts +15 -0
- package/dist/types/assets.d.ts.map +1 -0
- package/dist/types/assets.js +2 -0
- package/dist/types/assets.js.map +1 -0
- package/dist/types/content.d.ts +114 -32
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/content.js +1 -6
- package/dist/types/content.js.map +1 -1
- package/dist/types/language.d.ts +9 -0
- package/dist/types/language.d.ts.map +1 -0
- package/dist/types/language.js +2 -0
- package/dist/types/language.js.map +1 -0
- package/dist/types/navigation.d.ts +24 -36
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/types/navigation.js +1 -6
- package/dist/types/navigation.js.map +1 -1
- package/dist/types/pipeline.d.ts +70 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +2 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/types/site.d.ts +20 -0
- package/dist/types/site.d.ts.map +1 -0
- package/dist/types/site.js +2 -0
- package/dist/types/site.js.map +1 -0
- package/dist/utils/lang-utils.d.ts +23 -0
- package/dist/utils/lang-utils.d.ts.map +1 -0
- package/dist/utils/lang-utils.js +40 -0
- package/dist/utils/lang-utils.js.map +1 -0
- package/dist/utils/paths.d.ts +25 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +31 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/vite/plugin.d.ts +93 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +435 -0
- package/dist/vite/plugin.js.map +1 -0
- package/package.json +46 -61
- package/src/app/App.module.css +82 -0
- package/src/app/App.tsx +95 -0
- package/src/app/content/Content.module.css +357 -0
- package/src/app/content/Content.tsx +212 -0
- package/src/app/content/callout/Callout.module.css +110 -0
- package/src/app/content/callout/Callout.tsx +82 -0
- package/src/app/content/card/Card.module.css +146 -0
- package/src/app/content/card/Card.tsx +110 -0
- package/src/app/content/card/CardGrid.module.css +22 -0
- package/src/app/content/card/CardGrid.tsx +34 -0
- package/src/app/content/code-block/CodeBlock.module.css +237 -0
- package/src/app/content/code-block/CodeBlock.tsx +123 -0
- package/src/app/content/heading/Heading.module.css +52 -0
- package/src/app/content/heading/Heading.tsx +75 -0
- package/src/app/content/image/Image.module.css +113 -0
- package/src/app/content/image/Image.tsx +98 -0
- package/src/app/content/link/ContentLink.tsx +46 -0
- package/src/app/data-context.tsx +39 -0
- package/src/app/entry-server.tsx +58 -0
- package/src/app/footer/Footer.module.css +36 -0
- package/src/app/footer/Footer.tsx +28 -0
- package/src/app/globals.d.ts +40 -0
- package/src/app/header/Header.module.css +205 -0
- package/src/app/header/Header.tsx +188 -0
- package/src/app/header/LanguagePicker.module.css +97 -0
- package/src/app/header/LanguagePicker.tsx +174 -0
- package/src/app/header/SearchBar.module.css +92 -0
- package/src/app/header/SearchBar.tsx +37 -0
- package/src/app/header/SearchModal.module.css +185 -0
- package/src/app/header/SearchModal.tsx +245 -0
- package/src/app/header/Topnav.module.css +37 -0
- package/src/app/header/Topnav.tsx +30 -0
- package/src/app/index.css +119 -0
- package/src/app/index.html +13 -0
- package/src/app/landing/LandingPage.module.css +14 -0
- package/src/app/landing/LandingPage.tsx +62 -0
- package/src/app/landing/button/Button.module.css +37 -0
- package/src/app/landing/button/Button.tsx +50 -0
- package/src/app/landing/hero/Hero.module.css +108 -0
- package/src/app/landing/hero/Hero.tsx +81 -0
- package/src/app/landing/section/Section.module.css +100 -0
- package/src/app/landing/section/Section.tsx +61 -0
- package/src/app/lang-utils.ts +11 -0
- package/src/app/main.tsx +67 -0
- package/src/app/not-found/NotFound.module.css +92 -0
- package/src/app/not-found/NotFound.tsx +34 -0
- package/src/app/routes.tsx +86 -0
- package/src/app/sidenav/Sidenav.module.css +239 -0
- package/src/app/sidenav/Sidenav.tsx +182 -0
- package/src/app/skeleton/Skeleton.module.css +100 -0
- package/src/app/skeleton/Skeleton.tsx +75 -0
- package/src/app/toc/Toc.module.css +59 -0
- package/src/app/toc/Toc.tsx +77 -0
- package/src/app/tsconfig.json +18 -0
- package/src/app/virtual-modules.d.ts +74 -0
- package/dist/assets/fonts/inter/Inter-Italic-VariableFont_opsz,wght.ttf +0 -0
- package/dist/assets/fonts/inter/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/dist/assets/fonts/inter/OFL.txt +0 -93
- package/dist/build/Builder.d.ts +0 -92
- package/dist/build/Builder.d.ts.map +0 -1
- package/dist/build/Builder.js +0 -394
- package/dist/build/Builder.js.map +0 -1
- package/dist/build/ClientBundler.d.ts +0 -48
- package/dist/build/ClientBundler.d.ts.map +0 -1
- package/dist/build/ClientBundler.js +0 -169
- package/dist/build/ClientBundler.js.map +0 -1
- package/dist/build/HtmlGenerator.d.ts +0 -46
- package/dist/build/HtmlGenerator.d.ts.map +0 -1
- package/dist/build/HtmlGenerator.js +0 -190
- package/dist/build/HtmlGenerator.js.map +0 -1
- package/dist/build/SearchIndexer.d.ts +0 -31
- package/dist/build/SearchIndexer.d.ts.map +0 -1
- package/dist/build/SearchIndexer.js +0 -116
- package/dist/build/SearchIndexer.js.map +0 -1
- package/dist/bundles/client.js +0 -126
- package/dist/cli/create-app.d.ts +0 -14
- package/dist/cli/create-app.d.ts.map +0 -1
- package/dist/cli/create-app.js +0 -241
- package/dist/cli/create-app.js.map +0 -1
- package/dist/client/App.d.ts +0 -17
- package/dist/client/App.d.ts.map +0 -1
- package/dist/client/App.js +0 -91
- package/dist/client/App.js.map +0 -1
- package/dist/client/contexts/ConfigContext.d.ts +0 -22
- package/dist/client/contexts/ConfigContext.d.ts.map +0 -1
- package/dist/client/contexts/ConfigContext.js +0 -27
- package/dist/client/contexts/ConfigContext.js.map +0 -1
- package/dist/client/contexts/ContentContext.d.ts +0 -31
- package/dist/client/contexts/ContentContext.d.ts.map +0 -1
- package/dist/client/contexts/ContentContext.js +0 -46
- package/dist/client/contexts/ContentContext.js.map +0 -1
- package/dist/client/contexts/SearchContext.d.ts +0 -38
- package/dist/client/contexts/SearchContext.d.ts.map +0 -1
- package/dist/client/contexts/SearchContext.js +0 -185
- package/dist/client/contexts/SearchContext.js.map +0 -1
- package/dist/client/contexts/ThemeContext.d.ts +0 -23
- package/dist/client/contexts/ThemeContext.d.ts.map +0 -1
- package/dist/client/contexts/ThemeContext.js +0 -53
- package/dist/client/contexts/ThemeContext.js.map +0 -1
- package/dist/client/hooks/useContent.d.ts +0 -12
- package/dist/client/hooks/useContent.d.ts.map +0 -1
- package/dist/client/hooks/useContent.js +0 -74
- package/dist/client/hooks/useContent.js.map +0 -1
- package/dist/client/hooks/useNavigation.d.ts +0 -15
- package/dist/client/hooks/useNavigation.d.ts.map +0 -1
- package/dist/client/hooks/useNavigation.js +0 -101
- package/dist/client/hooks/useNavigation.js.map +0 -1
- package/dist/client/hooks/useSearch.d.ts +0 -22
- package/dist/client/hooks/useSearch.d.ts.map +0 -1
- package/dist/client/hooks/useSearch.js +0 -64
- package/dist/client/hooks/useSearch.js.map +0 -1
- package/dist/client/main.d.ts +0 -5
- package/dist/client/main.d.ts.map +0 -1
- package/dist/client/main.js +0 -66
- package/dist/client/main.js.map +0 -1
- package/dist/components/Callout.d.ts +0 -9
- package/dist/components/Callout.d.ts.map +0 -1
- package/dist/components/Callout.js +0 -24
- package/dist/components/Callout.js.map +0 -1
- package/dist/components/Card.d.ts +0 -10
- package/dist/components/Card.d.ts.map +0 -1
- package/dist/components/Card.js +0 -15
- package/dist/components/Card.js.map +0 -1
- package/dist/components/CardGrid.d.ts +0 -8
- package/dist/components/CardGrid.d.ts.map +0 -1
- package/dist/components/CardGrid.js +0 -9
- package/dist/components/CardGrid.js.map +0 -1
- package/dist/components/CodeBlock.d.ts +0 -28
- package/dist/components/CodeBlock.d.ts.map +0 -1
- package/dist/components/CodeBlock.js +0 -80
- package/dist/components/CodeBlock.js.map +0 -1
- package/dist/components/ContentPage.d.ts +0 -9
- package/dist/components/ContentPage.d.ts.map +0 -1
- package/dist/components/ContentPage.js +0 -102
- package/dist/components/ContentPage.js.map +0 -1
- package/dist/components/Header.d.ts +0 -14
- package/dist/components/Header.d.ts.map +0 -1
- package/dist/components/Header.js +0 -30
- package/dist/components/Header.js.map +0 -1
- package/dist/components/Heading.d.ts +0 -16
- package/dist/components/Heading.d.ts.map +0 -1
- package/dist/components/Heading.js +0 -31
- package/dist/components/Heading.js.map +0 -1
- package/dist/components/Image.d.ts +0 -8
- package/dist/components/Image.d.ts.map +0 -1
- package/dist/components/Image.js +0 -24
- package/dist/components/Image.js.map +0 -1
- package/dist/components/Layout.d.ts +0 -14
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/components/Layout.js +0 -32
- package/dist/components/Layout.js.map +0 -1
- package/dist/components/MarkdocRenderer.d.ts +0 -15
- package/dist/components/MarkdocRenderer.d.ts.map +0 -1
- package/dist/components/MarkdocRenderer.js +0 -73
- package/dist/components/MarkdocRenderer.js.map +0 -1
- package/dist/components/MobileMenu.d.ts +0 -14
- package/dist/components/MobileMenu.d.ts.map +0 -1
- package/dist/components/MobileMenu.js +0 -45
- package/dist/components/MobileMenu.js.map +0 -1
- package/dist/components/PageNavigation.d.ts +0 -9
- package/dist/components/PageNavigation.d.ts.map +0 -1
- package/dist/components/PageNavigation.js +0 -23
- package/dist/components/PageNavigation.js.map +0 -1
- package/dist/components/SearchModal.d.ts +0 -9
- package/dist/components/SearchModal.d.ts.map +0 -1
- package/dist/components/SearchModal.js +0 -74
- package/dist/components/SearchModal.js.map +0 -1
- package/dist/components/SideNav.d.ts +0 -9
- package/dist/components/SideNav.d.ts.map +0 -1
- package/dist/components/SideNav.js +0 -66
- package/dist/components/SideNav.js.map +0 -1
- package/dist/components/TableOfContents.d.ts +0 -10
- package/dist/components/TableOfContents.d.ts.map +0 -1
- package/dist/components/TableOfContents.js +0 -151
- package/dist/components/TableOfContents.js.map +0 -1
- package/dist/config/ConfigLoader.d.ts +0 -50
- package/dist/config/ConfigLoader.d.ts.map +0 -1
- package/dist/config/ConfigLoader.js +0 -214
- package/dist/config/ConfigLoader.js.map +0 -1
- package/dist/config/StyleCompiler.d.ts +0 -17
- package/dist/config/StyleCompiler.d.ts.map +0 -1
- package/dist/config/StyleCompiler.js +0 -116
- package/dist/config/StyleCompiler.js.map +0 -1
- package/dist/config/ThemeGenerator.d.ts +0 -14
- package/dist/config/ThemeGenerator.d.ts.map +0 -1
- package/dist/config/ThemeGenerator.js +0 -129
- package/dist/config/ThemeGenerator.js.map +0 -1
- package/dist/content/ContentLoader.d.ts +0 -70
- package/dist/content/ContentLoader.d.ts.map +0 -1
- package/dist/content/ContentLoader.js +0 -146
- package/dist/content/ContentLoader.js.map +0 -1
- package/dist/content/ContentProcessor.d.ts +0 -84
- package/dist/content/ContentProcessor.d.ts.map +0 -1
- package/dist/content/ContentProcessor.js +0 -380
- package/dist/content/ContentProcessor.js.map +0 -1
- package/dist/content/RouteManager.d.ts +0 -69
- package/dist/content/RouteManager.d.ts.map +0 -1
- package/dist/content/RouteManager.js +0 -143
- package/dist/content/RouteManager.js.map +0 -1
- package/dist/styles/components/callout.d.ts +0 -11
- package/dist/styles/components/callout.d.ts.map +0 -1
- package/dist/styles/components/callout.js +0 -87
- package/dist/styles/components/callout.js.map +0 -1
- package/dist/styles/components/card.d.ts +0 -11
- package/dist/styles/components/card.d.ts.map +0 -1
- package/dist/styles/components/card.js +0 -179
- package/dist/styles/components/card.js.map +0 -1
- package/dist/styles/components/codeblock.d.ts +0 -11
- package/dist/styles/components/codeblock.d.ts.map +0 -1
- package/dist/styles/components/codeblock.js +0 -251
- package/dist/styles/components/codeblock.js.map +0 -1
- package/dist/styles/components/content.d.ts +0 -11
- package/dist/styles/components/content.d.ts.map +0 -1
- package/dist/styles/components/content.js +0 -197
- package/dist/styles/components/content.js.map +0 -1
- package/dist/styles/components/fonts.d.ts +0 -11
- package/dist/styles/components/fonts.d.ts.map +0 -1
- package/dist/styles/components/fonts.js +0 -34
- package/dist/styles/components/fonts.js.map +0 -1
- package/dist/styles/components/header.d.ts +0 -11
- package/dist/styles/components/header.d.ts.map +0 -1
- package/dist/styles/components/header.js +0 -293
- package/dist/styles/components/header.js.map +0 -1
- package/dist/styles/components/heading.d.ts +0 -11
- package/dist/styles/components/heading.d.ts.map +0 -1
- package/dist/styles/components/heading.js +0 -115
- package/dist/styles/components/heading.js.map +0 -1
- package/dist/styles/components/layout.d.ts +0 -11
- package/dist/styles/components/layout.d.ts.map +0 -1
- package/dist/styles/components/layout.js +0 -79
- package/dist/styles/components/layout.js.map +0 -1
- package/dist/styles/components/mobilemenu.d.ts +0 -11
- package/dist/styles/components/mobilemenu.d.ts.map +0 -1
- package/dist/styles/components/mobilemenu.js +0 -112
- package/dist/styles/components/mobilemenu.js.map +0 -1
- package/dist/styles/components/reset.d.ts +0 -11
- package/dist/styles/components/reset.d.ts.map +0 -1
- package/dist/styles/components/reset.js +0 -131
- package/dist/styles/components/reset.js.map +0 -1
- package/dist/styles/components/searchmodal.d.ts +0 -11
- package/dist/styles/components/searchmodal.d.ts.map +0 -1
- package/dist/styles/components/searchmodal.js +0 -333
- package/dist/styles/components/searchmodal.js.map +0 -1
- package/dist/styles/components/sidenav.d.ts +0 -11
- package/dist/styles/components/sidenav.d.ts.map +0 -1
- package/dist/styles/components/sidenav.js +0 -212
- package/dist/styles/components/sidenav.js.map +0 -1
- package/dist/styles/components/toc.d.ts +0 -11
- package/dist/styles/components/toc.d.ts.map +0 -1
- package/dist/styles/components/toc.js +0 -120
- package/dist/styles/components/toc.js.map +0 -1
- package/dist/styles/components/typography.d.ts +0 -11
- package/dist/styles/components/typography.d.ts.map +0 -1
- package/dist/styles/components/typography.js +0 -248
- package/dist/styles/components/typography.js.map +0 -1
- package/dist/styles/components/utility.d.ts +0 -11
- package/dist/styles/components/utility.d.ts.map +0 -1
- package/dist/styles/components/utility.js +0 -231
- package/dist/styles/components/utility.js.map +0 -1
- package/dist/styles/types.d.ts +0 -79
- package/dist/styles/types.d.ts.map +0 -1
- package/dist/styles/types.js +0 -7
- package/dist/styles/types.js.map +0 -1
- package/dist/styles/utils.d.ts +0 -21
- package/dist/styles/utils.d.ts.map +0 -1
- package/dist/styles/utils.js +0 -50
- package/dist/styles/utils.js.map +0 -1
- package/dist/styles/variables/main.d.ts +0 -15
- package/dist/styles/variables/main.d.ts.map +0 -1
- package/dist/styles/variables/main.js +0 -116
- package/dist/styles/variables/main.js.map +0 -1
- package/dist/types/config.d.ts +0 -43
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js +0 -7
- package/dist/types/config.js.map +0 -1
- package/dist/utils/language-utils.d.ts +0 -41
- package/dist/utils/language-utils.d.ts.map +0 -1
- package/dist/utils/language-utils.js +0 -79
- package/dist/utils/language-utils.js.map +0 -1
- package/dist/utils/slugify.d.ts +0 -20
- package/dist/utils/slugify.d.ts.map +0 -1
- package/dist/utils/slugify.js +0 -44
- package/dist/utils/slugify.js.map +0 -1
- package/templates/default/config/favicon.ico +0 -0
- package/templates/default/config/logo-dark.png +0 -0
- package/templates/default/config/logo.png +0 -0
- package/templates/default/config/sidenav.yaml +0 -36
- package/templates/default/config/site.json +0 -16
- package/templates/default/config/styles/main.json +0 -6
- package/templates/default/config/styles/typography.json +0 -6
- package/templates/default/content/en/changelog.md +0 -35
- package/templates/default/content/en/faq.md +0 -50
- package/templates/default/content/en/field-manual/engines.md +0 -59
- package/templates/default/content/en/field-manual/relativity.md +0 -46
- package/templates/default/content/en/field-manual/safety.md +0 -44
- package/templates/default/content/en/field-manual.md +0 -22
- package/templates/default/content/en/flight-school/navigation.md +0 -61
- package/templates/default/content/en/flight-school/primer.md +0 -64
- package/templates/default/content/en/flight-school.md +0 -48
- package/templates/default/content/en/index.md +0 -83
- package/templates/default/content/en/ship-systems/flux-sails.md +0 -33
- package/templates/default/content/en/ship-systems/photonic-core.md +0 -39
- package/templates/default/content/en/ship-systems.md +0 -25
- package/templates/default/package.json +0 -21
- package/templates/default/public/icons/academy.svg +0 -15
- package/templates/default/public/icons/manual.svg +0 -16
- package/templates/default/public/icons/relativity.svg +0 -16
- package/templates/default/public/icons/systems.svg +0 -14
- package/templates/default/public/icons/warning.svg +0 -14
- package/templates/default/public/images/flux-sails.svg +0 -33
- package/templates/default/public/images/photonic-core.svg +0 -44
- package/templates/default/public/images/starwake.svg +0 -49
package/dist/types/content.d.ts
CHANGED
|
@@ -1,46 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
|
|
1
|
+
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
|
|
2
|
+
/** A single content page discovered on disk. */
|
|
3
|
+
export interface ContentEntry {
|
|
4
|
+
/** Language code derived from the top-level directory (e.g. "en", "de"). */
|
|
5
|
+
language: string;
|
|
6
|
+
/** URL path segments after the language prefix (e.g. ["prerequisites", "install-code-editor"]). */
|
|
7
|
+
segments: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Resolved route path for navigation.
|
|
10
|
+
* Default language has no prefix: "/overview", "/prerequisites/install-code-editor".
|
|
11
|
+
* Other languages get a prefix: "/de/overview", "/de/prerequisites/install-code-editor".
|
|
12
|
+
*/
|
|
13
|
+
routePath: string;
|
|
14
|
+
/** Absolute path to the .md file on disk. */
|
|
15
|
+
filePath: string;
|
|
16
|
+
/** Slug of the file (filename without extension, e.g. "install-code-editor"). */
|
|
17
|
+
slug: string;
|
|
18
|
+
/** Whether this is an index page (index.md). */
|
|
19
|
+
isIndex: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** The full result of content discovery: every page and which languages have content. */
|
|
22
|
+
export interface ContentMap {
|
|
23
|
+
/** All discovered content entries, sorted by routePath for stable ordering. */
|
|
24
|
+
entries: ContentEntry[];
|
|
25
|
+
/** Language codes that have actual content directories on disk. */
|
|
26
|
+
languages: string[];
|
|
27
|
+
}
|
|
28
|
+
/** Parsed YAML frontmatter from a markdown file. Title is required. */
|
|
6
29
|
export interface Frontmatter {
|
|
7
30
|
title: string;
|
|
8
31
|
description?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
tags?: string[];
|
|
12
|
-
date?: string;
|
|
13
|
-
author?: string;
|
|
14
|
-
sidenavRef?: string;
|
|
32
|
+
/** When set to 'landing', the page renders with the full-width landing layout (no sidenav, no TOC). */
|
|
33
|
+
layout?: 'landing';
|
|
15
34
|
[key: string]: unknown;
|
|
16
35
|
}
|
|
36
|
+
/** A single heading extracted for the table of contents. */
|
|
17
37
|
export interface TocEntry {
|
|
38
|
+
/** Anchor ID for linking (slugified heading text). */
|
|
18
39
|
id: string;
|
|
19
|
-
text
|
|
40
|
+
/** Display text of the heading. */
|
|
41
|
+
title: string;
|
|
42
|
+
/** Heading depth: 2 for h2, 3 for h3, etc. */
|
|
20
43
|
level: number;
|
|
21
|
-
children?: TocEntry[];
|
|
22
44
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
/**
|
|
46
|
+
* A parsed content page — discovery metadata plus the raw Markdoc AST and
|
|
47
|
+
* frontmatter. TOC is not computed at this stage; it is derived from the
|
|
48
|
+
* transformed renderable tree so that anchor IDs always match what is
|
|
49
|
+
* actually rendered. See {@link TransformedPage}.
|
|
50
|
+
*/
|
|
51
|
+
export interface ParsedPage {
|
|
52
|
+
/** The original discovery entry (route, file path, language, etc.). */
|
|
53
|
+
entry: ContentEntry;
|
|
54
|
+
/** Parsed frontmatter from the YAML block at the top of the file. */
|
|
30
55
|
frontmatter: Frontmatter;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
readingTime: number;
|
|
56
|
+
/** Markdoc AST node for downstream transformation. */
|
|
57
|
+
ast: Node;
|
|
34
58
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
/**
|
|
60
|
+
* A transformed content page — the Markdoc AST has been run through the
|
|
61
|
+
* default config (heading IDs, future tag transforms, etc.) and converted
|
|
62
|
+
* into a JSON-serializable renderable tree ready to ship to the client.
|
|
63
|
+
*
|
|
64
|
+
* The TOC is derived from the renderable tree after transform, so its IDs
|
|
65
|
+
* are guaranteed to match the IDs on the rendered heading tags.
|
|
66
|
+
*/
|
|
67
|
+
export interface TransformedPage {
|
|
68
|
+
/** The original discovery entry (route, file path, language, etc.). */
|
|
69
|
+
entry: ContentEntry;
|
|
70
|
+
/** Parsed frontmatter carried through from the parse stage. */
|
|
71
|
+
frontmatter: Frontmatter;
|
|
72
|
+
/** Table of contents extracted from the transformed renderable tree. */
|
|
73
|
+
toc: TocEntry[];
|
|
74
|
+
/**
|
|
75
|
+
* Serializable renderable tree produced by `Markdoc.transform()`.
|
|
76
|
+
* Always a single root node (transformContent normalizes this).
|
|
77
|
+
*/
|
|
78
|
+
renderable: RenderableTreeNode;
|
|
40
79
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Per-route payload shipped by the lazy `virtual:mordoc/page/<routePath>`
|
|
82
|
+
* modules — the full content a page component needs to render.
|
|
83
|
+
*
|
|
84
|
+
* Only fetched when the user navigates to the route. The eager
|
|
85
|
+
* `virtual:mordoc/pages-index` carries just the route identity
|
|
86
|
+
* ({@link PageMeta}); everything visual or title-bar-facing lives here.
|
|
87
|
+
*
|
|
88
|
+
* `isIndex` is intentionally excluded — index-ness is already encoded in
|
|
89
|
+
* the route path shape (e.g. `/flight-manual` vs `/flight-manual/safety`),
|
|
90
|
+
* and any component that genuinely needs the distinction can derive it
|
|
91
|
+
* from the path or cross-reference the navigation tree.
|
|
92
|
+
*/
|
|
93
|
+
export interface PageData {
|
|
94
|
+
/** Serializable renderable tree produced by `Markdoc.transform()`. */
|
|
95
|
+
renderable: RenderableTreeNode;
|
|
96
|
+
/** Full parsed frontmatter, including title, description, and any theme-specific keys. */
|
|
97
|
+
frontmatter: Frontmatter;
|
|
98
|
+
/** Table of contents extracted from the renderable tree. */
|
|
99
|
+
toc: TocEntry[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Lightweight projection of a `TransformedPage` — just the route identity.
|
|
103
|
+
*
|
|
104
|
+
* Shipped eagerly via `virtual:mordoc/pages-index`. Its only job is to let the
|
|
105
|
+
* shell enumerate which routes exist: the React Router route table on the
|
|
106
|
+
* client, page enumeration for the SSG build, and "does this path exist in
|
|
107
|
+
* other languages?" lookups for a language switcher.
|
|
108
|
+
*
|
|
109
|
+
* Everything else a page carries — title, description, TOC, frontmatter,
|
|
110
|
+
* renderable tree, isIndex — lives in the per-route lazy chunk
|
|
111
|
+
* (`virtual:mordoc/page/<routePath>`) and is only fetched when that route
|
|
112
|
+
* is actually visited. Human-readable labels for cross-page UI (sidenav
|
|
113
|
+
* entries, next/prev, breadcrumb ancestors) come from the navigation
|
|
114
|
+
* config, which already spells out its own labels. Index-ness is encoded
|
|
115
|
+
* in the `routePath` shape itself, so it doesn't need a flag here either.
|
|
116
|
+
*
|
|
117
|
+
* `segments` is excluded because it's derivable from `routePath` and
|
|
118
|
+
* `language`.
|
|
119
|
+
*/
|
|
120
|
+
export interface PageMeta {
|
|
121
|
+
/** Resolved route path (same as ContentEntry.routePath). */
|
|
122
|
+
routePath: string;
|
|
123
|
+
/** Language code this page belongs to. */
|
|
124
|
+
language: string;
|
|
125
|
+
/** Present only when the page opts into the landing layout via `layout: landing` in frontmatter. */
|
|
126
|
+
layout?: 'landing';
|
|
44
127
|
}
|
|
45
|
-
export type ContentMap = Map<string, ProcessedContent>;
|
|
46
128
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,mEAAmE;IACnE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uGAAuG;IACvG,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACvB,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,KAAK,EAAE,YAAY,CAAC;IACpB,qEAAqE;IACrE,WAAW,EAAE,WAAW,CAAC;IACzB,sDAAsD;IACtD,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,KAAK,EAAE,YAAY,CAAC;IACpB,+DAA+D;IAC/D,WAAW,EAAE,WAAW,CAAC;IACzB,wEAAwE;IACxE,GAAG,EAAE,QAAQ,EAAE,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACvB,sEAAsE;IACtE,UAAU,EAAE,kBAAkB,CAAC;IAC/B,0FAA0F;IAC1F,WAAW,EAAE,WAAW,CAAC;IACzB,4DAA4D;IAC5D,GAAG,EAAE,QAAQ,EAAE,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,oGAAoG;IACpG,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB"}
|
package/dist/types/content.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape of the config/language.json file.
|
|
3
|
+
* This file is optional — single-language projects can omit it entirely.
|
|
4
|
+
* Each entry is a language code matching a folder under content/ (e.g. "en", "de").
|
|
5
|
+
*/
|
|
6
|
+
export interface LanguageConfig {
|
|
7
|
+
languages: string[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/types/language.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../src/types/language.ts"],"names":[],"mappings":""}
|
|
@@ -1,45 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export interface Route {
|
|
6
|
-
path: string;
|
|
7
|
-
slug: string;
|
|
8
|
-
dirPath: string;
|
|
9
|
-
language: string;
|
|
10
|
-
}
|
|
11
|
-
export type RouteMap = Map<string, Route>;
|
|
12
|
-
export interface NavigationNode {
|
|
1
|
+
/** A single item in the side navigation tree. */
|
|
2
|
+
export interface SidenavItem {
|
|
3
|
+
/** Display text shown in the sidebar. */
|
|
13
4
|
label: string;
|
|
5
|
+
/** Route path for this item. Absent when the item is a group-only heading. */
|
|
14
6
|
path?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
external?: boolean;
|
|
18
|
-
icon?: string;
|
|
19
|
-
children?: NavigationNode[];
|
|
7
|
+
/** Nested child items. Present for both group-only and navigable parents. */
|
|
8
|
+
children?: SidenavItem[];
|
|
20
9
|
}
|
|
21
|
-
|
|
22
|
-
export
|
|
10
|
+
/** Shape of a sidenav YAML file (sidenav.yaml or any topnav-referenced file). */
|
|
11
|
+
export type SidenavConfig = SidenavItem[];
|
|
12
|
+
/** A single item in the top navigation bar. */
|
|
13
|
+
export interface TopnavItem {
|
|
14
|
+
/** Display text shown in the top navigation bar. */
|
|
23
15
|
label: string;
|
|
16
|
+
/** Route path prefix for this section. */
|
|
24
17
|
path: string;
|
|
18
|
+
/** Filename of the sidenav YAML file in config/navigation/ (e.g. "payments.yaml"). */
|
|
19
|
+
sidenav: string;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
/** Shape of the config/navigation/topnav.yaml file. */
|
|
22
|
+
export type TopnavConfig = TopnavItem[];
|
|
23
|
+
/**
|
|
24
|
+
* Resolved top navigation: each item paired with its loaded sidenav tree.
|
|
25
|
+
* This is the runtime representation after all referenced files are loaded.
|
|
26
|
+
*/
|
|
27
|
+
export interface ResolvedTopnavItem {
|
|
32
28
|
label: string;
|
|
33
|
-
path
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
export type LanguageSwitcher = LanguageAlternative[];
|
|
37
|
-
export interface NavigationContext {
|
|
38
|
-
currentPath: string;
|
|
39
|
-
currentLanguage: string;
|
|
40
|
-
sidenav: NavigationTree;
|
|
41
|
-
topnav?: NavigationTree;
|
|
42
|
-
pageNavigation: PageNavigation;
|
|
43
|
-
languageSwitcher: LanguageSwitcher;
|
|
29
|
+
path: string;
|
|
30
|
+
sidenav: SidenavConfig;
|
|
44
31
|
}
|
|
32
|
+
export type ResolvedTopnavConfig = ResolvedTopnavItem[];
|
|
45
33
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,WAAW,EAAE,CAAC;AAE1C,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,UAAU,EAAE,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,EAAE,CAAC"}
|
package/dist/types/navigation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { SiteConfig } from './site.js';
|
|
2
|
+
import type { LanguageConfig } from './language.js';
|
|
3
|
+
import type { ResolvedTopnavConfig, SidenavConfig } from './navigation.js';
|
|
4
|
+
import type { ResolvedAssets } from './assets.js';
|
|
5
|
+
import type { PageMeta, TransformedPage } from './content.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolved navigation for the site, discriminated by `kind`:
|
|
8
|
+
* - `topnav`: project has a top navigation bar; each entry owns its own sidenav.
|
|
9
|
+
* - `sidenav`: no topnav.yaml — the project uses a single, site-wide sidenav.
|
|
10
|
+
*
|
|
11
|
+
* Downstream consumers (Vite plugin, SSG renderer, React client) branch on
|
|
12
|
+
* `kind` so the two cases stay explicit and impossible to confuse.
|
|
13
|
+
*/
|
|
14
|
+
export type NavigationConfig = {
|
|
15
|
+
kind: 'topnav';
|
|
16
|
+
topnav: ResolvedTopnavConfig;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'sidenav';
|
|
19
|
+
sidenav: SidenavConfig;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The complete Mordoc data set for a project: every config object plus
|
|
23
|
+
* every transformed page. This is the single hand-off shape between the
|
|
24
|
+
* pipeline and its consumers.
|
|
25
|
+
*
|
|
26
|
+
* Both consumers — the Vite plugin in dev and the SSG build in prod —
|
|
27
|
+
* take a `MordocData` and translate it into virtual modules / pre-rendered
|
|
28
|
+
* HTML respectively. The pipeline itself stays Vite-agnostic; nothing in
|
|
29
|
+
* this type or its dependencies imports from any delivery framework.
|
|
30
|
+
*
|
|
31
|
+
* The shape is JSON-serializable (renderable trees are plain tags + strings),
|
|
32
|
+
* so it can be ferried across the dev/build boundary without any custom
|
|
33
|
+
* serialization.
|
|
34
|
+
*/
|
|
35
|
+
export interface MordocData {
|
|
36
|
+
site: SiteConfig;
|
|
37
|
+
/** Null when the project ships a single language and omits language.json. */
|
|
38
|
+
language: LanguageConfig | null;
|
|
39
|
+
navigation: NavigationConfig;
|
|
40
|
+
assets: ResolvedAssets;
|
|
41
|
+
pages: TransformedPage[];
|
|
42
|
+
/** Nav label translations keyed by language code. Empty for single-language projects. */
|
|
43
|
+
translations: Record<string, Record<string, string>>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The lightweight projection of `MordocData` consumed by the React shell —
|
|
47
|
+
* everything needed to render the site chrome (header, navigation, link
|
|
48
|
+
* lists), but none of the per-page content trees.
|
|
49
|
+
*
|
|
50
|
+
* Per-page content (`PageData`) is delivered through the route loader → lazy
|
|
51
|
+
* `virtual:mordoc/page/<routePath>` module on both the client and the server.
|
|
52
|
+
* Keeping `ShellData` content-free forces all per-page data through that one
|
|
53
|
+
* channel, which is what makes CSR and SSR symmetric: the server doesn't get
|
|
54
|
+
* a privileged "all pages already loaded" view that the client doesn't have.
|
|
55
|
+
*
|
|
56
|
+
* Three usage sites, one definition:
|
|
57
|
+
* 1. The value shape of `MordocDataContext` in the React tree.
|
|
58
|
+
* 2. The `data` parameter of `entry-server.tsx`'s `render()`.
|
|
59
|
+
* 3. The return type of `toShellData()` in `pipeline.ts`.
|
|
60
|
+
*/
|
|
61
|
+
export interface ShellData {
|
|
62
|
+
site: SiteConfig;
|
|
63
|
+
language: LanguageConfig | null;
|
|
64
|
+
navigation: NavigationConfig;
|
|
65
|
+
assets: ResolvedAssets;
|
|
66
|
+
pagesIndex: PageMeta[];
|
|
67
|
+
/** Nav label translations keyed by language code. Empty for single-language projects. */
|
|
68
|
+
translations: Record<string, Record<string, string>>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/types/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/types/pipeline.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Optional Open Graph and Twitter Card meta tags for social sharing previews. */
|
|
2
|
+
export interface SiteMetadata {
|
|
3
|
+
ogImage?: string;
|
|
4
|
+
ogType?: string;
|
|
5
|
+
twitterCard?: string;
|
|
6
|
+
twitterSite?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Top-level configuration for a Mordoc documentation site,
|
|
10
|
+
* as defined in the project's config/site.json file.
|
|
11
|
+
*/
|
|
12
|
+
export interface SiteConfig {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
/** Fully-qualified base URL with no trailing slash (e.g. "https://docs.example.com"). */
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
defaultLanguage: string;
|
|
18
|
+
metadata?: SiteMetadata;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=site.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../src/types/site.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.js","sourceRoot":"","sources":["../../src/types/site.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LanguageConfig } from '../types/language.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the active language code from the current pathname.
|
|
4
|
+
*
|
|
5
|
+
* The default language has no URL prefix, so `/flight-manual/safety` is
|
|
6
|
+
* English (or whichever `defaultLanguage` is). Only non-default language
|
|
7
|
+
* codes appear as the first path segment: `/de/flight-manual/safety` → `de`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function detectCurrentLang(pathname: string, language: LanguageConfig | null, defaultLanguage: string): string;
|
|
10
|
+
/** Returns `/<lang>` for non-default languages, or `''` for the default. */
|
|
11
|
+
export declare function buildLangPrefix(lang: string, defaultLanguage: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Strips the language prefix from a pathname to get the content-relative path.
|
|
14
|
+
* e.g. `/de/flight-manual/safety` → `/flight-manual/safety`
|
|
15
|
+
* `/flight-manual/safety` → `/flight-manual/safety` (default lang, unchanged)
|
|
16
|
+
*/
|
|
17
|
+
export declare function stripLangPrefix(pathname: string, lang: string, defaultLanguage: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Looks up a translated nav label for `lang`, falling back to `defaultLabel`
|
|
20
|
+
* when no translation is found (missing file, missing key, or default language).
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveLabel(defaultLabel: string, lang: string, defaultLanguage: string, translations: Record<string, Record<string, string>>): string;
|
|
23
|
+
//# sourceMappingURL=lang-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang-utils.d.ts","sourceRoot":"","sources":["../../src/utils/lang-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,eAAe,EAAE,MAAM,GACtB,MAAM,CAKR;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACnD,MAAM,CAGR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the active language code from the current pathname.
|
|
3
|
+
*
|
|
4
|
+
* The default language has no URL prefix, so `/flight-manual/safety` is
|
|
5
|
+
* English (or whichever `defaultLanguage` is). Only non-default language
|
|
6
|
+
* codes appear as the first path segment: `/de/flight-manual/safety` → `de`.
|
|
7
|
+
*/
|
|
8
|
+
export function detectCurrentLang(pathname, language, defaultLanguage) {
|
|
9
|
+
if (!language || language.languages.length <= 1)
|
|
10
|
+
return defaultLanguage;
|
|
11
|
+
const firstSegment = pathname.split('/').filter(Boolean)[0] ?? '';
|
|
12
|
+
const nonDefault = language.languages.filter((l) => l !== defaultLanguage);
|
|
13
|
+
return nonDefault.includes(firstSegment) ? firstSegment : defaultLanguage;
|
|
14
|
+
}
|
|
15
|
+
/** Returns `/<lang>` for non-default languages, or `''` for the default. */
|
|
16
|
+
export function buildLangPrefix(lang, defaultLanguage) {
|
|
17
|
+
return lang === defaultLanguage ? '' : `/${lang}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Strips the language prefix from a pathname to get the content-relative path.
|
|
21
|
+
* e.g. `/de/flight-manual/safety` → `/flight-manual/safety`
|
|
22
|
+
* `/flight-manual/safety` → `/flight-manual/safety` (default lang, unchanged)
|
|
23
|
+
*/
|
|
24
|
+
export function stripLangPrefix(pathname, lang, defaultLanguage) {
|
|
25
|
+
if (lang === defaultLanguage)
|
|
26
|
+
return pathname;
|
|
27
|
+
const prefix = `/${lang}`;
|
|
28
|
+
const stripped = pathname.startsWith(prefix) ? pathname.slice(prefix.length) : pathname;
|
|
29
|
+
return stripped || '/';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Looks up a translated nav label for `lang`, falling back to `defaultLabel`
|
|
33
|
+
* when no translation is found (missing file, missing key, or default language).
|
|
34
|
+
*/
|
|
35
|
+
export function resolveLabel(defaultLabel, lang, defaultLanguage, translations) {
|
|
36
|
+
if (lang === defaultLanguage)
|
|
37
|
+
return defaultLabel;
|
|
38
|
+
return translations[lang]?.[defaultLabel] ?? defaultLabel;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=lang-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang-utils.js","sourceRoot":"","sources":["../../src/utils/lang-utils.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,QAA+B,EAC/B,eAAuB;IAEvB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,eAAe,CAAC;IACxE,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClE,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,eAAe,CAAC,CAAC;IAC3E,OAAO,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC;AAC5E,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,eAAuB;IACnE,OAAO,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAgB,EAChB,IAAY,EACZ,eAAuB;IAEvB,IAAI,IAAI,KAAK,eAAe;QAAE,OAAO,QAAQ,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxF,OAAO,QAAQ,IAAI,GAAG,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,YAAoB,EACpB,IAAY,EACZ,eAAuB,EACvB,YAAoD;IAEpD,IAAI,IAAI,KAAK,eAAe;QAAE,OAAO,YAAY,CAAC;IAClD,OAAO,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the absolute path to mordoc's own package root.
|
|
3
|
+
*
|
|
4
|
+
* This file compiles to `dist/utils/paths.js`, which sits two directories
|
|
5
|
+
* below the package root. Using `import.meta.url` means the resolution
|
|
6
|
+
* works regardless of where mordoc is installed — in its own repo during
|
|
7
|
+
* development, or under `node_modules/mordoc/` in a user's project.
|
|
8
|
+
*
|
|
9
|
+
* Shared by `cli/dev.ts` and `cli/build.ts` because both Vite invocations
|
|
10
|
+
* (dev server, production build) point Vite's `root` at mordoc's own
|
|
11
|
+
* app source folder, not at anything inside the user's project.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPackageRoot(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the absolute path to the app source root that Vite uses as its
|
|
16
|
+
* `root` for both dev serving and production builds.
|
|
17
|
+
*
|
|
18
|
+
* This is where `index.html`, `main.tsx`, and `entry-server.tsx` live
|
|
19
|
+
* inside the mordoc package — all application source that Vite compiles
|
|
20
|
+
* in the user's environment. The user's project never points Vite at any
|
|
21
|
+
* of its own files; everything user-side flows through the mordoc plugin's
|
|
22
|
+
* virtual modules.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getAppRoot(): string;
|
|
25
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the absolute path to mordoc's own package root.
|
|
5
|
+
*
|
|
6
|
+
* This file compiles to `dist/utils/paths.js`, which sits two directories
|
|
7
|
+
* below the package root. Using `import.meta.url` means the resolution
|
|
8
|
+
* works regardless of where mordoc is installed — in its own repo during
|
|
9
|
+
* development, or under `node_modules/mordoc/` in a user's project.
|
|
10
|
+
*
|
|
11
|
+
* Shared by `cli/dev.ts` and `cli/build.ts` because both Vite invocations
|
|
12
|
+
* (dev server, production build) point Vite's `root` at mordoc's own
|
|
13
|
+
* app source folder, not at anything inside the user's project.
|
|
14
|
+
*/
|
|
15
|
+
export function getPackageRoot() {
|
|
16
|
+
return path.resolve(fileURLToPath(import.meta.url), '../../..');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the absolute path to the app source root that Vite uses as its
|
|
20
|
+
* `root` for both dev serving and production builds.
|
|
21
|
+
*
|
|
22
|
+
* This is where `index.html`, `main.tsx`, and `entry-server.tsx` live
|
|
23
|
+
* inside the mordoc package — all application source that Vite compiles
|
|
24
|
+
* in the user's environment. The user's project never points Vite at any
|
|
25
|
+
* of its own files; everything user-side flows through the mordoc plugin's
|
|
26
|
+
* virtual modules.
|
|
27
|
+
*/
|
|
28
|
+
export function getAppRoot() {
|
|
29
|
+
return path.join(getPackageRoot(), 'src', 'app');
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC"}
|