@wrikka/create-docs 0.1.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/README.md +137 -0
- package/bin/cli.js +408 -0
- package/dist/index.cjs +20 -0
- package/dist/index.d.cts +475 -0
- package/dist/index.d.ts +475 -0
- package/dist/index.js +20 -0
- package/docs/_dir.yml +2 -0
- package/docs/config.md +75 -0
- package/docs/data-sources.md +88 -0
- package/docs/deploy.md +38 -0
- package/docs/features.md +51 -0
- package/docs/getting-started.md +42 -0
- package/docs/index.md +34 -0
- package/docs/markdown.md +154 -0
- package/docs/theming.md +53 -0
- package/package.json +142 -0
- package/scripts/generate-docs-index.ts +111 -0
- package/scripts/github-pull.ts +124 -0
- package/src/adapters/config/index.ts +1 -0
- package/src/adapters/config/node-config-loader.ts +36 -0
- package/src/adapters/fs/fs-docs-loader.ts +31 -0
- package/src/adapters/fs/index.ts +12 -0
- package/src/adapters/fs/memory-fs.ts +60 -0
- package/src/adapters/fs/node-fs.ts +116 -0
- package/src/adapters/git/index.ts +164 -0
- package/src/adapters/github/github-pull.ts +340 -0
- package/src/adapters/index.ts +6 -0
- package/src/adapters/velite.ts +112 -0
- package/src/adapters/vite/docs-watcher.ts +36 -0
- package/src/adapters/vite/index.ts +2 -0
- package/src/adapters/vite/polling-watcher.ts +89 -0
- package/src/code-block-enhancements/index.ts +3 -0
- package/src/config/index.ts +15 -0
- package/src/content/index.ts +11 -0
- package/src/content-validation/index.ts +5 -0
- package/src/index.ts +174 -0
- package/src/live-editor/index.ts +7 -0
- package/src/modules/analytics/application/plausible-adapter.ts +103 -0
- package/src/modules/analytics/application/umami-adapter.ts +109 -0
- package/src/modules/analytics/domain/events/index.ts +37 -0
- package/src/modules/analytics/domain/models/index.ts +35 -0
- package/src/modules/analytics/domain/operations/analytics-operations.ts +67 -0
- package/src/modules/analytics/domain/validators/index.ts +50 -0
- package/src/modules/analytics/index.ts +9 -0
- package/src/modules/analytics/ports/analytics-port.ts +17 -0
- package/src/modules/analytics/types/analytics.ts +16 -0
- package/src/modules/api-docs/application/type-docs-adapter.ts +34 -0
- package/src/modules/api-docs/domain/events/index.ts +42 -0
- package/src/modules/api-docs/domain/models/index.ts +40 -0
- package/src/modules/api-docs/domain/operations/api-docs-operations.ts +59 -0
- package/src/modules/api-docs/domain/validators/index.ts +56 -0
- package/src/modules/api-docs/index.ts +8 -0
- package/src/modules/api-docs/ports/api-docs-port.ts +21 -0
- package/src/modules/api-docs/types/api-docs.ts +15 -0
- package/src/modules/api-reference/openapi.ts +166 -0
- package/src/modules/api-reference/orpc.ts +94 -0
- package/src/modules/code-block-enhancements/application/usecases/index.ts +39 -0
- package/src/modules/code-block-enhancements/domain/code-operations.ts +72 -0
- package/src/modules/code-block-enhancements/domain/events/index.ts +58 -0
- package/src/modules/code-block-enhancements/domain/index.ts +11 -0
- package/src/modules/code-block-enhancements/domain/models/index.ts +36 -0
- package/src/modules/code-block-enhancements/domain/validators/index.ts +50 -0
- package/src/modules/code-block-enhancements/index.ts +10 -0
- package/src/modules/code-block-enhancements/ports/index.ts +18 -0
- package/src/modules/code-block-enhancements/types/index.ts +37 -0
- package/src/modules/code-execution/application/sandbox-adapter.ts +44 -0
- package/src/modules/code-execution/domain/events/index.ts +58 -0
- package/src/modules/code-execution/domain/models/index.ts +33 -0
- package/src/modules/code-execution/domain/operations/execution-operations.ts +60 -0
- package/src/modules/code-execution/domain/validators/index.ts +50 -0
- package/src/modules/code-execution/index.ts +8 -0
- package/src/modules/code-execution/ports/execution-port.ts +15 -0
- package/src/modules/code-execution/types/execution.ts +15 -0
- package/src/modules/comments/application/giscus-adapter.ts +55 -0
- package/src/modules/comments/domain/events/index.ts +55 -0
- package/src/modules/comments/domain/models/index.ts +30 -0
- package/src/modules/comments/domain/operations/comment-operations.ts +46 -0
- package/src/modules/comments/domain/validators/index.ts +50 -0
- package/src/modules/comments/index.ts +8 -0
- package/src/modules/comments/ports/comment-port.ts +18 -0
- package/src/modules/comments/types/comments.ts +19 -0
- package/src/modules/config/application/usecases/index.ts +1 -0
- package/src/modules/config/application/usecases/loadConfig.ts +38 -0
- package/src/modules/config/application/workflows/index.ts +1 -0
- package/src/modules/config/application/workflows/validateConfig.ts +14 -0
- package/src/modules/config/domain/events/index.ts +50 -0
- package/src/modules/config/domain/models/index.ts +9 -0
- package/src/modules/config/domain/operations/defaults.ts +74 -0
- package/src/modules/config/domain/operations/index.ts +2 -0
- package/src/modules/config/domain/operations/resolve.ts +40 -0
- package/src/modules/config/domain/validators/index.ts +152 -0
- package/src/modules/config/index.ts +23 -0
- package/src/modules/config/ports/index.ts +15 -0
- package/src/modules/config/types/index.ts +113 -0
- package/src/modules/config/types/public.ts +19 -0
- package/src/modules/content/application/cache/index.ts +6 -0
- package/src/modules/content/application/cache/parse-cache.ts +6 -0
- package/src/modules/content/application/cache/parseCache.ts +56 -0
- package/src/modules/content/application/usecases/index.ts +2 -0
- package/src/modules/content/application/usecases/load-doc-page.ts +1 -0
- package/src/modules/content/application/usecases/loadDocPage.ts +111 -0
- package/src/modules/content/application/usecases/scanDocsDir.ts +105 -0
- package/src/modules/content/application/workflows/index.ts +1 -0
- package/src/modules/content/application/workflows/processDocs.ts +51 -0
- package/src/modules/content/domain/events/index.ts +61 -0
- package/src/modules/content/domain/models/index.ts +13 -0
- package/src/modules/content/domain/operations/build-page.ts +146 -0
- package/src/modules/content/domain/operations/buildPage.ts +93 -0
- package/src/modules/content/domain/operations/index.ts +17 -0
- package/src/modules/content/domain/operations/parse.ts +241 -0
- package/src/modules/content/domain/validators/frontmatter.ts +82 -0
- package/src/modules/content/domain/validators/index.ts +6 -0
- package/src/modules/content/index.ts +27 -0
- package/src/modules/content/ports/index.ts +45 -0
- package/src/modules/content/ports/velite.ts +134 -0
- package/src/modules/content/types/index.ts +76 -0
- package/src/modules/content/types/public.ts +1 -0
- package/src/modules/content-linting/application/builtin-linting-adapter.ts +82 -0
- package/src/modules/content-linting/domain/events/index.ts +58 -0
- package/src/modules/content-linting/domain/models/index.ts +46 -0
- package/src/modules/content-linting/domain/operations/linting-operations.ts +82 -0
- package/src/modules/content-linting/domain/validators/index.ts +50 -0
- package/src/modules/content-linting/index.ts +8 -0
- package/src/modules/content-linting/ports/linting-port.ts +21 -0
- package/src/modules/content-linting/types/linting.ts +18 -0
- package/src/modules/content-validation/application/usecases/index.ts +18 -0
- package/src/modules/content-validation/domain/events/index.ts +7 -0
- package/src/modules/content-validation/domain/index.ts +16 -0
- package/src/modules/content-validation/domain/models/index.ts +33 -0
- package/src/modules/content-validation/domain/operations/index.ts +157 -0
- package/src/modules/content-validation/domain/types/index.ts +17 -0
- package/src/modules/content-validation/domain/validators/index.ts +8 -0
- package/src/modules/content-validation/index.ts +9 -0
- package/src/modules/content-validation/ports/index.ts +15 -0
- package/src/modules/content-validation/types/index.ts +5 -0
- package/src/modules/export/application/puppeteer-export-adapter.ts +63 -0
- package/src/modules/export/domain/events/index.ts +55 -0
- package/src/modules/export/domain/models/index.ts +38 -0
- package/src/modules/export/domain/operations/export-operations.ts +56 -0
- package/src/modules/export/domain/validators/index.ts +52 -0
- package/src/modules/export/index.ts +8 -0
- package/src/modules/export/ports/export-port.ts +15 -0
- package/src/modules/export/types/export.ts +15 -0
- package/src/modules/external-search/application/algolia-adapter.ts +182 -0
- package/src/modules/external-search/application/meilisearch-adapter.ts +161 -0
- package/src/modules/external-search/domain/events/index.ts +42 -0
- package/src/modules/external-search/domain/models/index.ts +42 -0
- package/src/modules/external-search/domain/operations/search-operations.ts +53 -0
- package/src/modules/external-search/domain/validators/index.ts +55 -0
- package/src/modules/external-search/index.ts +9 -0
- package/src/modules/external-search/ports/external-search-port.ts +23 -0
- package/src/modules/external-search/types/search.ts +19 -0
- package/src/modules/git-history/application/simple-git-adapter.ts +46 -0
- package/src/modules/git-history/domain/events/index.ts +34 -0
- package/src/modules/git-history/domain/models/index.ts +25 -0
- package/src/modules/git-history/domain/operations/git-history-operations.ts +56 -0
- package/src/modules/git-history/domain/validators/index.ts +52 -0
- package/src/modules/git-history/index.ts +8 -0
- package/src/modules/git-history/ports/git-history-port.ts +21 -0
- package/src/modules/git-history/types/git-history.ts +15 -0
- package/src/modules/i18n/application/fs-locale-loader.ts +39 -0
- package/src/modules/i18n/domain/events/index.ts +34 -0
- package/src/modules/i18n/domain/models/index.ts +34 -0
- package/src/modules/i18n/domain/operations/locale-operations.ts +74 -0
- package/src/modules/i18n/domain/validators/index.ts +52 -0
- package/src/modules/i18n/index.ts +8 -0
- package/src/modules/i18n/ports/locale-loader-port.ts +18 -0
- package/src/modules/i18n/types/locale.ts +17 -0
- package/src/modules/image-optimization/application/sharp-adapter.ts +58 -0
- package/src/modules/image-optimization/domain/events/index.ts +39 -0
- package/src/modules/image-optimization/domain/models/index.ts +27 -0
- package/src/modules/image-optimization/domain/operations/image-operations.ts +65 -0
- package/src/modules/image-optimization/domain/validators/index.ts +52 -0
- package/src/modules/image-optimization/index.ts +8 -0
- package/src/modules/image-optimization/ports/image-optimizer-port.ts +15 -0
- package/src/modules/image-optimization/types/image.ts +17 -0
- package/src/modules/live-editor/application/usecases/index.ts +60 -0
- package/src/modules/live-editor/domain/events/index.ts +37 -0
- package/src/modules/live-editor/domain/gitOperations.ts +110 -0
- package/src/modules/live-editor/domain/index.ts +15 -0
- package/src/modules/live-editor/domain/models/index.ts +21 -0
- package/src/modules/live-editor/domain/validators/index.ts +55 -0
- package/src/modules/live-editor/index.ts +14 -0
- package/src/modules/live-editor/ports/index.ts +49 -0
- package/src/modules/live-editor/types/index.ts +80 -0
- package/src/modules/live-preview/application/vite-preview-adapter.ts +20 -0
- package/src/modules/live-preview/domain/operations/preview-operations.ts +56 -0
- package/src/modules/live-preview/index.ts +8 -0
- package/src/modules/live-preview/ports/preview-port.ts +20 -0
- package/src/modules/live-preview/types/preview.ts +16 -0
- package/src/modules/mdx/application/mdx-js-adapter.ts +38 -0
- package/src/modules/mdx/domain/operations/parse-mdx.ts +43 -0
- package/src/modules/mdx/index.ts +8 -0
- package/src/modules/mdx/ports/mdx-parser-port.ts +15 -0
- package/src/modules/mdx/types/mdx.ts +14 -0
- package/src/modules/navigation/application/usecases/buildNav.ts +15 -0
- package/src/modules/navigation/application/usecases/buildSidebar.ts +45 -0
- package/src/modules/navigation/application/usecases/index.ts +2 -0
- package/src/modules/navigation/domain/events/index.ts +30 -0
- package/src/modules/navigation/domain/models/index.ts +7 -0
- package/src/modules/navigation/domain/operations/group.ts +79 -0
- package/src/modules/navigation/domain/operations/index.ts +10 -0
- package/src/modules/navigation/domain/operations/sort.ts +27 -0
- package/src/modules/navigation/domain/shared/utils/array.ts +39 -0
- package/src/modules/navigation/domain/validators/index.ts +88 -0
- package/src/modules/navigation/index.ts +15 -0
- package/src/modules/navigation/ports/index.ts +9 -0
- package/src/modules/navigation/types/index.ts +38 -0
- package/src/modules/navigation/types/public.ts +9 -0
- package/src/modules/openapi/application/swagger-parser-adapter.ts +178 -0
- package/src/modules/openapi/domain/operations/parse-openapi.ts +46 -0
- package/src/modules/openapi/index.ts +8 -0
- package/src/modules/openapi/ports/openapi-parser-port.ts +15 -0
- package/src/modules/openapi/types/openapi.ts +37 -0
- package/src/modules/plugin/application/usecases/build-virtual-modules.ts +53 -0
- package/src/modules/plugin/application/usecases/index.ts +1 -0
- package/src/modules/plugin/application/workflows/build-docs.ts +79 -0
- package/src/modules/plugin/application/workflows/index.ts +1 -0
- package/src/modules/plugin/domain/events/index.ts +62 -0
- package/src/modules/plugin/domain/models/index.ts +1 -0
- package/src/modules/plugin/domain/operations/build-virtual.ts +76 -0
- package/src/modules/plugin/domain/operations/index.ts +11 -0
- package/src/modules/plugin/domain/validators/index.ts +30 -0
- package/src/modules/plugin/index.ts +14 -0
- package/src/modules/plugin/ports/index.ts +21 -0
- package/src/modules/plugin/types/index.ts +27 -0
- package/src/modules/plugin/types/public.ts +1 -0
- package/src/modules/search/application/usecases/index.ts +1 -0
- package/src/modules/search/application/usecases/indexPages.ts +15 -0
- package/src/modules/search/domain/events/index.ts +32 -0
- package/src/modules/search/domain/models/index.ts +1 -0
- package/src/modules/search/domain/operations/build-index.ts +6 -0
- package/src/modules/search/domain/operations/buildIndex.ts +70 -0
- package/src/modules/search/domain/operations/index.ts +7 -0
- package/src/modules/search/domain/operations/query.ts +186 -0
- package/src/modules/search/domain/validators/index.ts +32 -0
- package/src/modules/search/index.ts +9 -0
- package/src/modules/search/types/index.ts +22 -0
- package/src/modules/search/types/public.ts +1 -0
- package/src/modules/search-analytics/application/local-storage-adapter.ts +68 -0
- package/src/modules/search-analytics/domain/operations/search-analytics-operations.ts +74 -0
- package/src/modules/search-analytics/index.ts +8 -0
- package/src/modules/search-analytics/ports/search-analytics-port.ts +20 -0
- package/src/modules/search-analytics/types/search-analytics.ts +16 -0
- package/src/modules/search-highlighting/application/dom-highlighting-adapter.ts +36 -0
- package/src/modules/search-highlighting/domain/operations/highlighting-operations.ts +72 -0
- package/src/modules/search-highlighting/index.ts +8 -0
- package/src/modules/search-highlighting/ports/highlighting-port.ts +14 -0
- package/src/modules/search-highlighting/types/highlighting.ts +15 -0
- package/src/modules/seo-optimization/application/usecases/index.ts +18 -0
- package/src/modules/seo-optimization/domain/index.ts +12 -0
- package/src/modules/seo-optimization/domain/seoOperations.ts +92 -0
- package/src/modules/seo-optimization/index.ts +8 -0
- package/src/modules/seo-optimization/ports/index.ts +18 -0
- package/src/modules/seo-optimization/types/index.ts +41 -0
- package/src/modules/theme/application/css-theme-adapter.ts +50 -0
- package/src/modules/theme/domain/operations/theme-operations.ts +68 -0
- package/src/modules/theme/index.ts +8 -0
- package/src/modules/theme/ports/theme-port.ts +8 -0
- package/src/modules/theme/types/theme.ts +12 -0
- package/src/modules/toc/application/markdown-toc-adapter.ts +106 -0
- package/src/modules/toc/domain/operations/toc-operations.ts +92 -0
- package/src/modules/toc/index.ts +8 -0
- package/src/modules/toc/ports/toc-port.ts +21 -0
- package/src/modules/toc/types/toc.ts +17 -0
- package/src/modules/toc-generator/application/usecases/index.ts +30 -0
- package/src/modules/toc-generator/domain/index.ts +12 -0
- package/src/modules/toc-generator/domain/tocOperations.ts +104 -0
- package/src/modules/toc-generator/index.ts +9 -0
- package/src/modules/toc-generator/ports/index.ts +20 -0
- package/src/modules/toc-generator/types/index.ts +50 -0
- package/src/modules/version-control/domain/events/index.ts +39 -0
- package/src/modules/version-control/domain/models/index.ts +25 -0
- package/src/modules/version-control/domain/validators/index.ts +50 -0
- package/src/modules/versioning/application/fs-version-loader.ts +44 -0
- package/src/modules/versioning/domain/operations/versioning-operations.ts +80 -0
- package/src/modules/versioning/index.ts +8 -0
- package/src/modules/versioning/ports/version-loader-port.ts +18 -0
- package/src/modules/versioning/types/versioning.ts +17 -0
- package/src/modules/workflow/domain/events/index.ts +55 -0
- package/src/modules/workflow/domain/models/index.ts +40 -0
- package/src/modules/workflow/domain/validators/index.ts +50 -0
- package/src/modules/yaml-parser/application/js-yaml-adapter.ts +34 -0
- package/src/modules/yaml-parser/domain/operations/parse-yaml.ts +58 -0
- package/src/modules/yaml-parser/index.ts +7 -0
- package/src/modules/yaml-parser/ports/yaml-parser-port.ts +18 -0
- package/src/navigation/index.ts +9 -0
- package/src/plugin/index.ts +4 -0
- package/src/presentation/index.ts +1 -0
- package/src/presentation/live-editor/index.ts +22 -0
- package/src/presentation/live-editor/live-editor-component.ts +219 -0
- package/src/presentation/live-editor/virtual-module.ts +16 -0
- package/src/presentation/solid/CodeBlock.tsx +120 -0
- package/src/presentation/solid/Toc.tsx +58 -0
- package/src/presentation/solid/index.ts +11 -0
- package/src/presentation/vite-plugin/docs-plugin.ts +212 -0
- package/src/presentation/vite-plugin/index.ts +9 -0
- package/src/presentation/vite-plugin/transform-markdown.ts +26 -0
- package/src/runtime/analytics.ts +59 -0
- package/src/runtime/api-diff.ts +115 -0
- package/src/runtime/app.tsx +32 -0
- package/src/runtime/components/AccentPicker.tsx +114 -0
- package/src/runtime/components/ApiPlayground.tsx +332 -0
- package/src/runtime/components/AskAiDialog.tsx +127 -0
- package/src/runtime/components/BackToTop.tsx +38 -0
- package/src/runtime/components/Banner.tsx +75 -0
- package/src/runtime/components/Breadcrumbs.tsx +42 -0
- package/src/runtime/components/CollectionDropdown.tsx +85 -0
- package/src/runtime/components/CustomizeDrawer.tsx +195 -0
- package/src/runtime/components/DocMarkdown.tsx +579 -0
- package/src/runtime/components/DocPrevNext.tsx +54 -0
- package/src/runtime/components/DocToc.tsx +147 -0
- package/src/runtime/components/DocsDropdown.tsx +184 -0
- package/src/runtime/components/Footer.tsx +52 -0
- package/src/runtime/components/GitHubAuth.tsx +82 -0
- package/src/runtime/components/GitHubStats.tsx +73 -0
- package/src/runtime/components/Head.tsx +225 -0
- package/src/runtime/components/LocaleDropdown.tsx +75 -0
- package/src/runtime/components/MobileBottomNav.tsx +111 -0
- package/src/runtime/components/NotFound.tsx +139 -0
- package/src/runtime/components/PageActions.tsx +144 -0
- package/src/runtime/components/RelatedDocs.tsx +50 -0
- package/src/runtime/components/ScrollProgress.tsx +32 -0
- package/src/runtime/components/SearchPalette.tsx +333 -0
- package/src/runtime/components/ShowcaseCard.tsx +87 -0
- package/src/runtime/components/SidebarNav.tsx +237 -0
- package/src/runtime/components/Skeleton.tsx +39 -0
- package/src/runtime/components/ThemeToggle.tsx +26 -0
- package/src/runtime/components/TopNav.tsx +270 -0
- package/src/runtime/components/VersionDropdown.tsx +189 -0
- package/src/runtime/components/markdown/components.ts +280 -0
- package/src/runtime/config.ts +225 -0
- package/src/runtime/content.ts +451 -0
- package/src/runtime/context.tsx +30 -0
- package/src/runtime/data.ts +93 -0
- package/src/runtime/github.ts +226 -0
- package/src/runtime/icons.ts +32 -0
- package/src/runtime/index.ts +153 -0
- package/src/runtime/layouts/DocsLayout.tsx +144 -0
- package/src/runtime/markdown-content.css +996 -0
- package/src/runtime/pages/AbTestPage.tsx +88 -0
- package/src/runtime/pages/AnalyticsPage.tsx +90 -0
- package/src/runtime/pages/ApiDiffPage.tsx +86 -0
- package/src/runtime/pages/ApiEndpointPage.tsx +248 -0
- package/src/runtime/pages/BuilderPage.tsx +150 -0
- package/src/runtime/pages/ChangelogPage.tsx +210 -0
- package/src/runtime/pages/CollectionPage.tsx +140 -0
- package/src/runtime/pages/CommunityPage.tsx +384 -0
- package/src/runtime/pages/CreatePage.tsx +448 -0
- package/src/runtime/pages/DocPage.tsx +193 -0
- package/src/runtime/pages/EditPage.tsx +201 -0
- package/src/runtime/pages/HomePage.tsx +187 -0
- package/src/runtime/pages/IssuesPage.tsx +140 -0
- package/src/runtime/pages/OAuthCallbackPage.tsx +80 -0
- package/src/runtime/pages/PluginsPage.tsx +249 -0
- package/src/runtime/pages/ShowcasePage.tsx +202 -0
- package/src/runtime/pwa.ts +39 -0
- package/src/runtime/router.tsx +192 -0
- package/src/runtime/seo.ts +192 -0
- package/src/runtime/theme.css +175 -0
- package/src/runtime/theme.ts +224 -0
- package/src/runtime/types.ts +217 -0
- package/src/search/index.ts +6 -0
- package/src/seo-optimization/index.ts +4 -0
- package/src/shared/constants/index.ts +26 -0
- package/src/shared/errors/index.ts +195 -0
- package/src/shared/index.ts +27 -0
- package/src/shared/types/brand.ts +14 -0
- package/src/shared/types/client.d.ts +45 -0
- package/src/shared/types/either.ts +38 -0
- package/src/shared/types/index.ts +42 -0
- package/src/shared/types/option.ts +52 -0
- package/src/shared/types/result.ts +81 -0
- package/src/shared/utils/array.ts +97 -0
- package/src/shared/utils/index.ts +46 -0
- package/src/shared/utils/object.ts +47 -0
- package/src/shared/utils/string.ts +74 -0
- package/src/toc-generator/index.ts +1 -0
- package/src/types/js-yaml.d.ts +42 -0
- package/src/worker.ts +462 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain error types — tagged unions for typed failures.
|
|
3
|
+
*
|
|
4
|
+
* Each module can extend this with its own error variants, but
|
|
5
|
+
* all errors should flow through these base types at boundaries.
|
|
6
|
+
*/
|
|
7
|
+
type AppErrorKind = "file_not_found" | "parse_error" | "validation_error" | "config_error" | "io_error" | "plugin_error";
|
|
8
|
+
interface AppError {
|
|
9
|
+
readonly kind: AppErrorKind;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
readonly cause?: unknown;
|
|
12
|
+
readonly context?: Readonly<Record<string, unknown>>;
|
|
13
|
+
/** JSON-pointer-like path to the offending field (e.g. "site.title"). */
|
|
14
|
+
readonly path?: string;
|
|
15
|
+
/** Actionable hint shown to the user (e.g. allowed values). */
|
|
16
|
+
readonly hint?: string;
|
|
17
|
+
/** Documentation URL related to this error. */
|
|
18
|
+
readonly docsUrl?: string;
|
|
19
|
+
/** Allowed values, for inline suggestions. */
|
|
20
|
+
readonly suggestions?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result<T, E> — A pure algebraic data type for synchronous operations
|
|
24
|
+
* that can fail with a typed error.
|
|
25
|
+
*
|
|
26
|
+
* Use this over throwing exceptions at the boundaries (domain, application).
|
|
27
|
+
* Domain must never throw — only return Result.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const divide = (a: number, b: number): Result<number, string> =>
|
|
31
|
+
* b === 0 ? err('Division by zero') : ok(a / b);
|
|
32
|
+
*/
|
|
33
|
+
type Result<
|
|
34
|
+
T,
|
|
35
|
+
E
|
|
36
|
+
> = {
|
|
37
|
+
readonly ok: true;
|
|
38
|
+
readonly value: T;
|
|
39
|
+
} | {
|
|
40
|
+
readonly ok: false;
|
|
41
|
+
readonly error: E;
|
|
42
|
+
};
|
|
43
|
+
declare const ok: <T>(value: T) => Result<T, never>;
|
|
44
|
+
declare const err: <E>(error: E) => Result<never, E>;
|
|
45
|
+
declare const isOk: <
|
|
46
|
+
T,
|
|
47
|
+
E
|
|
48
|
+
>(r: Result<T, E>) => r is {
|
|
49
|
+
ok: true;
|
|
50
|
+
value: T;
|
|
51
|
+
};
|
|
52
|
+
declare const isErr: <
|
|
53
|
+
T,
|
|
54
|
+
E
|
|
55
|
+
>(r: Result<T, E>) => r is {
|
|
56
|
+
ok: false;
|
|
57
|
+
error: E;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Brand<T, B> — A nominal type for primitives (preventing ID mixups at compile time).
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* type UserId = Brand<string, 'UserId'>;
|
|
64
|
+
* type PostId = Brand<string, 'PostId'>;
|
|
65
|
+
* const get = (id: UserId) => ...;
|
|
66
|
+
* get('abc' as UserId); // OK
|
|
67
|
+
* get('abc' as PostId); // compile error
|
|
68
|
+
*/
|
|
69
|
+
type Brand<
|
|
70
|
+
T,
|
|
71
|
+
B extends string
|
|
72
|
+
> = T & {
|
|
73
|
+
readonly __brand: B;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Either<L, R> — A pure algebraic data type for a value that can be one of two types.
|
|
77
|
+
*
|
|
78
|
+
* Convention: L = "left" (often an error/short-circuit), R = "right" (success/continuation).
|
|
79
|
+
*
|
|
80
|
+
* Use this when you need to model two valid outcomes (e.g., a value OR a reason it isn't applicable)
|
|
81
|
+
* without committing to Result's "err" semantics.
|
|
82
|
+
*/
|
|
83
|
+
type Either<
|
|
84
|
+
L,
|
|
85
|
+
R
|
|
86
|
+
> = {
|
|
87
|
+
readonly tag: "left";
|
|
88
|
+
readonly left: L;
|
|
89
|
+
} | {
|
|
90
|
+
readonly tag: "right";
|
|
91
|
+
readonly right: R;
|
|
92
|
+
};
|
|
93
|
+
declare const left: <L>(value: L) => Either<L, never>;
|
|
94
|
+
declare const right: <R>(value: R) => Either<never, R>;
|
|
95
|
+
/**
|
|
96
|
+
* Option<T> — A pure algebraic data type for values that may be absent.
|
|
97
|
+
*
|
|
98
|
+
* Use this to model nullable values without `null | undefined` leakage.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const findUser = (id: string): Option<User> =>
|
|
102
|
+
* users.has(id) ? some(users.get(id)!) : none;
|
|
103
|
+
*/
|
|
104
|
+
type Option<T> = {
|
|
105
|
+
readonly kind: "some";
|
|
106
|
+
readonly value: T;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: "none";
|
|
109
|
+
};
|
|
110
|
+
declare const some: <T>(value: T) => Option<T>;
|
|
111
|
+
declare const none: <T = never>() => Option<T>;
|
|
112
|
+
declare const isSome: <T>(o: Option<T>) => o is {
|
|
113
|
+
kind: "some";
|
|
114
|
+
value: T;
|
|
115
|
+
};
|
|
116
|
+
declare const isNone: <T>(o: Option<T>) => o is {
|
|
117
|
+
kind: "none";
|
|
118
|
+
};
|
|
119
|
+
type BadgeVariant = "default" | "success" | "warning" | "danger";
|
|
120
|
+
interface NavItem {
|
|
121
|
+
readonly label: string;
|
|
122
|
+
readonly href?: string;
|
|
123
|
+
readonly items?: readonly NavItem[];
|
|
124
|
+
readonly badge?: string;
|
|
125
|
+
readonly icon?: string;
|
|
126
|
+
}
|
|
127
|
+
interface NavSection {
|
|
128
|
+
readonly title: string;
|
|
129
|
+
readonly items: readonly NavItem[];
|
|
130
|
+
}
|
|
131
|
+
interface SidebarItem {
|
|
132
|
+
readonly title: string;
|
|
133
|
+
readonly slug: string;
|
|
134
|
+
readonly badge?: string;
|
|
135
|
+
readonly badgeVariant?: BadgeVariant;
|
|
136
|
+
readonly items?: readonly SidebarItem[];
|
|
137
|
+
}
|
|
138
|
+
interface SidebarGroup {
|
|
139
|
+
readonly title: string;
|
|
140
|
+
readonly icon?: string;
|
|
141
|
+
readonly items: readonly SidebarItem[];
|
|
142
|
+
readonly collapsed?: boolean;
|
|
143
|
+
}
|
|
144
|
+
type DocSlug = Brand<string, "DocSlug">;
|
|
145
|
+
type DocId = Brand<string, "DocId">;
|
|
146
|
+
type FilePath = Brand<string, "FilePath">;
|
|
147
|
+
type BadgeVariant2 = "default" | "success" | "warning" | "danger";
|
|
148
|
+
/** A single heading extracted from page body. */
|
|
149
|
+
interface TocItem {
|
|
150
|
+
readonly id: string;
|
|
151
|
+
readonly text: string;
|
|
152
|
+
readonly depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
153
|
+
}
|
|
154
|
+
/** Per-page metadata derived from the body (not user-authored). */
|
|
155
|
+
interface PageMetadata {
|
|
156
|
+
readonly readingTime: number;
|
|
157
|
+
readonly wordCount: number;
|
|
158
|
+
readonly lastModified?: string;
|
|
159
|
+
readonly editUrl?: string;
|
|
160
|
+
}
|
|
161
|
+
/** Readonly data model for a doc page's frontmatter. */
|
|
162
|
+
interface Frontmatter {
|
|
163
|
+
readonly title?: string;
|
|
164
|
+
readonly description?: string;
|
|
165
|
+
readonly order?: number;
|
|
166
|
+
readonly badge?: string;
|
|
167
|
+
readonly badgeVariant?: BadgeVariant2;
|
|
168
|
+
readonly collapsible?: boolean;
|
|
169
|
+
readonly category?: string;
|
|
170
|
+
readonly author?: string;
|
|
171
|
+
readonly lastUpdated?: string;
|
|
172
|
+
readonly tags?: readonly string[];
|
|
173
|
+
readonly draft?: boolean;
|
|
174
|
+
readonly [key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
/** A single doc page, ready for downstream consumption. */
|
|
177
|
+
interface DocPage {
|
|
178
|
+
readonly id: DocId;
|
|
179
|
+
readonly slug: DocSlug;
|
|
180
|
+
readonly title: string;
|
|
181
|
+
readonly description?: string;
|
|
182
|
+
readonly frontmatter: Frontmatter;
|
|
183
|
+
readonly content: string;
|
|
184
|
+
readonly rawContent: string;
|
|
185
|
+
readonly filePath: FilePath;
|
|
186
|
+
readonly group?: string;
|
|
187
|
+
readonly order: number;
|
|
188
|
+
readonly toc: readonly TocItem[];
|
|
189
|
+
readonly metadata: PageMetadata;
|
|
190
|
+
}
|
|
191
|
+
/** Reads raw file contents from disk. */
|
|
192
|
+
interface FileReader {
|
|
193
|
+
read(filePath: FilePath): Promise<Result<string, AppError>>;
|
|
194
|
+
exists(filePath: FilePath): Promise<boolean>;
|
|
195
|
+
stat(filePath: FilePath): Promise<Result<{
|
|
196
|
+
mtimeMs: number;
|
|
197
|
+
size: number;
|
|
198
|
+
}, AppError>>;
|
|
199
|
+
}
|
|
200
|
+
/** Reads directory entries, recursively. */
|
|
201
|
+
interface DirectoryScanner {
|
|
202
|
+
list(dirPath: string): Promise<Result<readonly DirectoryEntry[], AppError>>;
|
|
203
|
+
}
|
|
204
|
+
/** A single entry returned by a directory scanner. */
|
|
205
|
+
interface DirectoryEntry {
|
|
206
|
+
readonly name: string;
|
|
207
|
+
readonly isDirectory: boolean;
|
|
208
|
+
readonly path: string;
|
|
209
|
+
}
|
|
210
|
+
/** Watches a directory for file system changes. */
|
|
211
|
+
interface FileWatcher {
|
|
212
|
+
watch(dir: string, handlers: {
|
|
213
|
+
onChange: (filePath: string) => void;
|
|
214
|
+
onError: (err: unknown) => void;
|
|
215
|
+
}): {
|
|
216
|
+
close: () => void;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
type AuthType = "bearer" | "apiKey" | "oauth2";
|
|
220
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
221
|
+
interface ApiEndpoint {
|
|
222
|
+
readonly method: HttpMethod;
|
|
223
|
+
readonly path: string;
|
|
224
|
+
readonly description: string;
|
|
225
|
+
readonly group: string;
|
|
226
|
+
readonly requiresAuth?: boolean;
|
|
227
|
+
readonly requestBody?: {
|
|
228
|
+
readonly description: string;
|
|
229
|
+
readonly example?: string;
|
|
230
|
+
readonly schema?: Record<string, unknown>;
|
|
231
|
+
};
|
|
232
|
+
readonly response?: {
|
|
233
|
+
readonly description: string;
|
|
234
|
+
readonly example?: string;
|
|
235
|
+
readonly schema?: Record<string, unknown>;
|
|
236
|
+
};
|
|
237
|
+
readonly queryParams?: readonly {
|
|
238
|
+
readonly name: string;
|
|
239
|
+
readonly type: string;
|
|
240
|
+
readonly description: string;
|
|
241
|
+
readonly required?: boolean;
|
|
242
|
+
readonly default?: string;
|
|
243
|
+
}[];
|
|
244
|
+
readonly pathParams?: readonly {
|
|
245
|
+
readonly name: string;
|
|
246
|
+
readonly type: string;
|
|
247
|
+
readonly description: string;
|
|
248
|
+
}[];
|
|
249
|
+
readonly headers?: readonly {
|
|
250
|
+
readonly name: string;
|
|
251
|
+
readonly type: string;
|
|
252
|
+
readonly description: string;
|
|
253
|
+
readonly required?: boolean;
|
|
254
|
+
}[];
|
|
255
|
+
}
|
|
256
|
+
interface ThemeConfig {
|
|
257
|
+
readonly primaryColor?: string;
|
|
258
|
+
readonly darkMode?: boolean;
|
|
259
|
+
readonly accentColor?: string;
|
|
260
|
+
readonly codeTheme?: string;
|
|
261
|
+
}
|
|
262
|
+
interface SiteConfig {
|
|
263
|
+
readonly title: string;
|
|
264
|
+
readonly description: string;
|
|
265
|
+
readonly logo?: string;
|
|
266
|
+
readonly logoDark?: string;
|
|
267
|
+
readonly github?: string;
|
|
268
|
+
readonly twitter?: string;
|
|
269
|
+
readonly version?: string;
|
|
270
|
+
}
|
|
271
|
+
interface ApiConfig {
|
|
272
|
+
readonly baseUrl: string;
|
|
273
|
+
readonly authType: AuthType;
|
|
274
|
+
readonly authHeader?: string;
|
|
275
|
+
readonly defaultHeaders?: Record<string, string>;
|
|
276
|
+
readonly testerEnabled?: boolean;
|
|
277
|
+
readonly endpoints?: readonly ApiEndpoint[];
|
|
278
|
+
}
|
|
279
|
+
interface SearchConfig {
|
|
280
|
+
readonly enabled?: boolean;
|
|
281
|
+
readonly placeholder?: string;
|
|
282
|
+
readonly shortcuts?: readonly string[];
|
|
283
|
+
}
|
|
284
|
+
interface EditLinkConfig {
|
|
285
|
+
readonly enabled?: boolean;
|
|
286
|
+
readonly baseUrl?: string;
|
|
287
|
+
readonly branch?: string;
|
|
288
|
+
}
|
|
289
|
+
interface LastUpdatedConfig {
|
|
290
|
+
readonly enabled?: boolean;
|
|
291
|
+
readonly format?: string;
|
|
292
|
+
}
|
|
293
|
+
interface DocsConfig {
|
|
294
|
+
readonly site: SiteConfig;
|
|
295
|
+
readonly nav: readonly NavSection[];
|
|
296
|
+
readonly sidebar: readonly SidebarGroup[];
|
|
297
|
+
readonly theme?: ThemeConfig;
|
|
298
|
+
readonly api?: ApiConfig;
|
|
299
|
+
readonly search?: SearchConfig;
|
|
300
|
+
readonly editLink?: EditLinkConfig;
|
|
301
|
+
readonly lastUpdated?: LastUpdatedConfig;
|
|
302
|
+
}
|
|
303
|
+
/** Plugin-specific options layered on top of DocsConfig. */
|
|
304
|
+
interface DocsPluginOptions {
|
|
305
|
+
readonly docsDir?: string;
|
|
306
|
+
readonly baseRoute?: string;
|
|
307
|
+
}
|
|
308
|
+
type ResolvedDocsConfig = DocsConfig & {
|
|
309
|
+
readonly docsDir: string;
|
|
310
|
+
readonly baseRoute: string;
|
|
311
|
+
};
|
|
312
|
+
type UserConfig = Partial<DocsConfig> & DocsPluginOptions;
|
|
313
|
+
/** Loads a DocsConfig from a project file (e.g. docs/docs.config.ts). */
|
|
314
|
+
interface ConfigLoader {
|
|
315
|
+
load(cwd: string, configPath: string): Promise<Result<Partial<DocsConfig> | null, AppError>>;
|
|
316
|
+
}
|
|
317
|
+
declare const createNodeConfigLoader: () => ConfigLoader;
|
|
318
|
+
interface DocsLoader {
|
|
319
|
+
loadAll(config: ResolvedDocsConfig): Promise<Result<readonly DocPage[], AppError>>;
|
|
320
|
+
}
|
|
321
|
+
interface DocsWatcher {
|
|
322
|
+
watch(docsDir: string, onChange: (filePath: string) => void): {
|
|
323
|
+
close: () => void;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
declare const createFsDocsLoader: () => DocsLoader;
|
|
327
|
+
interface MemoryFileSystem {
|
|
328
|
+
readonly files: ReadonlyMap<string, string>;
|
|
329
|
+
readonly directories: ReadonlyMap<string, readonly string[]>;
|
|
330
|
+
}
|
|
331
|
+
declare const memoryFileSystem: (files: ReadonlyMap<string, string>, directories: ReadonlyMap<string, readonly string[]>) => MemoryFileSystem;
|
|
332
|
+
declare const createMemoryFileReader: (fs: MemoryFileSystem) => FileReader;
|
|
333
|
+
declare const createMemoryDirectoryScanner: (fs: MemoryFileSystem) => DirectoryScanner;
|
|
334
|
+
declare const nodeFileReader: FileReader;
|
|
335
|
+
declare const nodeDirectoryScanner: DirectoryScanner;
|
|
336
|
+
declare const nodeFileWatcher: FileWatcher;
|
|
337
|
+
declare const createNodeDocsWatcher: () => DocsWatcher;
|
|
338
|
+
type CodeBlock = unknown;
|
|
339
|
+
type CodeBlockOptions = unknown;
|
|
340
|
+
declare const enhanceCodeBlocks: () => null;
|
|
341
|
+
type ApiConfig2 = unknown;
|
|
342
|
+
type ApiEndpoint2 = unknown;
|
|
343
|
+
type AuthType2 = unknown;
|
|
344
|
+
type DocsConfig2 = unknown;
|
|
345
|
+
type DocsPluginOptions2 = unknown;
|
|
346
|
+
type EditLinkConfig2 = unknown;
|
|
347
|
+
type HttpMethod2 = unknown;
|
|
348
|
+
type LastUpdatedConfig2 = unknown;
|
|
349
|
+
type ResolvedDocsConfig2 = unknown;
|
|
350
|
+
type SearchConfig2 = unknown;
|
|
351
|
+
type SiteConfig2 = unknown;
|
|
352
|
+
type ThemeConfig2 = unknown;
|
|
353
|
+
declare const defaultDocsConfig2: () => null;
|
|
354
|
+
declare const resolveConfig2: () => null;
|
|
355
|
+
declare const validateDocsConfig2: () => null;
|
|
356
|
+
type BadgeVariant3 = unknown;
|
|
357
|
+
type DocFile2 = unknown;
|
|
358
|
+
type DocId2 = unknown;
|
|
359
|
+
type DocPage2 = unknown;
|
|
360
|
+
type DocSlug2 = unknown;
|
|
361
|
+
type FilePath2 = unknown;
|
|
362
|
+
type Frontmatter2 = unknown;
|
|
363
|
+
type ParsedContent2 = unknown;
|
|
364
|
+
declare const buildDocPage2: () => null;
|
|
365
|
+
declare const buildDocPageFromRaw2: () => null;
|
|
366
|
+
declare const parseFrontmatter2: () => null;
|
|
367
|
+
type ContentValidator = unknown;
|
|
368
|
+
type ValidationError = unknown;
|
|
369
|
+
type ValidationOptions = unknown;
|
|
370
|
+
type ValidationResult = unknown;
|
|
371
|
+
declare const validate: () => null;
|
|
372
|
+
type CommitOptions2 = unknown;
|
|
373
|
+
type GitAdapter2 = unknown;
|
|
374
|
+
type GitStatus2 = unknown;
|
|
375
|
+
type PushOptions2 = unknown;
|
|
376
|
+
declare const commitAndPush: () => null;
|
|
377
|
+
declare const loadEditorState: () => null;
|
|
378
|
+
declare const saveFile: () => null;
|
|
379
|
+
type NavItem2 = unknown;
|
|
380
|
+
type NavSection2 = unknown;
|
|
381
|
+
type Sidebar2 = unknown;
|
|
382
|
+
type SidebarGroup2 = unknown;
|
|
383
|
+
type SidebarItem2 = unknown;
|
|
384
|
+
declare const buildNav2: () => null;
|
|
385
|
+
declare const buildSidebar2: () => null;
|
|
386
|
+
declare const formatGroupTitle2: () => null;
|
|
387
|
+
declare const groupDocsByFolder2: () => null;
|
|
388
|
+
type VirtualModuleSet2 = unknown;
|
|
389
|
+
declare const buildVirtualModules2: () => null;
|
|
390
|
+
declare const isMarkdownPath2: () => null;
|
|
391
|
+
declare const isVirtualDocsModule2: () => null;
|
|
392
|
+
import { Plugin } from "vite";
|
|
393
|
+
type WatchMode = "native" | "polling";
|
|
394
|
+
interface DocsPluginConfig extends Partial<UserConfig> {
|
|
395
|
+
/** Optional: explicit config object passed by the consumer. */
|
|
396
|
+
readonly userConfig?: UserConfig;
|
|
397
|
+
/** Optional: pre-resolved plugin options override. */
|
|
398
|
+
readonly options?: DocsPluginOptions;
|
|
399
|
+
/** Force a full browser reload on HMR (default: false, granular invalidation). */
|
|
400
|
+
readonly fullReload?: boolean;
|
|
401
|
+
/** Watcher mode. Default: 'native'. Use 'polling' for Linux subdir reliability. */
|
|
402
|
+
readonly watchMode?: WatchMode;
|
|
403
|
+
/** Polling interval in ms when watchMode='polling'. Default: 300. */
|
|
404
|
+
readonly pollingIntervalMs?: number;
|
|
405
|
+
/** Per-page transformation hook. Invoked after parse, before serialisation. */
|
|
406
|
+
readonly transformPage?: (page: DocPage) => DocPage | Promise<DocPage>;
|
|
407
|
+
}
|
|
408
|
+
declare const docsPlugin: (cfg?: DocsPluginConfig) => Plugin;
|
|
409
|
+
type MarkdownToSvelte = (raw: string, deps: {
|
|
410
|
+
readonly parse: (content: string) => Promise<unknown>;
|
|
411
|
+
}) => Promise<string>;
|
|
412
|
+
declare const transformMarkdown: MarkdownToSvelte;
|
|
413
|
+
type SearchEntry2 = unknown;
|
|
414
|
+
type SearchIndex2 = unknown;
|
|
415
|
+
declare const buildSearchIndex2: () => null;
|
|
416
|
+
declare const indexPages2: () => null;
|
|
417
|
+
declare const pageToSearchEntry2: () => null;
|
|
418
|
+
declare const search2: () => null;
|
|
419
|
+
type MetaTagGenerator = unknown;
|
|
420
|
+
type MetaTags = unknown;
|
|
421
|
+
type SeoOptions = unknown;
|
|
422
|
+
declare const optimizeSeo: () => null;
|
|
423
|
+
/**
|
|
424
|
+
* Compile-time static constants. These are the only safe values
|
|
425
|
+
* to import in the domain layer (where I/O is forbidden).
|
|
426
|
+
*/
|
|
427
|
+
declare const DEFAULT_DOCS_DIR: "docs";
|
|
428
|
+
declare const DEFAULT_BASE_ROUTE: "/docs";
|
|
429
|
+
declare const VIRTUAL_PREFIX: "virtual:docs/";
|
|
430
|
+
declare const PLUGIN_NAME: "vite-plugin-docs";
|
|
431
|
+
declare const SUPPORTED_EXTENSIONS: readonly [".md", ".mdoc"];
|
|
432
|
+
/**
|
|
433
|
+
* TOC Generator Types
|
|
434
|
+
*
|
|
435
|
+
* Domain types for table of contents generation
|
|
436
|
+
*/
|
|
437
|
+
/**
|
|
438
|
+
* TOC item
|
|
439
|
+
*/
|
|
440
|
+
interface TocItem2 {
|
|
441
|
+
/** Heading text */
|
|
442
|
+
text: string;
|
|
443
|
+
/** Heading level (1-6) */
|
|
444
|
+
level: number;
|
|
445
|
+
/** Anchor ID */
|
|
446
|
+
id: string;
|
|
447
|
+
/** Child items */
|
|
448
|
+
children?: TocItem2[];
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* TOC options
|
|
452
|
+
*/
|
|
453
|
+
interface TocOptions {
|
|
454
|
+
/** Max depth */
|
|
455
|
+
maxDepth?: number;
|
|
456
|
+
/** Min depth */
|
|
457
|
+
minDepth?: number;
|
|
458
|
+
/** Include headings */
|
|
459
|
+
include?: string[];
|
|
460
|
+
/** Exclude headings */
|
|
461
|
+
exclude?: string[];
|
|
462
|
+
}
|
|
463
|
+
/** Content parser port */
|
|
464
|
+
interface ContentParser2 {
|
|
465
|
+
parse: (raw: string) => unknown;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Generate TOC from markdown content
|
|
469
|
+
*/
|
|
470
|
+
declare const generateToc: (content: string, options?: TocOptions) => TocItem2[];
|
|
471
|
+
/**
|
|
472
|
+
* Generate flat TOC from markdown content
|
|
473
|
+
*/
|
|
474
|
+
declare const generateFlatToc: (content: string, options?: TocOptions) => TocItem2[];
|
|
475
|
+
export { ApiConfig2 as ApiConfig, ApiEndpoint2 as ApiEndpoint, AuthType2 as AuthType, BadgeVariant3 as BadgeVariant, Brand, CodeBlock, CodeBlockOptions, CommitOptions2 as CommitOptions, ContentParser2 as ContentParser, ContentValidator, DEFAULT_BASE_ROUTE, DEFAULT_DOCS_DIR, DocFile2 as DocFile, DocId2 as DocId, DocPage2 as DocPage, DocSlug2 as DocSlug, DocsConfig2 as DocsConfig, DocsPluginConfig, DocsPluginOptions2 as DocsPluginOptions, EditLinkConfig2 as EditLinkConfig, Either, FilePath2 as FilePath, Frontmatter2 as Frontmatter, GitAdapter2 as GitAdapter, GitStatus2 as GitStatus, HttpMethod2 as HttpMethod, LastUpdatedConfig2 as LastUpdatedConfig, MetaTagGenerator, MetaTags, NavItem2 as NavItem, NavSection2 as NavSection, Option, PLUGIN_NAME, ParsedContent2 as ParsedContent, PushOptions2 as PushOptions, ResolvedDocsConfig2 as ResolvedDocsConfig, Result, SUPPORTED_EXTENSIONS, SearchConfig2 as SearchConfig, SearchEntry2 as SearchEntry, SearchIndex2 as SearchIndex, SeoOptions, Sidebar2 as Sidebar, SidebarGroup2 as SidebarGroup, SidebarItem2 as SidebarItem, SiteConfig2 as SiteConfig, ThemeConfig2 as ThemeConfig, TocItem2 as TocItem, TocOptions, VIRTUAL_PREFIX, ValidationError, ValidationOptions, ValidationResult, VirtualModuleSet2 as VirtualModuleSet, buildDocPage2 as buildDocPage, buildDocPageFromRaw2 as buildDocPageFromRaw, buildNav2 as buildNav, buildSearchIndex2 as buildSearchIndex, buildSidebar2 as buildSidebar, buildVirtualModules2 as buildVirtualModules, commitAndPush, createFsDocsLoader, createMemoryDirectoryScanner, createMemoryFileReader, createNodeConfigLoader, createNodeDocsWatcher, docsPlugin as default, defaultDocsConfig2 as defaultDocsConfig, docsPlugin, enhanceCodeBlocks, err, formatGroupTitle2 as formatGroupTitle, generateFlatToc, generateToc, groupDocsByFolder2 as groupDocsByFolder, indexPages2 as indexPages, isErr, isMarkdownPath2 as isMarkdownPath, isNone, isOk, isSome, isVirtualDocsModule2 as isVirtualDocsModule, left, loadEditorState, memoryFileSystem, nodeDirectoryScanner, nodeFileReader, nodeFileWatcher, none, ok, optimizeSeo, pageToSearchEntry2 as pageToSearchEntry, parseFrontmatter2 as parseFrontmatter, resolveConfig2 as resolveConfig, right, saveFile, search2 as search, some, transformMarkdown, validate, validateDocsConfig2 as validateDocsConfig };
|