@diplodoc/cli 5.46.1 → 5.47.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/build/index.js +3 -3
- package/build/index.mjs +3 -3
- package/package.json +24 -8
- package/tests/.eslintrc.js +9 -0
- package/tests/e2e/__snapshots__/alternates.test.ts.snap +1199 -0
- package/tests/e2e/__snapshots__/assets.spec.ts.snap +0 -0
- package/tests/e2e/__snapshots__/build-content-map.spec.ts.snap +329 -0
- package/tests/e2e/__snapshots__/bundles.spec.ts.snap +172 -0
- package/tests/e2e/__snapshots__/cleanup-empty-dirs.spec.ts.snap +65 -0
- package/tests/e2e/__snapshots__/crawler-manifest.spec.ts.snap +28 -0
- package/tests/e2e/__snapshots__/files.spec.ts.snap +164 -0
- package/tests/e2e/__snapshots__/files.test.ts.snap +146 -0
- package/tests/e2e/__snapshots__/generate-map.spec.ts.snap +408 -0
- package/tests/e2e/__snapshots__/include-toc.test.ts.snap +797 -0
- package/tests/e2e/__snapshots__/include-with-meta.test.ts.snap +67 -0
- package/tests/e2e/__snapshots__/includes-conditions.test.ts.snap +78 -0
- package/tests/e2e/__snapshots__/includes.test.ts.snap +780 -0
- package/tests/e2e/__snapshots__/init.test.ts.snap +283 -0
- package/tests/e2e/__snapshots__/llms.spec.ts.snap +257 -0
- package/tests/e2e/__snapshots__/load-custom-resources.spec.ts.snap +362 -0
- package/tests/e2e/__snapshots__/markdown-options.spec.ts.snap +209 -0
- package/tests/e2e/__snapshots__/merge-includes.spec.ts.snap +1058 -0
- package/tests/e2e/__snapshots__/metadata.spec.ts.snap +200 -0
- package/tests/e2e/__snapshots__/neuro-expert.test.ts.snap +625 -0
- package/tests/e2e/__snapshots__/pdf-page.spec.ts.snap +341 -0
- package/tests/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
- package/tests/e2e/__snapshots__/preprocess.test.ts.snap +1558 -0
- package/tests/e2e/__snapshots__/regression.test.ts.snap +2033 -0
- package/tests/e2e/__snapshots__/restricted-access.test.ts.snap +244 -0
- package/tests/e2e/__snapshots__/rtl.spec.ts.snap +234 -0
- package/tests/e2e/__snapshots__/search.test.ts.snap +56 -0
- package/tests/e2e/__snapshots__/single-page.spec.ts.snap +163 -0
- package/tests/e2e/__snapshots__/skip-html-extension.spec.ts.snap +519 -0
- package/tests/e2e/__snapshots__/toc-label.test.ts.snap +127 -0
- package/tests/e2e/__snapshots__/translation.spec.ts.snap +2386 -0
- package/tests/e2e/__snapshots__/vars-conditions.spec.ts.snap +131 -0
- package/tests/e2e/alternates.test.ts +49 -0
- package/tests/e2e/assets.spec.ts +31 -0
- package/tests/e2e/autotitles.spec.ts +37 -0
- package/tests/e2e/build-content-map.spec.ts +220 -0
- package/tests/e2e/bundles.spec.ts +16 -0
- package/tests/e2e/cleanup-empty-dirs.spec.ts +59 -0
- package/tests/e2e/crawler-manifest.spec.ts +129 -0
- package/tests/e2e/disable-csp.spec.ts +55 -0
- package/tests/e2e/empty-presets.spec.ts +32 -0
- package/tests/e2e/errors.spec.ts +158 -0
- package/tests/e2e/files.spec.ts +21 -0
- package/tests/e2e/generate-map.spec.ts +47 -0
- package/tests/e2e/include-toc.test.ts +73 -0
- package/tests/e2e/include-with-meta.test.ts +20 -0
- package/tests/e2e/includes-conditions.test.ts +23 -0
- package/tests/e2e/includes.test.ts +52 -0
- package/tests/e2e/init.test.ts +105 -0
- package/tests/e2e/llms.spec.ts +24 -0
- package/tests/e2e/load-custom-resources.spec.ts +23 -0
- package/tests/e2e/markdown-options.spec.ts +17 -0
- package/tests/e2e/merge-includes.spec.ts +196 -0
- package/tests/e2e/metadata.spec.ts +79 -0
- package/tests/e2e/nested-include-links.spec.ts +26 -0
- package/tests/e2e/neuro-expert.test.ts +16 -0
- package/tests/e2e/openapi-companion.spec.ts +213 -0
- package/tests/e2e/openapi-include-size.spec.ts +55 -0
- package/tests/e2e/pdf-page.spec.ts +127 -0
- package/tests/e2e/plugin-corner-cases.spec.ts +14 -0
- package/tests/e2e/preprocess.test.ts +40 -0
- package/tests/e2e/redirects-validation.spec.ts +62 -0
- package/tests/e2e/regression.test.ts +39 -0
- package/tests/e2e/restricted-access.test.ts +19 -0
- package/tests/e2e/rtl.spec.ts +17 -0
- package/tests/e2e/search.test.ts +16 -0
- package/tests/e2e/single-page.spec.ts +23 -0
- package/tests/e2e/skip-html-extension.spec.ts +17 -0
- package/tests/e2e/themer.test.ts +307 -0
- package/tests/e2e/toc-label.test.ts +23 -0
- package/tests/e2e/translation.spec.ts +221 -0
- package/tests/e2e/vars-conditions.spec.ts +16 -0
- package/tests/e2e/vars-ignore.test.ts +168 -0
- package/tests/fixtures/cli.ts +103 -0
- package/tests/fixtures/file.ts +148 -0
- package/tests/fixtures/globals.d.ts +4 -0
- package/tests/fixtures/index.ts +4 -0
- package/tests/fixtures/runner.ts +49 -0
- package/tests/fixtures/test.ts +210 -0
- package/tests/mocks/alternates/input/.yfm +1 -0
- package/tests/mocks/alternates/input/az/about.md +3 -0
- package/tests/mocks/alternates/input/az/deep/test.md +3 -0
- package/tests/mocks/alternates/input/az/index.yaml +3 -0
- package/tests/mocks/alternates/input/az/toc.yaml +6 -0
- package/tests/mocks/alternates/input/en/about.md +3 -0
- package/tests/mocks/alternates/input/en/deep/test.md +3 -0
- package/tests/mocks/alternates/input/en/index.yaml +3 -0
- package/tests/mocks/alternates/input/en/toc.yaml +6 -0
- package/tests/mocks/alternates/input/ru/about.md +8 -0
- package/tests/mocks/alternates/input/ru/deep/test.md +3 -0
- package/tests/mocks/alternates/input/ru/index.yaml +3 -0
- package/tests/mocks/alternates/input/ru/toc.yaml +6 -0
- package/tests/mocks/assets/input/.yfm +1 -0
- package/tests/mocks/assets/input/_images/camera.svg +1 -0
- package/tests/mocks/assets/input/_images/icons/bulb.svg +1 -0
- package/tests/mocks/assets/input/_images/mountain.jpg +0 -0
- package/tests/mocks/assets/input/_images/versions.png +0 -0
- package/tests/mocks/assets/input/index.md +18 -0
- package/tests/mocks/assets/input/page.yaml +7 -0
- package/tests/mocks/assets/input/toc.yaml +7 -0
- package/tests/mocks/autotitles/input/docs/index.md +3 -0
- package/tests/mocks/autotitles/input/docs/target.md +3 -0
- package/tests/mocks/autotitles/input/toc.yaml +5 -0
- package/tests/mocks/build-content-map/autotitle-chain/input/.yfm +0 -0
- package/tests/mocks/build-content-map/autotitle-chain/input/a.md +3 -0
- package/tests/mocks/build-content-map/autotitle-chain/input/b.md +3 -0
- package/tests/mocks/build-content-map/autotitle-chain/input/c.md +3 -0
- package/tests/mocks/build-content-map/autotitle-chain/input/toc.yaml +9 -0
- package/tests/mocks/build-content-map/autotitle-target-with-include/input/.yfm +0 -0
- package/tests/mocks/build-content-map/autotitle-target-with-include/input/_includes/snippet.md +3 -0
- package/tests/mocks/build-content-map/autotitle-target-with-include/input/a.md +3 -0
- package/tests/mocks/build-content-map/autotitle-target-with-include/input/b.md +3 -0
- package/tests/mocks/build-content-map/autotitle-target-with-include/input/toc.yaml +7 -0
- package/tests/mocks/build-content-map/diamond-includes/input/.yfm +0 -0
- package/tests/mocks/build-content-map/diamond-includes/input/_includes/branch-a.md +5 -0
- package/tests/mocks/build-content-map/diamond-includes/input/_includes/branch-b.md +5 -0
- package/tests/mocks/build-content-map/diamond-includes/input/_includes/shared.md +3 -0
- package/tests/mocks/build-content-map/diamond-includes/input/index.md +7 -0
- package/tests/mocks/build-content-map/diamond-includes/input/toc.yaml +5 -0
- package/tests/mocks/build-content-map/nested-includes/input/.yfm +0 -0
- package/tests/mocks/build-content-map/nested-includes/input/_includes/level1.md +5 -0
- package/tests/mocks/build-content-map/nested-includes/input/_includes/level2.md +3 -0
- package/tests/mocks/build-content-map/nested-includes/input/index.md +5 -0
- package/tests/mocks/build-content-map/nested-includes/input/toc.yaml +5 -0
- package/tests/mocks/build-content-map/with-autotitles/input/.yfm +0 -0
- package/tests/mocks/build-content-map/with-autotitles/input/index.md +3 -0
- package/tests/mocks/build-content-map/with-autotitles/input/other.md +3 -0
- package/tests/mocks/build-content-map/with-autotitles/input/toc.yaml +7 -0
- package/tests/mocks/build-content-map/with-includes/input/.yfm +0 -0
- package/tests/mocks/build-content-map/with-includes/input/_includes/snippet.md +1 -0
- package/tests/mocks/build-content-map/with-includes/input/index.md +5 -0
- package/tests/mocks/build-content-map/with-includes/input/logo.svg +1 -0
- package/tests/mocks/build-content-map/with-includes/input/toc.yaml +5 -0
- package/tests/mocks/bundles/input/.yfm +13 -0
- package/tests/mocks/bundles/input/index.md +12 -0
- package/tests/mocks/bundles/input/page1.md +3 -0
- package/tests/mocks/bundles/input/page2.md +5 -0
- package/tests/mocks/bundles/input/toc.yaml +9 -0
- package/tests/mocks/cleanup-empty-dirs/input/.yfm +2 -0
- package/tests/mocks/cleanup-empty-dirs/input/active/page.md +5 -0
- package/tests/mocks/cleanup-empty-dirs/input/active/presets.yaml +2 -0
- package/tests/mocks/cleanup-empty-dirs/input/active/toc.yaml +4 -0
- package/tests/mocks/cleanup-empty-dirs/input/empty-section/page.md +5 -0
- package/tests/mocks/cleanup-empty-dirs/input/empty-section/presets.yaml +2 -0
- package/tests/mocks/cleanup-empty-dirs/input/empty-section/toc.yaml +5 -0
- package/tests/mocks/cleanup-empty-dirs/input/index.md +5 -0
- package/tests/mocks/cleanup-empty-dirs/input/presets.yaml +2 -0
- package/tests/mocks/cleanup-empty-dirs/input/toc.yaml +5 -0
- package/tests/mocks/crawler-manifest/config/input/.yfm +1 -0
- package/tests/mocks/crawler-manifest/config/input/index.md +3 -0
- package/tests/mocks/crawler-manifest/config/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/exclude/input/.yfm +9 -0
- package/tests/mocks/crawler-manifest/exclude/input/index.md +5 -0
- package/tests/mocks/crawler-manifest/exclude/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/no-links/input/index.md +5 -0
- package/tests/mocks/crawler-manifest/no-links/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/notifications-docs-viewer/input/.yfm +8 -0
- package/tests/mocks/crawler-manifest/notifications-docs-viewer/input/index.md +3 -0
- package/tests/mocks/crawler-manifest/notifications-docs-viewer/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/notifications-no-receivers/input/.yfm +5 -0
- package/tests/mocks/crawler-manifest/notifications-no-receivers/input/index.md +3 -0
- package/tests/mocks/crawler-manifest/notifications-no-receivers/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/notifications-root/input/.yfm +11 -0
- package/tests/mocks/crawler-manifest/notifications-root/input/index.md +3 -0
- package/tests/mocks/crawler-manifest/notifications-root/input/toc.yaml +4 -0
- package/tests/mocks/crawler-manifest/with-links/input/redirects.yaml +5 -0
- package/tests/mocks/crawler-manifest/with-links/input/ru/_includes/snippet.md +1 -0
- package/tests/mocks/crawler-manifest/with-links/input/ru/index.md +35 -0
- package/tests/mocks/crawler-manifest/with-links/input/ru/leading.yaml +5 -0
- package/tests/mocks/crawler-manifest/with-links/input/ru/no-links.md +3 -0
- package/tests/mocks/crawler-manifest/with-links/input/ru/references.md +5 -0
- package/tests/mocks/crawler-manifest/with-links/input/toc.yaml +12 -0
- package/tests/mocks/disable-csp/input/.yfm +8 -0
- package/tests/mocks/disable-csp/input/en/index.md +3 -0
- package/tests/mocks/disable-csp/input/en/page.md +3 -0
- package/tests/mocks/disable-csp/input/en/toc.yaml +5 -0
- package/tests/mocks/docs-viewer-interface/input/.yfm +6 -0
- package/tests/mocks/docs-viewer-interface/input/index.md +3 -0
- package/tests/mocks/docs-viewer-interface/input/toc.yaml +5 -0
- package/tests/mocks/empty-presets/input/.yfm +1 -0
- package/tests/mocks/empty-presets/input/index.md +3 -0
- package/tests/mocks/empty-presets/input/presets.yaml +3 -0
- package/tests/mocks/empty-presets/input/subfolder/presets.yaml +3 -0
- package/tests/mocks/empty-presets/input/subfolder/subpage.md +3 -0
- package/tests/mocks/empty-presets/input/subfolder/toc.yaml +4 -0
- package/tests/mocks/empty-presets/input/toc.yaml +4 -0
- package/tests/mocks/errors/extract-filtered-link/input/filtered.md +1 -0
- package/tests/mocks/errors/extract-filtered-link/input/filtered2.md +0 -0
- package/tests/mocks/errors/extract-filtered-link/input/index.md +7 -0
- package/tests/mocks/errors/extract-filtered-link/input/toc.yaml +1 -0
- package/tests/mocks/errors/invalid-frontmatter/input/index.md +9 -0
- package/tests/mocks/errors/invalid-frontmatter/input/toc.yaml +1 -0
- package/tests/mocks/errors/invalid-toc-entry-href/input/.yfm +1 -0
- package/tests/mocks/errors/invalid-toc-entry-href/input/ru/toc.yaml +3 -0
- package/tests/mocks/errors/invalid-toc-root-array/input/.yfm +1 -0
- package/tests/mocks/errors/invalid-toc-root-array/input/ru/toc.yaml +2 -0
- package/tests/mocks/errors/max-asset-size/input/_images/large-image.png +0 -0
- package/tests/mocks/errors/max-asset-size/input/index.md +5 -0
- package/tests/mocks/errors/max-asset-size/input/toc.yaml +1 -0
- package/tests/mocks/errors/object-validation/input/index.md +3 -0
- package/tests/mocks/errors/object-validation/input/toc.yaml +14 -0
- package/tests/mocks/errors/unreachable-link/input/exists.md +1 -0
- package/tests/mocks/errors/unreachable-link/input/index.md +2 -0
- package/tests/mocks/errors/unreachable-link/input/toc.yaml +1 -0
- package/tests/mocks/errors/unreachable-link-in-include/input/_includes/chapter.md +1 -0
- package/tests/mocks/errors/unreachable-link-in-include/input/index.md +5 -0
- package/tests/mocks/errors/unreachable-link-in-include/input/toc.yaml +1 -0
- package/tests/mocks/errors/unreachable-link-in-nested-include/input/_includes/chapter.md +3 -0
- package/tests/mocks/errors/unreachable-link-in-nested-include/input/_includes/details.md +1 -0
- package/tests/mocks/errors/unreachable-link-in-nested-include/input/index.md +3 -0
- package/tests/mocks/errors/unreachable-link-in-nested-include/input/toc.yaml +1 -0
- package/tests/mocks/errors/valid-link-in-include/input/_includes/content.md +1 -0
- package/tests/mocks/errors/valid-link-in-include/input/index.md +3 -0
- package/tests/mocks/errors/valid-link-in-include/input/page.md +3 -0
- package/tests/mocks/errors/valid-link-in-include/input/toc.yaml +4 -0
- package/tests/mocks/fileContent/metadata/authorAliasInMetadata.md +7 -0
- package/tests/mocks/fileContent/metadata/fullAuthorInMetadata.md +10 -0
- package/tests/mocks/fileContent/metadata/includesContent/firstIncludeFile.md +7 -0
- package/tests/mocks/fileContent/metadata/includesContent/secondIncludeFile.md +5 -0
- package/tests/mocks/fileContent/metadata/includesContent/withIncludes.md +7 -0
- package/tests/mocks/fileContent/metadata/keywordsInMetadata.md +9 -0
- package/tests/mocks/fileContent/metadata/simpleMetadata.md +6 -0
- package/tests/mocks/fileContent/metadata/substitutionsInMetadataPropertyKeys.md +7 -0
- package/tests/mocks/fileContent/metadata/substitutionsInMetadataPropertyValues.md +11 -0
- package/tests/mocks/fileContent/metadata/substitutionsWithEmptyString.md +7 -0
- package/tests/mocks/fileContent/metadata/variableInMetadata.md +7 -0
- package/tests/mocks/fileContent/metadata/withAdditionalSeparatorsInContent.md +9 -0
- package/tests/mocks/fileContent/metadata/withoutMetadata.md +2 -0
- package/tests/mocks/fileContent/metadata/withoutMetadataWithAdditionalSeparatorsInContent.md +6 -0
- package/tests/mocks/files/input/_assets/test.csv +0 -0
- package/tests/mocks/files/input/_assets/test.docx +0 -0
- package/tests/mocks/files/input/_assets/test.pdf +0 -0
- package/tests/mocks/files/input/_assets/test.pptx +0 -0
- package/tests/mocks/files/input/_assets/test.txt +0 -0
- package/tests/mocks/files/input/_assets/test.xlsx +0 -0
- package/tests/mocks/files/input/_assets/test.yaml +50 -0
- package/tests/mocks/files/input/index.md +17 -0
- package/tests/mocks/files/input/pc-index.yaml +70 -0
- package/tests/mocks/files/input/toc.yaml +6 -0
- package/tests/mocks/generate-map/test1/input/.yfm +0 -0
- package/tests/mocks/generate-map/test1/input/ru/_includes/file.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/_includes/plugins.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/folder1/a1.md +1 -0
- package/tests/mocks/generate-map/test1/input/ru/folder1/folder2/a1.md +1 -0
- package/tests/mocks/generate-map/test1/input/ru/folder1/folder2/toc.yaml +5 -0
- package/tests/mocks/generate-map/test1/input/ru/folder1/toc.yaml +7 -0
- package/tests/mocks/generate-map/test1/input/ru/index.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/plugins/import.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/plugins/index.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/project/config.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/project/index.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/settings.md +0 -0
- package/tests/mocks/generate-map/test1/input/ru/toc.yaml +22 -0
- package/tests/mocks/generate-map/test2/input/en/_includes/file.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/_includes/plugins.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/plugins/import.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/plugins/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/project/config.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/project/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/settings.md +0 -0
- package/tests/mocks/generate-map/test2/input/en/toc.yaml +18 -0
- package/tests/mocks/generate-map/test2/input/ru/_includes/file.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/_includes/plugins.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/plugins/import.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/plugins/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/project/config.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/project/index.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/settings.md +0 -0
- package/tests/mocks/generate-map/test2/input/ru/toc.yaml +18 -0
- package/tests/mocks/generate-map/test3/input/.yfm +0 -0
- package/tests/mocks/generate-map/test3/input/ru/_includes/file.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/_includes/plugins.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/folder1/a1.md +1 -0
- package/tests/mocks/generate-map/test3/input/ru/folder1/folder2/a1.md +1 -0
- package/tests/mocks/generate-map/test3/input/ru/folder1/folder2/toc.yaml +5 -0
- package/tests/mocks/generate-map/test3/input/ru/folder1/toc.yaml +7 -0
- package/tests/mocks/generate-map/test3/input/ru/index.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/plugins/import.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/plugins/index.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/project/config.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/project/index.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/settings.md +0 -0
- package/tests/mocks/generate-map/test3/input/ru/toc.yaml +22 -0
- package/tests/mocks/include-skip/test1/input/includes/missing.md +1 -0
- package/tests/mocks/include-skip/test1/input/index.md +3 -0
- package/tests/mocks/include-skip/test1/input/toc.yaml +3 -0
- package/tests/mocks/include-skip/test2/input/includes/missing.md +1 -0
- package/tests/mocks/include-skip/test2/input/includes/valid.md +4 -0
- package/tests/mocks/include-skip/test2/input/index.md +4 -0
- package/tests/mocks/include-skip/test2/input/toc.yaml +4 -0
- package/tests/mocks/include-toc/test1/input/a1.md +1 -0
- package/tests/mocks/include-toc/test1/input/folder1/a1.md +1 -0
- package/tests/mocks/include-toc/test1/input/folder1/folder2/a1.md +1 -0
- package/tests/mocks/include-toc/test1/input/folder1/folder2/toc.yaml +5 -0
- package/tests/mocks/include-toc/test1/input/folder1/toc.yaml +7 -0
- package/tests/mocks/include-toc/test1/input/toc.yaml +9 -0
- package/tests/mocks/include-toc/test10/input/test/index.md +4 -0
- package/tests/mocks/include-toc/test10/input/test/sub/index.md +1 -0
- package/tests/mocks/include-toc/test10/input/test/sub/sub/sub-3.md +1 -0
- package/tests/mocks/include-toc/test10/input/test/sub/sub-1.md +5 -0
- package/tests/mocks/include-toc/test10/input/test/sub/sub-2.md +1 -0
- package/tests/mocks/include-toc/test10/input/test/test.md +1 -0
- package/tests/mocks/include-toc/test10/input/toc.yaml +9 -0
- package/tests/mocks/include-toc/test2/input/.yfm +1 -0
- package/tests/mocks/include-toc/test2/input/file1.md +1 -0
- package/tests/mocks/include-toc/test2/input/fileX.md +1 -0
- package/tests/mocks/include-toc/test2/input/folder/fileA.md +11 -0
- package/tests/mocks/include-toc/test2/input/folder/fileB.md +9 -0
- package/tests/mocks/include-toc/test2/input/folder/folder/fileC.md +1 -0
- package/tests/mocks/include-toc/test2/input/folder/folder/toc.yaml +3 -0
- package/tests/mocks/include-toc/test2/input/folder/toc.yaml +6 -0
- package/tests/mocks/include-toc/test2/input/presets.yaml +2 -0
- package/tests/mocks/include-toc/test2/input/toc.yaml +6 -0
- package/tests/mocks/include-toc/test3/input/product1/core/_includes/inc.md +1 -0
- package/tests/mocks/include-toc/test3/input/product1/core/article1.md +3 -0
- package/tests/mocks/include-toc/test3/input/product1/core/toc_m.yaml +2 -0
- package/tests/mocks/include-toc/test3/input/product1/product/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test3/input/product1/toc.yaml +3 -0
- package/tests/mocks/include-toc/test3/input/product2/core/_includes/inc.md +1 -0
- package/tests/mocks/include-toc/test3/input/product2/core/article1.md +3 -0
- package/tests/mocks/include-toc/test3/input/product2/core/toc_m.yaml +2 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay1/product/article1.md +3 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay1/product/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay1/toc.yaml +2 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay2/product/article1.md +3 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay2/product/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay2/toc.yaml +2 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay3/product/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test3/input/product2/overlay3/toc.yaml +2 -0
- package/tests/mocks/include-toc/test3/input/product2/p2.md +4 -0
- package/tests/mocks/include-toc/test3/input/product2/toc.yaml +10 -0
- package/tests/mocks/include-toc/test4/input/a1.md +1 -0
- package/tests/mocks/include-toc/test4/input/index.yaml +20 -0
- package/tests/mocks/include-toc/test4/input/toc.yaml +9 -0
- package/tests/mocks/include-toc/test5/input/core/concepts/toc_i.yaml +2 -0
- package/tests/mocks/include-toc/test5/input/core/concepts/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test5/input/core/toc_i.yaml +6 -0
- package/tests/mocks/include-toc/test5/input/core/toc_m.yaml +3 -0
- package/tests/mocks/include-toc/test5/input/core/toc_p.yaml +5 -0
- package/tests/mocks/include-toc/test5/input/overlay/toc_p.yaml +3 -0
- package/tests/mocks/include-toc/test5/input/toc.yaml +4 -0
- package/tests/mocks/include-toc/test6/input/test/index.md +4 -0
- package/tests/mocks/include-toc/test6/input/test/sub/sub/sub-3.md +1 -0
- package/tests/mocks/include-toc/test6/input/test/sub/sub-1.md +5 -0
- package/tests/mocks/include-toc/test6/input/test/sub/sub-2.md +1 -0
- package/tests/mocks/include-toc/test6/input/test/test.md +1 -0
- package/tests/mocks/include-toc/test6/input/toc.yaml +8 -0
- package/tests/mocks/include-toc/test7/input/.yfm +1 -0
- package/tests/mocks/include-toc/test7/input/ru/presets.yaml +2 -0
- package/tests/mocks/include-toc/test7/input/ru/sub/folder/index.yaml +4 -0
- package/tests/mocks/include-toc/test7/input/ru/sub/folder/toc.yaml +3 -0
- package/tests/mocks/include-toc/test7/input/ru/toc.yaml +3 -0
- package/tests/mocks/include-toc/test8/input/test/index.md +4 -0
- package/tests/mocks/include-toc/test8/input/test/sub/index.md +1 -0
- package/tests/mocks/include-toc/test8/input/test/sub/sub/sub-3.md +1 -0
- package/tests/mocks/include-toc/test8/input/test/sub/sub-1.md +5 -0
- package/tests/mocks/include-toc/test8/input/test/sub/sub-2.md +1 -0
- package/tests/mocks/include-toc/test8/input/test/test.md +1 -0
- package/tests/mocks/include-toc/test8/input/toc.yaml +9 -0
- package/tests/mocks/include-toc/test9/input/test/index.md +4 -0
- package/tests/mocks/include-toc/test9/input/test/sub/index.md +1 -0
- package/tests/mocks/include-toc/test9/input/test/sub/sub/sub-3.md +1 -0
- package/tests/mocks/include-toc/test9/input/test/sub/sub-1.md +5 -0
- package/tests/mocks/include-toc/test9/input/test/sub/sub-2.md +1 -0
- package/tests/mocks/include-toc/test9/input/test/test.md +1 -0
- package/tests/mocks/include-toc/test9/input/toc.yaml +8 -0
- package/tests/mocks/include-with-meta/input/included.md +16 -0
- package/tests/mocks/include-with-meta/input/index.md +15 -0
- package/tests/mocks/include-with-meta/input/toc.yaml +6 -0
- package/tests/mocks/includes/input/.yfm +1 -0
- package/tests/mocks/includes/input/_assets/4.png +0 -0
- package/tests/mocks/includes/input/includes/commented-include.md +5 -0
- package/tests/mocks/includes/input/includes/deep-include.md +13 -0
- package/tests/mocks/includes/input/includes/fragments.md +23 -0
- package/tests/mocks/includes/input/includes/nested-include.md +5 -0
- package/tests/mocks/includes/input/includes/no-title-include.md +19 -0
- package/tests/mocks/includes/input/includes/root-include.md +11 -0
- package/tests/mocks/includes/input/includes/user.md +5 -0
- package/tests/mocks/includes/input/index.md +69 -0
- package/tests/mocks/includes/input/level1/includes/level1-include.md +11 -0
- package/tests/mocks/includes/input/level1/level2/includes/level2-include.md +11 -0
- package/tests/mocks/includes/input/level1/level2/page2.md +29 -0
- package/tests/mocks/includes/input/level1/page1.md +29 -0
- package/tests/mocks/includes/input/presets.yaml +3 -0
- package/tests/mocks/includes/input/toc-include.md +13 -0
- package/tests/mocks/includes/input/toc.yaml +13 -0
- package/tests/mocks/includes-conditions/input/includes/first.md +5 -0
- package/tests/mocks/includes-conditions/input/includes/second.md +5 -0
- package/tests/mocks/includes-conditions/input/includes/third.md +1 -0
- package/tests/mocks/includes-conditions/input/index.md +7 -0
- package/tests/mocks/includes-conditions/input/presets.yaml +2 -0
- package/tests/mocks/includes-conditions/input/toc.yaml +3 -0
- package/tests/mocks/includes-missing/input/index.md +7 -0
- package/tests/mocks/includes-missing/input/toc.yaml +3 -0
- package/tests/mocks/llms/input/.yfm +1 -0
- package/tests/mocks/llms/input/_includes/requirements.md +4 -0
- package/tests/mocks/llms/input/api.md +9 -0
- package/tests/mocks/llms/input/beta.md +4 -0
- package/tests/mocks/llms/input/index.md +8 -0
- package/tests/mocks/llms/input/presets.yaml +2 -0
- package/tests/mocks/llms/input/start.md +9 -0
- package/tests/mocks/llms/input/toc.yaml +11 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/.yfm +5 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/_assets/script/test1.js +0 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/_assets/style/test.css +13 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/index.yaml +9 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/page.md +14 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/project/config.md +1 -0
- package/tests/mocks/load-custom-resources/md2html-with-resources/input/toc.yaml +7 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/.yfm +5 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/_assets/script/test1.js +0 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/_assets/style/test.css +13 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/index.yaml +9 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/page.md +14 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/project/config.md +1 -0
- package/tests/mocks/load-custom-resources/md2md-with-resources/input/toc.yaml +7 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/.yfm +5 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/_assets/script/test1.js +0 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/_assets/style/test.css +13 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/index.yaml +9 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/page.md +14 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/project/config.md +1 -0
- package/tests/mocks/load-custom-resources/single-page-with-resources/input/toc.yaml +7 -0
- package/tests/mocks/markdown-options/example-1/input/.yfm +5 -0
- package/tests/mocks/markdown-options/example-1/input/breaks.md +5 -0
- package/tests/mocks/markdown-options/example-1/input/linkify-tlds.md +7 -0
- package/tests/mocks/markdown-options/example-1/input/linkify.md +3 -0
- package/tests/mocks/markdown-options/example-1/input/toc.yaml +7 -0
- package/tests/mocks/markdown-options/example-2/input/.yfm +3 -0
- package/tests/mocks/markdown-options/example-2/input/breaks.md +5 -0
- package/tests/mocks/markdown-options/example-2/input/linkify-tlds.md +7 -0
- package/tests/mocks/markdown-options/example-2/input/linkify.md +3 -0
- package/tests/mocks/markdown-options/example-2/input/toc.yaml +7 -0
- package/tests/mocks/merge-includes/basic/input/_includes/simple.md +3 -0
- package/tests/mocks/merge-includes/basic/input/index.md +3 -0
- package/tests/mocks/merge-includes/basic/input/main.md +7 -0
- package/tests/mocks/merge-includes/basic/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/hash-fallback/input/_includes/sections.md +19 -0
- package/tests/mocks/merge-includes/hash-fallback/input/index.md +1 -0
- package/tests/mocks/merge-includes/hash-fallback/input/main.md +5 -0
- package/tests/mocks/merge-includes/hash-fallback/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/hash-section-html/input/_includes/mixed.md +11 -0
- package/tests/mocks/merge-includes/hash-section-html/input/index.md +3 -0
- package/tests/mocks/merge-includes/hash-section-html/input/main.md +13 -0
- package/tests/mocks/merge-includes/hash-section-html/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/html-comment-blanks/input/_includes/examples.md +27 -0
- package/tests/mocks/merge-includes/html-comment-blanks/input/index.md +3 -0
- package/tests/mocks/merge-includes/html-comment-blanks/input/main.md +15 -0
- package/tests/mocks/merge-includes/html-comment-blanks/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/html-in-list/input/_includes/styles.md +7 -0
- package/tests/mocks/merge-includes/html-in-list/input/index.md +3 -0
- package/tests/mocks/merge-includes/html-in-list/input/main.md +11 -0
- package/tests/mocks/merge-includes/html-in-list/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/include-after-fence/input/_includes/chat-button.md +1 -0
- package/tests/mocks/merge-includes/include-after-fence/input/_includes/footer.md +1 -0
- package/tests/mocks/merge-includes/include-after-fence/input/index.md +3 -0
- package/tests/mocks/merge-includes/include-after-fence/input/main.md +14 -0
- package/tests/mocks/merge-includes/include-after-fence/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/include-in-code-block/input/_includes/glossary.md +1 -0
- package/tests/mocks/merge-includes/include-in-code-block/input/index.md +3 -0
- package/tests/mocks/merge-includes/include-in-code-block/input/main.md +19 -0
- package/tests/mocks/merge-includes/include-in-code-block/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/indent-paragraph-in-include/input/_includes/requirements.md +9 -0
- package/tests/mocks/merge-includes/indent-paragraph-in-include/input/index.md +3 -0
- package/tests/mocks/merge-includes/indent-paragraph-in-include/input/main.md +12 -0
- package/tests/mocks/merge-includes/indent-paragraph-in-include/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/inline-context/input/_includes/snippet.md +12 -0
- package/tests/mocks/merge-includes/inline-context/input/index.md +3 -0
- package/tests/mocks/merge-includes/inline-context/input/main.md +11 -0
- package/tests/mocks/merge-includes/inline-context/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/nested/input/_includes/inner.md +3 -0
- package/tests/mocks/merge-includes/nested/input/_includes/outer.md +7 -0
- package/tests/mocks/merge-includes/nested/input/index.md +3 -0
- package/tests/mocks/merge-includes/nested/input/main.md +7 -0
- package/tests/mocks/merge-includes/nested/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/relative-paths/input/_includes/sub/with-links.md +7 -0
- package/tests/mocks/merge-includes/relative-paths/input/index.md +3 -0
- package/tests/mocks/merge-includes/relative-paths/input/main.md +3 -0
- package/tests/mocks/merge-includes/relative-paths/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/term-extract/input/_includes/chapter.md +7 -0
- package/tests/mocks/merge-includes/term-extract/input/index.md +3 -0
- package/tests/mocks/merge-includes/term-extract/input/main.md +7 -0
- package/tests/mocks/merge-includes/term-extract/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/term-inline/input/_includes/defs.md +20 -0
- package/tests/mocks/merge-includes/term-inline/input/index.md +3 -0
- package/tests/mocks/merge-includes/term-inline/input/main.md +19 -0
- package/tests/mocks/merge-includes/term-inline/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/yfm-table/input/_includes/cell-content.md +1 -0
- package/tests/mocks/merge-includes/yfm-table/input/index.md +3 -0
- package/tests/mocks/merge-includes/yfm-table/input/main.md +12 -0
- package/tests/mocks/merge-includes/yfm-table/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/yfm-table-html-block/input/_includes/button.md +8 -0
- package/tests/mocks/merge-includes/yfm-table-html-block/input/index.md +3 -0
- package/tests/mocks/merge-includes/yfm-table-html-block/input/main.md +12 -0
- package/tests/mocks/merge-includes/yfm-table-html-block/input/toc.yaml +5 -0
- package/tests/mocks/merge-includes/yfm-table-pipe-in-content/input/_includes/example.md +1 -0
- package/tests/mocks/merge-includes/yfm-table-pipe-in-content/input/index.md +3 -0
- package/tests/mocks/merge-includes/yfm-table-pipe-in-content/input/main.md +22 -0
- package/tests/mocks/merge-includes/yfm-table-pipe-in-content/input/toc.yaml +5 -0
- package/tests/mocks/metadata/include-with-csp-meta/input/.yfm +8 -0
- package/tests/mocks/metadata/include-with-csp-meta/input/_includes/support.md +1 -0
- package/tests/mocks/metadata/include-with-csp-meta/input/page.md +7 -0
- package/tests/mocks/metadata/include-with-csp-meta/input/toc.yaml +4 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/.yfm +1 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/index.yaml +9 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/page.md +16 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/presets.yaml +6 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/project/config.md +7 -0
- package/tests/mocks/metadata/md2html-with-metadata/input/toc.yaml +7 -0
- package/tests/mocks/metadata/md2md-with-metadata/input/index.yaml +9 -0
- package/tests/mocks/metadata/md2md-with-metadata/input/page.md +14 -0
- package/tests/mocks/metadata/md2md-with-metadata/input/presets.yaml +6 -0
- package/tests/mocks/metadata/md2md-with-metadata/input/project/config.md +7 -0
- package/tests/mocks/metadata/md2md-with-metadata/input/toc.yaml +7 -0
- package/tests/mocks/nested-docs/input/.yfm +1 -0
- package/tests/mocks/nested-docs/input/.yfm-subdoc +5 -0
- package/tests/mocks/nested-docs/input/index.md +5 -0
- package/tests/mocks/nested-docs/input/presets.yaml +3 -0
- package/tests/mocks/nested-docs/input/subdoc/.yfm +0 -0
- package/tests/mocks/nested-docs/input/subdoc/index.md +5 -0
- package/tests/mocks/nested-docs/input/subdoc/presets.yaml +3 -0
- package/tests/mocks/nested-docs/input/subdoc/toc.yaml +4 -0
- package/tests/mocks/nested-docs/input/toc.yaml +6 -0
- package/tests/mocks/nested-include-links/input/includes/middle.md +4 -0
- package/tests/mocks/nested-include-links/input/other/page.md +4 -0
- package/tests/mocks/nested-include-links/input/sub/deep/entry.md +8 -0
- package/tests/mocks/nested-include-links/input/target.md +4 -0
- package/tests/mocks/nested-include-links/input/toc.yaml +6 -0
- package/tests/mocks/neuro-expert/input/.yfm +14 -0
- package/tests/mocks/neuro-expert/input/en/folder/index.md +1 -0
- package/tests/mocks/neuro-expert/input/en/index-test-html/index.md +4 -0
- package/tests/mocks/neuro-expert/input/en/index.md +11 -0
- package/tests/mocks/neuro-expert/input/en/page1.md +8 -0
- package/tests/mocks/neuro-expert/input/en/page2.md +6 -0
- package/tests/mocks/neuro-expert/input/en/toc.yaml +13 -0
- package/tests/mocks/neuro-expert/input/ru/folder/index.md +1 -0
- package/tests/mocks/neuro-expert/input/ru/index-test-html/index.md +4 -0
- package/tests/mocks/neuro-expert/input/ru/index.md +5 -0
- package/tests/mocks/neuro-expert/input/ru/page1.md +3 -0
- package/tests/mocks/neuro-expert/input/ru/page2.md +11 -0
- package/tests/mocks/neuro-expert/input/ru/toc.yaml +12 -0
- package/tests/mocks/openapi-companion/input/petstore.yaml +29 -0
- package/tests/mocks/openapi-companion/input/toc.yaml +9 -0
- package/tests/mocks/openapi-companion-disabled/input/.yfm +2 -0
- package/tests/mocks/openapi-companion-disabled/input/petstore.yaml +29 -0
- package/tests/mocks/openapi-companion-disabled/input/toc.yaml +9 -0
- package/tests/mocks/openapi-companion-link/input/petstore.yaml +29 -0
- package/tests/mocks/openapi-companion-link/input/toc.yaml +12 -0
- package/tests/mocks/openapi-include-size-exceeds/input/openapi-spec.yaml +190 -0
- package/tests/mocks/openapi-include-size-exceeds/input/toc.yaml +9 -0
- package/tests/mocks/openapi-include-size-within/input/openapi-spec.yaml +16 -0
- package/tests/mocks/openapi-include-size-within/input/toc.yaml +9 -0
- package/tests/mocks/pdf-page/custom-pdf-icon/input/.yfm +6 -0
- package/tests/mocks/pdf-page/custom-pdf-icon/input/_assets/custom-pdf-icon.svg +1 -0
- package/tests/mocks/pdf-page/custom-pdf-icon/input/index.md +1 -0
- package/tests/mocks/pdf-page/custom-pdf-icon/input/pdf/output.pdf +0 -0
- package/tests/mocks/pdf-page/custom-pdf-icon/input/toc.yaml +2 -0
- package/tests/mocks/pdf-page/flag-enabled/input/__includes/include1.md +3 -0
- package/tests/mocks/pdf-page/flag-enabled/input/index.md +7 -0
- package/tests/mocks/pdf-page/flag-enabled/input/page1.md +6 -0
- package/tests/mocks/pdf-page/flag-enabled/input/page2.md +7 -0
- package/tests/mocks/pdf-page/flag-enabled/input/page3.md +1 -0
- package/tests/mocks/pdf-page/flag-enabled/input/syntax/test.md +1 -0
- package/tests/mocks/pdf-page/flag-enabled/input/toc.yaml +17 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/.yfm +2 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section1/index.md +5 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section1/page1.md +3 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section1/toc.yaml +6 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section2/index.md +5 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section2/page1.md +3 -0
- package/tests/mocks/pdf-page/multiple-tocs/input/section2/toc.yaml +6 -0
- package/tests/mocks/pdf-page/pc-page/input/__images/mountain.jpg +0 -0
- package/tests/mocks/pdf-page/pc-page/input/__includes/include1.md +1 -0
- package/tests/mocks/pdf-page/pc-page/input/index.md +1 -0
- package/tests/mocks/pdf-page/pc-page/input/index.yaml +87 -0
- package/tests/mocks/pdf-page/pc-page/input/index2.yaml +135 -0
- package/tests/mocks/pdf-page/pc-page/input/page1.md +3 -0
- package/tests/mocks/pdf-page/pc-page/input/page2.md +3 -0
- package/tests/mocks/pdf-page/pc-page/input/pdf-titles/pdf-title-page1.md +13 -0
- package/tests/mocks/pdf-page/pc-page/input/pdf-titles/pdf-title-page2.md +5 -0
- package/tests/mocks/pdf-page/pc-page/input/presets.yaml +2 -0
- package/tests/mocks/pdf-page/pc-page/input/toc.yaml +13 -0
- package/tests/mocks/pdf-page/pc-page/input/with-pc-page.md +363 -0
- package/tests/mocks/pdf-page/title-pages/input/.yfm +6 -0
- package/tests/mocks/pdf-page/title-pages/input/__assets/start-page.css +16 -0
- package/tests/mocks/pdf-page/title-pages/input/__images/mountain.jpg +0 -0
- package/tests/mocks/pdf-page/title-pages/input/__includes/include1.md +1 -0
- package/tests/mocks/pdf-page/title-pages/input/index.md +1 -0
- package/tests/mocks/pdf-page/title-pages/input/page1.md +3 -0
- package/tests/mocks/pdf-page/title-pages/input/page2.md +3 -0
- package/tests/mocks/pdf-page/title-pages/input/pdf-endings/pdf-ending-page1.md +13 -0
- package/tests/mocks/pdf-page/title-pages/input/pdf-endings/pdf-ending-page2.md +3 -0
- package/tests/mocks/pdf-page/title-pages/input/pdf-titles/pdf-title-page1.md +13 -0
- package/tests/mocks/pdf-page/title-pages/input/pdf-titles/pdf-title-page2.md +3 -0
- package/tests/mocks/pdf-page/title-pages/input/presets.yaml +2 -0
- package/tests/mocks/pdf-page/title-pages/input/toc.yaml +15 -0
- package/tests/mocks/pdf-page/yfm-config/input/.yfm +5 -0
- package/tests/mocks/pdf-page/yfm-config/input/index.md +6 -0
- package/tests/mocks/pdf-page/yfm-config/input/page1.md +3 -0
- package/tests/mocks/pdf-page/yfm-config/input/page2.md +7 -0
- package/tests/mocks/pdf-page/yfm-config/input/page3.md +1 -0
- package/tests/mocks/pdf-page/yfm-config/input/toc.yaml +15 -0
- package/tests/mocks/plugin-corner-cases/images-in-deflists/input/image.jpeg +0 -0
- package/tests/mocks/plugin-corner-cases/images-in-deflists/input/index.md +5 -0
- package/tests/mocks/plugin-corner-cases/images-in-deflists/input/toc.yaml +4 -0
- package/tests/mocks/preprocess/input/.yfm +1 -0
- package/tests/mocks/preprocess/input/1.md +29 -0
- package/tests/mocks/preprocess/input/_assets/1.png +0 -0
- package/tests/mocks/preprocess/input/_assets/1.svg +15 -0
- package/tests/mocks/preprocess/input/_assets/2.svg +19 -0
- package/tests/mocks/preprocess/input/autotitle.md +39 -0
- package/tests/mocks/preprocess/input/commented-include.md +3 -0
- package/tests/mocks/preprocess/input/images.md +163 -0
- package/tests/mocks/preprocess/input/included-item.md +12 -0
- package/tests/mocks/preprocess/input/includes/deep.md +1 -0
- package/tests/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
- package/tests/mocks/preprocess/input/includes/level1.md +9 -0
- package/tests/mocks/preprocess/input/includes/level11.md +1 -0
- package/tests/mocks/preprocess/input/includes/presets.yaml +2 -0
- package/tests/mocks/preprocess/input/includes/sub/level2.md +7 -0
- package/tests/mocks/preprocess/input/includes/sub/user.md +1 -0
- package/tests/mocks/preprocess/input/includes/sub/userWithIndent.md +5 -0
- package/tests/mocks/preprocess/input/includes/test.md +1 -0
- package/tests/mocks/preprocess/input/includes/user.md +1 -0
- package/tests/mocks/preprocess/input/includes.md +18 -0
- package/tests/mocks/preprocess/input/latex.md +3 -0
- package/tests/mocks/preprocess/input/level0.md +7 -0
- package/tests/mocks/preprocess/input/level1/level1.md +7 -0
- package/tests/mocks/preprocess/input/level1/level2/level2.md +6 -0
- package/tests/mocks/preprocess/input/level1/toc.yaml +5 -0
- package/tests/mocks/preprocess/input/mermaid.md +13 -0
- package/tests/mocks/preprocess/input/presets.yaml +8 -0
- package/tests/mocks/preprocess/input/sub/folder/item-1.md +7 -0
- package/tests/mocks/preprocess/input/sub/toc.yaml +5 -0
- package/tests/mocks/preprocess/input/toc-i.yaml +3 -0
- package/tests/mocks/preprocess/input/toc.yaml +24 -0
- package/tests/mocks/redirects-validation/extensions-deprecation/input/blah.md +0 -0
- package/tests/mocks/redirects-validation/extensions-deprecation/input/redirects.yaml +5 -0
- package/tests/mocks/redirects-validation/extensions-deprecation/input/toc.yaml +4 -0
- package/tests/mocks/redirects-validation/invalid-regex/input/blah.md +0 -0
- package/tests/mocks/redirects-validation/invalid-regex/input/redirects.yaml +3 -0
- package/tests/mocks/redirects-validation/invalid-regex/input/toc.yaml +4 -0
- package/tests/mocks/redirects-validation/malformed-redirect/input/blah.md +0 -0
- package/tests/mocks/redirects-validation/malformed-redirect/input/redirects.yaml +6 -0
- package/tests/mocks/redirects-validation/malformed-redirect/input/toc.yaml +4 -0
- package/tests/mocks/redirects-validation/same-path/input/blah.md +0 -0
- package/tests/mocks/redirects-validation/same-path/input/redirects.yaml +3 -0
- package/tests/mocks/redirects-validation/same-path/input/toc.yaml +4 -0
- package/tests/mocks/redirects-validation/unparseable/input/blah.md +0 -0
- package/tests/mocks/redirects-validation/unparseable/input/redirects.yaml +11 -0
- package/tests/mocks/redirects-validation/unparseable/input/toc.yaml +4 -0
- package/tests/mocks/regression/input/.yfm +2 -0
- package/tests/mocks/regression/input/1.md +29 -0
- package/tests/mocks/regression/input/_assets/1.png +0 -0
- package/tests/mocks/regression/input/_assets/2.png +0 -0
- package/tests/mocks/regression/input/_assets/3.png +0 -0
- package/tests/mocks/regression/input/_assets/4.png +0 -0
- package/tests/mocks/regression/input/_assets/5_1.png +0 -0
- package/tests/mocks/regression/input/_assets/empty.pdf +0 -0
- package/tests/mocks/regression/input/autotitle.md +58 -0
- package/tests/mocks/regression/input/commented-include.md +3 -0
- package/tests/mocks/regression/input/entry-as-include.md +3 -0
- package/tests/mocks/regression/input/generic/1.md +3 -0
- package/tests/mocks/regression/input/generic/2.md +3 -0
- package/tests/mocks/regression/input/generic/3.md +1 -0
- package/tests/mocks/regression/input/generic/Sub notes/1.md +3 -0
- package/tests/mocks/regression/input/generic/Sub notes/2.md +3 -0
- package/tests/mocks/regression/input/images.md +13 -0
- package/tests/mocks/regression/input/included-item.md +13 -0
- package/tests/mocks/regression/input/includer-of-entry.md +5 -0
- package/tests/mocks/regression/input/includes/deep.md +3 -0
- package/tests/mocks/regression/input/includes/fragments.md +41 -0
- package/tests/mocks/regression/input/includes/presets.yaml +3 -0
- package/tests/mocks/regression/input/includes/styles.md +8 -0
- package/tests/mocks/regression/input/includes/test.md +1 -0
- package/tests/mocks/regression/input/includes/tools.md +1 -0
- package/tests/mocks/regression/input/includes/user.md +1 -0
- package/tests/mocks/regression/input/includes.md +33 -0
- package/tests/mocks/regression/input/index.yaml +9 -0
- package/tests/mocks/regression/input/latex.md +3 -0
- package/tests/mocks/regression/input/merge/merge.md +5 -0
- package/tests/mocks/regression/input/merge/presets.yaml +3 -0
- package/tests/mocks/regression/input/merge/toc.yaml +6 -0
- package/tests/mocks/regression/input/merge-source/merged.md +3 -0
- package/tests/mocks/regression/input/merge-source/toc-m.yaml +4 -0
- package/tests/mocks/regression/input/mermaid.md +13 -0
- package/tests/mocks/regression/input/openapi-spec.yaml +111 -0
- package/tests/mocks/regression/input/presets.yaml +12 -0
- package/tests/mocks/regression/input/redirects.yaml +6 -0
- package/tests/mocks/regression/input/sub/folder/item-1.md +5 -0
- package/tests/mocks/regression/input/sub/toc.yaml +5 -0
- package/tests/mocks/regression/input/toc-i.yaml +3 -0
- package/tests/mocks/regression/input/toc.yaml +43 -0
- package/tests/mocks/restricted-access/test1/input/index.md +0 -0
- package/tests/mocks/restricted-access/test1/input/plugins/index.md +0 -0
- package/tests/mocks/restricted-access/test1/input/plugins/index2.md +0 -0
- package/tests/mocks/restricted-access/test1/input/plugins/index3.md +0 -0
- package/tests/mocks/restricted-access/test1/input/plugins/index4.md +4 -0
- package/tests/mocks/restricted-access/test1/input/toc.yaml +28 -0
- package/tests/mocks/restricted-access/test2/input/index.md +0 -0
- package/tests/mocks/restricted-access/test2/input/plugins/index.md +0 -0
- package/tests/mocks/restricted-access/test2/input/project/index.md +0 -0
- package/tests/mocks/restricted-access/test2/input/toc.yaml +21 -0
- package/tests/mocks/restricted-access/test3/input/a1.md +1 -0
- package/tests/mocks/restricted-access/test3/input/folder1/a1.md +1 -0
- package/tests/mocks/restricted-access/test3/input/folder1/folder2/a1.md +1 -0
- package/tests/mocks/restricted-access/test3/input/folder1/folder2/toc.yaml +8 -0
- package/tests/mocks/restricted-access/test3/input/folder1/toc.yaml +10 -0
- package/tests/mocks/restricted-access/test3/input/index.md +0 -0
- package/tests/mocks/restricted-access/test3/input/toc.yaml +16 -0
- package/tests/mocks/rtl/multidirectional-languages/input/.yfm +1 -0
- package/tests/mocks/rtl/multidirectional-languages/input/ar/index.yaml +4 -0
- package/tests/mocks/rtl/multidirectional-languages/input/ar/page.md +1 -0
- package/tests/mocks/rtl/multidirectional-languages/input/ar/toc.yaml +5 -0
- package/tests/mocks/rtl/multidirectional-languages/input/en/index.yaml +9 -0
- package/tests/mocks/rtl/multidirectional-languages/input/en/page.md +7 -0
- package/tests/mocks/rtl/multidirectional-languages/input/en/toc.yaml +5 -0
- package/tests/mocks/rtl/rtl-language/input/.yfm +1 -0
- package/tests/mocks/rtl/rtl-language/input/index.yaml +4 -0
- package/tests/mocks/rtl/rtl-language/input/page.md +1 -0
- package/tests/mocks/rtl/rtl-language/input/toc.yaml +5 -0
- package/tests/mocks/search/input/.yfm +12 -0
- package/tests/mocks/search/input/index.md +3 -0
- package/tests/mocks/search/input/toc.yaml +1 -0
- package/tests/mocks/single-page/input/ru/index.yaml +9 -0
- package/tests/mocks/single-page/input/ru/page.md +14 -0
- package/tests/mocks/single-page/input/ru/project/config.md +1 -0
- package/tests/mocks/single-page/input/ru/toc.yaml +7 -0
- package/tests/mocks/skip-html-extension/monolingual/input/.yfm +1 -0
- package/tests/mocks/skip-html-extension/monolingual/input/folder/index.md +1 -0
- package/tests/mocks/skip-html-extension/monolingual/input/index-test-html/index.md +4 -0
- package/tests/mocks/skip-html-extension/monolingual/input/index.md +6 -0
- package/tests/mocks/skip-html-extension/monolingual/input/page1.md +3 -0
- package/tests/mocks/skip-html-extension/monolingual/input/page2.md +6 -0
- package/tests/mocks/skip-html-extension/monolingual/input/toc.yaml +13 -0
- package/tests/mocks/skip-html-extension/multilingual/input/.yfm +2 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/folder/index.md +1 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/index-test-html/index.md +4 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/index.md +6 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/page1.md +3 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/page2.md +6 -0
- package/tests/mocks/skip-html-extension/multilingual/input/en/toc.yaml +13 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/folder/index.md +1 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/index-test-html/index.md +4 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/index.md +5 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/page1.md +3 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/page2.md +6 -0
- package/tests/mocks/skip-html-extension/multilingual/input/ru/toc.yaml +12 -0
- package/tests/mocks/themer/test1/input/.yfm +3 -0
- package/tests/mocks/themer/test1/input/_assets/style/custom.css +3 -0
- package/tests/mocks/themer/test1/input/index.md +1 -0
- package/tests/mocks/themer/test1/input/theme.yaml +14 -0
- package/tests/mocks/themer/test1/input/toc.yaml +3 -0
- package/tests/mocks/themer/test2/input/index.md +1 -0
- package/tests/mocks/themer/test2/input/theme.yaml +8 -0
- package/tests/mocks/themer/test2/input/toc.yaml +3 -0
- package/tests/mocks/themer/test3/input/index.md +1 -0
- package/tests/mocks/themer/test3/input/toc.yaml +3 -0
- package/tests/mocks/themer/test4/input/index.md +1 -0
- package/tests/mocks/themer/test4/input/theme.yaml +3 -0
- package/tests/mocks/themer/test4/input/toc.yaml +3 -0
- package/tests/mocks/themer/test5/input/.yfm +1 -0
- package/tests/mocks/themer/test5/input/index.md +1 -0
- package/tests/mocks/themer/test5/input/toc.yaml +3 -0
- package/tests/mocks/themer/test6/input/.yfm +3 -0
- package/tests/mocks/themer/test6/input/index.md +11 -0
- package/tests/mocks/themer/test6/input/toc.yaml +5 -0
- package/tests/mocks/themer/test7/input/.yfm +3 -0
- package/tests/mocks/themer/test7/input/index.md +5 -0
- package/tests/mocks/themer/test7/input/theme.yaml +7 -0
- package/tests/mocks/themer/test7/input/toc.yaml +5 -0
- package/tests/mocks/themer/test8/input/.yfm +3 -0
- package/tests/mocks/themer/test8/input/index.md +5 -0
- package/tests/mocks/themer/test8/input/toc.yaml +5 -0
- package/tests/mocks/toc-label/input/.yfm +1 -0
- package/tests/mocks/toc-label/input/index.md +3 -0
- package/tests/mocks/toc-label/input/page1.md +3 -0
- package/tests/mocks/toc-label/input/toc.yaml +10 -0
- package/tests/mocks/translation/compose/input/openapi-spec.yaml.skl +41 -0
- package/tests/mocks/translation/compose/input/openapi-spec.yaml.xliff +52 -0
- package/tests/mocks/translation/compose/input/toc.yaml.skl +8 -0
- package/tests/mocks/translation/compose/input/toc.yaml.xliff +16 -0
- package/tests/mocks/translation/conditions/input/index.md +37 -0
- package/tests/mocks/translation/conditions/input/toc.yaml +5 -0
- package/tests/mocks/translation/custom-schema/custom-openapi-schema-30.yaml +1054 -0
- package/tests/mocks/translation/dir-files/input/.yfm +6 -0
- package/tests/mocks/translation/dir-files/input/ru/_includes/test.md +1 -0
- package/tests/mocks/translation/dir-files/input/ru/_no-translate/exclude.md +1 -0
- package/tests/mocks/translation/dir-files/input/ru/aboba.md +5 -0
- package/tests/mocks/translation/dir-files/input/ru/index.md +3 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/a1.md +3 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/folder1/a1.md +3 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/folder1/toc-i.yaml +3 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/index-yfm.md +2 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/index.yaml +24 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/not-in-toc.md +20 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/syntax/base.md +3 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/syntax/index.md +2 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/syntax/lists.md +1 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/toc.yaml +19 -0
- package/tests/mocks/translation/dir-files/input/ru/nested/use_filtered_above.md +4 -0
- package/tests/mocks/translation/dir-files/input/ru/no-var-page.md +3 -0
- package/tests/mocks/translation/dir-files/input/ru/not-in-toc.md +20 -0
- package/tests/mocks/translation/dir-files/input/ru/to-be-excluded.md +1 -0
- package/tests/mocks/translation/dir-files/input/ru/toc.yaml +13 -0
- package/tests/mocks/translation/no-translate/input/index.md +7 -0
- package/tests/mocks/translation/no-translate/input/no-translate.md +57 -0
- package/tests/mocks/translation/no-translate/input/openapi-spec.yaml +37 -0
- package/tests/mocks/translation/no-translate/input/toc.yaml +11 -0
- package/tests/mocks/translation/openapi/input/openapi-spec.yaml +50 -0
- package/tests/mocks/translation/openapi/input/toc.yaml +8 -0
- package/tests/mocks/translation/toc-include/input/included-toc/merged-included-toc-item.md +1 -0
- package/tests/mocks/translation/toc-include/input/included-toc/toc.yaml +3 -0
- package/tests/mocks/translation/toc-include/input/included-toc.md +1 -0
- package/tests/mocks/translation/toc-include/input/index.md +7 -0
- package/tests/mocks/translation/toc-include/input/merged-included-toc-item.md +1 -0
- package/tests/mocks/translation/toc-include/input/no-translate.md +57 -0
- package/tests/mocks/translation/toc-include/input/openapi-spec.yaml +37 -0
- package/tests/mocks/translation/toc-include/input/toc.yaml +14 -0
- package/tests/mocks/translation/yaml-scheme/input/ru/.yfm +1 -0
- package/tests/mocks/translation/yaml-scheme/input/ru/index-direct.yaml +133 -0
- package/tests/mocks/translation/yaml-scheme/input/ru/index.yaml +32 -0
- package/tests/mocks/translation/yaml-scheme/input/ru/toc.yaml +19 -0
- package/tests/mocks/vars-conditions/input/.yfm +1 -0
- package/tests/mocks/vars-conditions/input/index.md +3 -0
- package/tests/mocks/vars-conditions/input/page1.yaml +13 -0
- package/tests/mocks/vars-conditions/input/page2.md +24 -0
- package/tests/mocks/vars-conditions/input/page3.md +1 -0
- package/tests/mocks/vars-conditions/input/page4.md +1 -0
- package/tests/mocks/vars-conditions/input/page5.yaml +10 -0
- package/tests/mocks/vars-conditions/input/presets.yaml +9 -0
- package/tests/mocks/vars-conditions/input/toc.yaml +51 -0
- package/tests/mocks/vars-ignore/input/.yfm +1 -0
- package/tests/mocks/vars-ignore/input/data/data-test.md +4 -0
- package/tests/mocks/vars-ignore/input/data/presets.yaml +3 -0
- package/tests/mocks/vars-ignore/input/data/temp-test.md +4 -0
- package/tests/mocks/vars-ignore/input/ignored/ignored-test.md +4 -0
- package/tests/mocks/vars-ignore/input/ignored/presets.yaml +3 -0
- package/tests/mocks/vars-ignore/input/presets.yaml +3 -0
- package/tests/mocks/vars-ignore/input/test.md +6 -0
- package/tests/mocks/vars-ignore/input/toc.yaml +8 -0
- package/tests/mocks/warning/unreachable-autotitle/input/index.md +1 -0
- package/tests/mocks/warning/unreachable-autotitle/input/link.md +0 -0
- package/tests/mocks/warning/unreachable-autotitle/input/toc.yaml +4 -0
- package/tests/tsconfig.json +13 -0
- package/vitest.integration.config.ts +26 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import {existsSync, readFileSync} from 'node:fs';
|
|
2
|
+
import {resolve} from 'node:path';
|
|
3
|
+
import {describe, expect, it} from 'vitest';
|
|
4
|
+
|
|
5
|
+
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* These tests cover the CLI-side guarantees for the OpenAPI spec companion that are
|
|
9
|
+
* implemented in `packages/cli` (the openapi build wrapper + build-manifest feature):
|
|
10
|
+
* - the standalone `*.openapi.json` file lands in the final output tree (md2md);
|
|
11
|
+
* - its name is derived from the source spec (`petstore.yaml` -> `petstore.openapi.json`);
|
|
12
|
+
* - it is recorded in the build manifest with the exact emitted path and the sibling
|
|
13
|
+
* `index` leading page;
|
|
14
|
+
* - emission does not depend on `--build-manifest`;
|
|
15
|
+
* - for static md2html builds the companion hint is baked into the leading page `<body>`
|
|
16
|
+
* as an HTML comment (the viewer does this at serve time for md2md, but md2html has no
|
|
17
|
+
* viewer), gated by the companion actually being emitted.
|
|
18
|
+
*
|
|
19
|
+
* The companion *content* (filtering, x-hidden stripping, render-mode switching) is produced
|
|
20
|
+
* by `@diplodoc/openapi-extension` and is covered by that package's own unit tests.
|
|
21
|
+
*/
|
|
22
|
+
describe('OpenAPI spec companion (CLI build)', () => {
|
|
23
|
+
const COMPANION_PATH = 'api/petstore.openapi.json';
|
|
24
|
+
const LEADING_PAGE = 'api/index';
|
|
25
|
+
|
|
26
|
+
it('emits the .openapi.json companion into the md output tree', async () => {
|
|
27
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
28
|
+
|
|
29
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
30
|
+
md2md: true,
|
|
31
|
+
md2html: false,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const companion = resolve(outputPath, COMPANION_PATH);
|
|
35
|
+
expect(existsSync(companion)).toBe(true);
|
|
36
|
+
|
|
37
|
+
// The companion sits next to the generated leading page.
|
|
38
|
+
expect(existsSync(resolve(outputPath, 'api/index.md'))).toBe(true);
|
|
39
|
+
|
|
40
|
+
const raw = readFileSync(companion, 'utf-8');
|
|
41
|
+
|
|
42
|
+
// Valid JSON describing the spec.
|
|
43
|
+
const json = JSON.parse(raw);
|
|
44
|
+
expect(json.openapi).toBeTruthy();
|
|
45
|
+
expect(json.paths).toBeTruthy();
|
|
46
|
+
|
|
47
|
+
// Minified: no pretty-print whitespace.
|
|
48
|
+
expect(raw).not.toContain('\n');
|
|
49
|
+
expect(raw).toBe(JSON.stringify(json));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('emits the companion even without --build-manifest', async () => {
|
|
53
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
54
|
+
|
|
55
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
56
|
+
md2md: true,
|
|
57
|
+
md2html: false,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
61
|
+
// Manifest is opt-in, so it must be absent here.
|
|
62
|
+
expect(existsSync(resolve(outputPath, 'yfm-build-manifest.json'))).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('records the companion in the build manifest with the exact emitted path', async () => {
|
|
66
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
67
|
+
|
|
68
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
69
|
+
md2md: true,
|
|
70
|
+
md2html: false,
|
|
71
|
+
args: '--build-manifest',
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const manifest = JSON.parse(
|
|
75
|
+
readFileSync(resolve(outputPath, 'yfm-build-manifest.json'), 'utf-8'),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
expect(Array.isArray(manifest.openapiCompanions)).toBe(true);
|
|
79
|
+
|
|
80
|
+
const entry = manifest.openapiCompanions.find(
|
|
81
|
+
(c: {companionPath: string}) => c.companionPath === COMPANION_PATH,
|
|
82
|
+
);
|
|
83
|
+
expect(entry).toBeDefined();
|
|
84
|
+
expect(entry.leadingPage).toBe(LEADING_PAGE);
|
|
85
|
+
|
|
86
|
+
// The path advertised by the manifest must resolve to a real file in the output.
|
|
87
|
+
expect(existsSync(resolve(outputPath, entry.companionPath))).toBe(true);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const COMMENT =
|
|
91
|
+
'<!-- json-схема со спецификацией доступна по ссылке: petstore.openapi.json -->';
|
|
92
|
+
|
|
93
|
+
it('bakes the companion comment into the static html body (md2html + ai opt-in)', async () => {
|
|
94
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
95
|
+
|
|
96
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
97
|
+
md2md: false,
|
|
98
|
+
md2html: true,
|
|
99
|
+
// md2html emits the companion only when AI companions are explicitly enabled.
|
|
100
|
+
args: '--ai-openapi-companions',
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
104
|
+
|
|
105
|
+
const html = readFileSync(resolve(outputPath, 'api/index.html'), 'utf-8');
|
|
106
|
+
expect(html).toContain(COMMENT);
|
|
107
|
+
|
|
108
|
+
// The comment must live inside <body>.
|
|
109
|
+
const body = html.slice(html.indexOf('<body'), html.indexOf('</body>'));
|
|
110
|
+
expect(body).toContain(COMMENT);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('omits the companion and the comment for md2html without ai opt-in', async () => {
|
|
114
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
115
|
+
|
|
116
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
117
|
+
md2md: false,
|
|
118
|
+
md2html: true,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(false);
|
|
122
|
+
|
|
123
|
+
const html = readFileSync(resolve(outputPath, 'api/index.html'), 'utf-8');
|
|
124
|
+
expect(html).not.toContain('json-схема со спецификацией доступна по ссылке');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Covers the leading-page render-mode knobs introduced together with the companion:
|
|
130
|
+
* - `leadingPage.spec.renderMode: inline | link` (toc);
|
|
131
|
+
* - `--max-openapi-include-inline-size` auto-switching `inline -> link`;
|
|
132
|
+
* - `ai.openapiCompanions: false` disabling companion emission.
|
|
133
|
+
*
|
|
134
|
+
* Assertions look at the generated leading page (`api/index.md`) and the presence of the
|
|
135
|
+
* companion file, which are the observable CLI-side outputs of these knobs.
|
|
136
|
+
*/
|
|
137
|
+
describe('OpenAPI leading page render modes & params (CLI build)', () => {
|
|
138
|
+
const COMPANION_PATH = 'api/petstore.openapi.json';
|
|
139
|
+
const INDEX_MD = 'api/index.md';
|
|
140
|
+
// Inline mode embeds the spec inside a `{% cut %}` block; link mode points to the companion.
|
|
141
|
+
const INLINE_MARKER = '{% cut "Open API" %}';
|
|
142
|
+
const LINK_MARKER = '[Open API specification](petstore.openapi.json)';
|
|
143
|
+
|
|
144
|
+
it('renderMode: inline (default) embeds the spec and still emits the companion', async () => {
|
|
145
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
146
|
+
|
|
147
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
|
|
148
|
+
|
|
149
|
+
const index = readFileSync(resolve(outputPath, INDEX_MD), 'utf-8');
|
|
150
|
+
expect(index).toContain(INLINE_MARKER);
|
|
151
|
+
expect(index).not.toContain(LINK_MARKER);
|
|
152
|
+
|
|
153
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('renderMode: link renders a link to the companion instead of inlining it', async () => {
|
|
157
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion-link');
|
|
158
|
+
|
|
159
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
|
|
160
|
+
|
|
161
|
+
const index = readFileSync(resolve(outputPath, INDEX_MD), 'utf-8');
|
|
162
|
+
expect(index).toContain(LINK_MARKER);
|
|
163
|
+
expect(index).not.toContain(INLINE_MARKER);
|
|
164
|
+
|
|
165
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('--max-openapi-include-inline-size auto-switches inline -> link for large specs', async () => {
|
|
169
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
170
|
+
|
|
171
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
172
|
+
md2md: true,
|
|
173
|
+
md2html: false,
|
|
174
|
+
// 1 byte: any real spec exceeds it, forcing the link form.
|
|
175
|
+
args: '--max-openapi-include-inline-size 1',
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const index = readFileSync(resolve(outputPath, INDEX_MD), 'utf-8');
|
|
179
|
+
expect(index).toContain(LINK_MARKER);
|
|
180
|
+
expect(index).not.toContain(INLINE_MARKER);
|
|
181
|
+
|
|
182
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('--max-openapi-include-inline-size 0 always renders the spec as a link', async () => {
|
|
186
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion');
|
|
187
|
+
|
|
188
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
189
|
+
md2md: true,
|
|
190
|
+
md2html: false,
|
|
191
|
+
args: '--max-openapi-include-inline-size 0',
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const index = readFileSync(resolve(outputPath, INDEX_MD), 'utf-8');
|
|
195
|
+
expect(index).toContain(LINK_MARKER);
|
|
196
|
+
expect(index).not.toContain(INLINE_MARKER);
|
|
197
|
+
|
|
198
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(true);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('ai.openapiCompanions: false disables the companion file (md2md)', async () => {
|
|
202
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-companion-disabled');
|
|
203
|
+
|
|
204
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
|
|
205
|
+
|
|
206
|
+
expect(existsSync(resolve(outputPath, COMPANION_PATH))).toBe(false);
|
|
207
|
+
|
|
208
|
+
// With no companion to link to, the leading page falls back to inlining the spec.
|
|
209
|
+
const index = readFileSync(resolve(outputPath, INDEX_MD), 'utf-8');
|
|
210
|
+
expect(index).toContain(INLINE_MARKER);
|
|
211
|
+
expect(index).not.toContain(LINK_MARKER);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {readFileSync} from 'node:fs';
|
|
2
|
+
import {resolve} from 'node:path';
|
|
3
|
+
import {glob} from 'glob';
|
|
4
|
+
import {describe, expect, it} from 'vitest';
|
|
5
|
+
|
|
6
|
+
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
7
|
+
|
|
8
|
+
const STUB_MARKER = 'This page exceeds the maximum allowed size and cannot be displayed.';
|
|
9
|
+
|
|
10
|
+
describe('OpenAPI max include size', () => {
|
|
11
|
+
it('should replace oversized pages with stub when limit is exceeded', async () => {
|
|
12
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-include-size-exceeds');
|
|
13
|
+
|
|
14
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
15
|
+
md2md: true,
|
|
16
|
+
md2html: false,
|
|
17
|
+
args: '--max-openapi-include-size 1K',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const files = await glob('**/*.md', {cwd: outputPath, nodir: true});
|
|
21
|
+
expect(files.length).toBeGreaterThan(0);
|
|
22
|
+
|
|
23
|
+
const stubbed = [];
|
|
24
|
+
const preserved = [];
|
|
25
|
+
for (const file of files) {
|
|
26
|
+
const content = readFileSync(resolve(outputPath, file), 'utf-8');
|
|
27
|
+
if (content.includes(STUB_MARKER)) {
|
|
28
|
+
stubbed.push(file);
|
|
29
|
+
} else {
|
|
30
|
+
preserved.push(file);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Endpoint pages and main index exceed 1K and should be stubbed
|
|
35
|
+
expect(stubbed.length).toBeGreaterThan(0);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should preserve all content when pages are within limit', async () => {
|
|
39
|
+
const {inputPath, outputPath} = getTestPaths('mocks/openapi-include-size-within');
|
|
40
|
+
|
|
41
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
42
|
+
md2md: true,
|
|
43
|
+
md2html: false,
|
|
44
|
+
args: '--max-openapi-include-size 1K',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const files = await glob('**/*.md', {cwd: outputPath, nodir: true});
|
|
48
|
+
expect(files.length).toBeGreaterThan(0);
|
|
49
|
+
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const content = readFileSync(resolve(outputPath, file), 'utf-8');
|
|
52
|
+
expect(content).not.toContain(STUB_MARKER);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, cleanupDirectory, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
const generateMapTestTemplate = (
|
|
6
|
+
testTitle: string,
|
|
7
|
+
testRootPath: string,
|
|
8
|
+
args: string,
|
|
9
|
+
folder = 'pdf',
|
|
10
|
+
ignoreFileContent = false,
|
|
11
|
+
) => {
|
|
12
|
+
test(testTitle, async () => {
|
|
13
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
14
|
+
|
|
15
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
16
|
+
md2md: false,
|
|
17
|
+
md2html: true,
|
|
18
|
+
args,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
await compareDirectories(`${outputPath}/${folder}`, ignoreFileContent);
|
|
22
|
+
await cleanupDirectory(outputPath);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const generateMd2mdTestTemplate = async (testTitle: string, testRootPath: string) => {
|
|
27
|
+
test(testTitle, async () => {
|
|
28
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
29
|
+
|
|
30
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
31
|
+
md2md: true,
|
|
32
|
+
md2html: false,
|
|
33
|
+
args: '--allow-custom-resources', // this is common arg in arc ci for md2md
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
await compareDirectories(outputPath, true);
|
|
37
|
+
|
|
38
|
+
const midOutputFolder = 'final-output';
|
|
39
|
+
const finalOutputPath = outputPath
|
|
40
|
+
.split('/')
|
|
41
|
+
.slice(0, -1)
|
|
42
|
+
.concat(midOutputFolder)
|
|
43
|
+
.join('/');
|
|
44
|
+
|
|
45
|
+
await TestAdapter.testBuildPass(outputPath, finalOutputPath, {
|
|
46
|
+
md2md: false,
|
|
47
|
+
md2html: true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
await compareDirectories(finalOutputPath, true);
|
|
51
|
+
|
|
52
|
+
await cleanupDirectory(outputPath);
|
|
53
|
+
await cleanupDirectory(finalOutputPath);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
describe('Pdf page mode', () => {
|
|
58
|
+
generateMapTestTemplate(
|
|
59
|
+
'creates a pdf folder when the --pdf flag is specified',
|
|
60
|
+
'mocks/pdf-page/flag-enabled',
|
|
61
|
+
'-j2 --pdf',
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
generateMapTestTemplate(
|
|
65
|
+
'creates a pdf folder when the .yfm option is specified',
|
|
66
|
+
'mocks/pdf-page/yfm-config',
|
|
67
|
+
'-j2',
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
generateMapTestTemplate(
|
|
71
|
+
'creates pdf-page.json for each standalone toc',
|
|
72
|
+
'mocks/pdf-page/multiple-tocs',
|
|
73
|
+
'--pdf',
|
|
74
|
+
'',
|
|
75
|
+
true,
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('Pdf page with titles', () => {
|
|
80
|
+
generateMapTestTemplate(
|
|
81
|
+
'Generates content for pdf genrator with title pages',
|
|
82
|
+
'mocks/pdf-page/title-pages',
|
|
83
|
+
'--pdf',
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
generateMapTestTemplate(
|
|
87
|
+
'Generates pdf title pages as regular entries for debug purpose',
|
|
88
|
+
'mocks/pdf-page/title-pages',
|
|
89
|
+
'--pdf-debug',
|
|
90
|
+
'',
|
|
91
|
+
true,
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('Pdf generation with md2md phase, only files structure', () => {
|
|
96
|
+
generateMd2mdTestTemplate(
|
|
97
|
+
'Generates md2md content, then uses it for md2html render with pdf when .yfm options is specified',
|
|
98
|
+
'mocks/pdf-page/title-pages',
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe('Pdf page with custom icon', () => {
|
|
103
|
+
test('md2md copies custom pdf icon asset to output', async () => {
|
|
104
|
+
const {inputPath, outputPath} = getTestPaths('mocks/pdf-page/custom-pdf-icon');
|
|
105
|
+
|
|
106
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
107
|
+
md2md: true,
|
|
108
|
+
md2html: false,
|
|
109
|
+
args: '--allow-custom-resources',
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
await compareDirectories(outputPath, true);
|
|
113
|
+
await cleanupDirectory(outputPath);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('md2html copies all files and produces correct pdfIconConfig in __DATA__', async () => {
|
|
117
|
+
const {inputPath, outputPath} = getTestPaths('mocks/pdf-page/custom-pdf-icon');
|
|
118
|
+
|
|
119
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
120
|
+
md2md: false,
|
|
121
|
+
md2html: true,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
await compareDirectories(outputPath);
|
|
125
|
+
await cleanupDirectory(outputPath);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {describe, it} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
describe('plugin corner cases:', () => {
|
|
6
|
+
it('images in deflists — integrity check', async () => {
|
|
7
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
8
|
+
'mocks/plugin-corner-cases/images-in-deflists',
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
|
|
12
|
+
await compareDirectories(outputPath);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
const generateFilesYamlTestTemplate = (
|
|
6
|
+
testTitle: string,
|
|
7
|
+
testRootPath: string,
|
|
8
|
+
args: string[] = [],
|
|
9
|
+
) => {
|
|
10
|
+
test(testTitle, async () => {
|
|
11
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
12
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
13
|
+
md2md: true,
|
|
14
|
+
md2html: false,
|
|
15
|
+
args: args.concat(['--keep-not-var', '--id-generator', 'deterministic']).join(' '),
|
|
16
|
+
});
|
|
17
|
+
await TestAdapter.testBuildPass(outputPath, outputPath + '-html', {
|
|
18
|
+
md2md: false,
|
|
19
|
+
md2html: true,
|
|
20
|
+
args: args.concat(['--id-generator', 'deterministic']).join(' '),
|
|
21
|
+
});
|
|
22
|
+
await compareDirectories(outputPath);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe('Preprocess', () => {
|
|
27
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess', [
|
|
28
|
+
'--no-merge-autotitles',
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess');
|
|
32
|
+
|
|
33
|
+
generateFilesYamlTestTemplate(
|
|
34
|
+
'HashIncludes=true,Autotitles=true,Svg=true',
|
|
35
|
+
'mocks/preprocess',
|
|
36
|
+
['--merge-svg'],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// generateFilesYamlTestTemplate('Nested toc restricted access', 'mocks/preprocess/test3');
|
|
40
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
describe('Redirects validation', () => {
|
|
6
|
+
it('should emit an error on an unparseable redirects.yaml', async () => {
|
|
7
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/unparseable');
|
|
8
|
+
|
|
9
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
10
|
+
|
|
11
|
+
expect(report.code).toBe(1);
|
|
12
|
+
expect(report.errors).toContainEqual(expect.stringMatching(/redirects.yaml parsing error/));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it.skip('should emit a warning when supplied with a `redirects.yaml` that mentions file extensions', async () => {
|
|
16
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
17
|
+
'mocks/redirects-validation/extensions-deprecation',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
21
|
+
|
|
22
|
+
expect(report.code).toBe(0);
|
|
23
|
+
expect(report.warns).toContainEqual(
|
|
24
|
+
expect.stringMatching(/Redirects with explicit extensions are deprecated./),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should emit an error when an invalid regular expression pattern is encountered', async () => {
|
|
29
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/invalid-regex');
|
|
30
|
+
|
|
31
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
32
|
+
|
|
33
|
+
expect(report.code).toBe(1);
|
|
34
|
+
expect(report.errors).toContainEqual(
|
|
35
|
+
expect.stringMatching(
|
|
36
|
+
/Redirects configuration results in a non-valid regular expression/,
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should emit an error when a redirect is malformed', async () => {
|
|
42
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
43
|
+
'mocks/redirects-validation/malformed-redirect',
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
47
|
+
|
|
48
|
+
expect(report.code).toBe(1);
|
|
49
|
+
expect(report.errors).toContainEqual(
|
|
50
|
+
expect.stringMatching(/One of the two parameters is missing/),
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should emit an error when a redirect leads to the same path', async () => {
|
|
55
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/same-path');
|
|
56
|
+
|
|
57
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
58
|
+
|
|
59
|
+
expect(report.code).toBe(1);
|
|
60
|
+
expect(report.errors).toContainEqual(expect.stringMatching(/Parameters must be different/));
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {describe, it} from 'vitest';
|
|
2
|
+
import {dedent} from 'ts-dedent';
|
|
3
|
+
|
|
4
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
5
|
+
|
|
6
|
+
function test(_description: string) {
|
|
7
|
+
it('internal', async () => {
|
|
8
|
+
const {inputPath, outputPath} = getTestPaths('mocks/regression');
|
|
9
|
+
|
|
10
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
11
|
+
md2md: true,
|
|
12
|
+
md2html: false,
|
|
13
|
+
args: '-j2 --keep-not-var --add-system-meta --id-generator deterministic',
|
|
14
|
+
});
|
|
15
|
+
await TestAdapter.testBuildPass(outputPath, outputPath + '-html', {
|
|
16
|
+
md2md: false,
|
|
17
|
+
md2html: true,
|
|
18
|
+
args: '-j2 --id-generator deterministic',
|
|
19
|
+
});
|
|
20
|
+
await TestAdapter.testBuildPass(outputPath, outputPath + '-static-html', {
|
|
21
|
+
md2md: false,
|
|
22
|
+
md2html: true,
|
|
23
|
+
args: '-j2 --static-content --id-generator deterministic',
|
|
24
|
+
});
|
|
25
|
+
await compareDirectories(outputPath);
|
|
26
|
+
await compareDirectories(outputPath + '-html');
|
|
27
|
+
// await compareDirectories(outputPath + '-static-html');
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('Regression', {timeout: 90_000}, () => {
|
|
32
|
+
test(dedent`
|
|
33
|
+
- not_var liquid syntax
|
|
34
|
+
- normalize leading hrefs
|
|
35
|
+
- empty href in toc item
|
|
36
|
+
- term inside superscript: ^[?](*term)^
|
|
37
|
+
- term inside link text: [[?](*term)](url)
|
|
38
|
+
`);
|
|
39
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
const generateFilesYamlTestTemplate = (testTitle: string, testRootPath: string) => {
|
|
6
|
+
test(testTitle, async () => {
|
|
7
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
8
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true});
|
|
9
|
+
await compareDirectories(outputPath);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('Restricted access', () => {
|
|
14
|
+
generateFilesYamlTestTemplate('Simple restricted access', 'mocks/restricted-access/test1');
|
|
15
|
+
|
|
16
|
+
generateFilesYamlTestTemplate('Nested restricted access', 'mocks/restricted-access/test2');
|
|
17
|
+
|
|
18
|
+
generateFilesYamlTestTemplate('Nested toc restricted access', 'mocks/restricted-access/test3');
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {describe} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {generateMapTestTemplate} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
describe('Generate html document with correct lang and dir attributes. Load correct bundles.', () => {
|
|
6
|
+
generateMapTestTemplate(
|
|
7
|
+
'documentation with rtl and ltr langs',
|
|
8
|
+
'mocks/rtl/multidirectional-languages',
|
|
9
|
+
{md2html: true, md2md: false, args: '--allow-custom-resources'},
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
generateMapTestTemplate('documentation with only one rtl lang', 'mocks/rtl/rtl-language', {
|
|
13
|
+
md2html: true,
|
|
14
|
+
md2md: false,
|
|
15
|
+
args: '--allow-custom-resources',
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {describe, it} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
describe('Local search', () => {
|
|
6
|
+
it('internal', async () => {
|
|
7
|
+
const {inputPath, outputPath} = getTestPaths('mocks/search');
|
|
8
|
+
|
|
9
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
10
|
+
md2md: false,
|
|
11
|
+
md2html: true,
|
|
12
|
+
args: '-j2 --search --interface-toc',
|
|
13
|
+
});
|
|
14
|
+
await compareDirectories(outputPath);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
const generateMapTestSinglePageTemplate = (
|
|
6
|
+
testTitle: string,
|
|
7
|
+
testRootPath: string,
|
|
8
|
+
{md2md = true, md2html = true, args = '--single-page'},
|
|
9
|
+
) => {
|
|
10
|
+
test(testTitle, async () => {
|
|
11
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
12
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md, md2html, args});
|
|
13
|
+
await compareDirectories(outputPath);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('Single page mode', () => {
|
|
18
|
+
generateMapTestSinglePageTemplate(
|
|
19
|
+
'simple md2html single page with lang dirs',
|
|
20
|
+
'mocks/single-page',
|
|
21
|
+
{md2md: false},
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {describe} from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {generateMapTestTemplate} from '../fixtures';
|
|
4
|
+
|
|
5
|
+
describe('Skip html extension', () => {
|
|
6
|
+
generateMapTestTemplate(
|
|
7
|
+
'correctly trims .html and index.html on multilingual docs',
|
|
8
|
+
'mocks/skip-html-extension/multilingual',
|
|
9
|
+
{md2md: false, md2html: true, args: '-j2 --skip-html-extension'},
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
generateMapTestTemplate(
|
|
13
|
+
'correctly trims .html and index.html on monolingual docs',
|
|
14
|
+
'mocks/skip-html-extension/monolingual',
|
|
15
|
+
{md2md: false, md2html: true, args: '-j2 --skip-html-extension'},
|
|
16
|
+
);
|
|
17
|
+
});
|