@diplodoc/cli-tests 0.0.0-rc-reusable-e2es-202504041505
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/bin.mjs +30 -0
- package/e2e/__snapshots__/generate-map.spec.ts.snap +63 -0
- package/e2e/__snapshots__/include-toc.test.ts.snap +464 -0
- package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +487 -0
- package/e2e/__snapshots__/metadata.spec.ts.snap +241 -0
- package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
- package/e2e/__snapshots__/regression.test.ts.snap +1168 -0
- package/e2e/__snapshots__/rtl.spec.ts.snap +357 -0
- package/e2e/generate-map.spec.ts +40 -0
- package/e2e/include-toc.test.ts +57 -0
- package/e2e/load-custom-resources.spec.ts +37 -0
- package/e2e/metadata.spec.ts +27 -0
- package/e2e/plugin-corner-cases.spec.ts +16 -0
- package/e2e/regression.test.ts +34 -0
- package/e2e/rtl.spec.ts +30 -0
- package/fixtures/cliAdapter.ts +39 -0
- package/fixtures/index.ts +3 -0
- package/fixtures/runners/binary.ts +31 -0
- package/fixtures/runners/index.ts +15 -0
- package/fixtures/runners/source.ts +20 -0
- package/fixtures/runners/types.ts +4 -0
- package/fixtures/utils/file.ts +43 -0
- package/fixtures/utils/test.ts +31 -0
- package/mocks/fileContent/metadata/authorAliasInMetadata.md +7 -0
- package/mocks/fileContent/metadata/fullAuthorInMetadata.md +10 -0
- package/mocks/fileContent/metadata/includesContent/firstIncludeFile.md +7 -0
- package/mocks/fileContent/metadata/includesContent/secondIncludeFile.md +5 -0
- package/mocks/fileContent/metadata/includesContent/withIncludes.md +7 -0
- package/mocks/fileContent/metadata/keywordsInMetadata.md +9 -0
- package/mocks/fileContent/metadata/simpleMetadata.md +6 -0
- package/mocks/fileContent/metadata/substitutionsInMetadataPropertyKeys.md +7 -0
- package/mocks/fileContent/metadata/substitutionsInMetadataPropertyValues.md +11 -0
- package/mocks/fileContent/metadata/substitutionsWithEmptyString.md +7 -0
- package/mocks/fileContent/metadata/variableInMetadata.md +7 -0
- package/mocks/fileContent/metadata/withAdditionalSeparatorsInContent.md +9 -0
- package/mocks/fileContent/metadata/withoutMetadata.md +2 -0
- package/mocks/fileContent/metadata/withoutMetadataWithAdditionalSeparatorsInContent.md +6 -0
- package/mocks/generate-map/test1/input/.yfm +0 -0
- package/mocks/generate-map/test1/input/ru/_includes/file.md +0 -0
- package/mocks/generate-map/test1/input/ru/_includes/plugins.md +0 -0
- package/mocks/generate-map/test1/input/ru/folder1/a1.md +1 -0
- package/mocks/generate-map/test1/input/ru/folder1/folder2/a1.md +1 -0
- package/mocks/generate-map/test1/input/ru/folder1/folder2/toc.yaml +5 -0
- package/mocks/generate-map/test1/input/ru/folder1/toc.yaml +7 -0
- package/mocks/generate-map/test1/input/ru/index.md +0 -0
- package/mocks/generate-map/test1/input/ru/plugins/import.md +0 -0
- package/mocks/generate-map/test1/input/ru/plugins/index.md +0 -0
- package/mocks/generate-map/test1/input/ru/project/config.md +0 -0
- package/mocks/generate-map/test1/input/ru/project/index.md +0 -0
- package/mocks/generate-map/test1/input/ru/settings.md +0 -0
- package/mocks/generate-map/test1/input/ru/toc.yaml +22 -0
- package/mocks/generate-map/test2/input/en/_includes/file.md +0 -0
- package/mocks/generate-map/test2/input/en/_includes/plugins.md +0 -0
- package/mocks/generate-map/test2/input/en/index.md +0 -0
- package/mocks/generate-map/test2/input/en/plugins/import.md +0 -0
- package/mocks/generate-map/test2/input/en/plugins/index.md +0 -0
- package/mocks/generate-map/test2/input/en/project/config.md +0 -0
- package/mocks/generate-map/test2/input/en/project/index.md +0 -0
- package/mocks/generate-map/test2/input/en/settings.md +0 -0
- package/mocks/generate-map/test2/input/en/toc.yaml +18 -0
- package/mocks/generate-map/test2/input/ru/_includes/file.md +0 -0
- package/mocks/generate-map/test2/input/ru/_includes/plugins.md +0 -0
- package/mocks/generate-map/test2/input/ru/index.md +0 -0
- package/mocks/generate-map/test2/input/ru/plugins/import.md +0 -0
- package/mocks/generate-map/test2/input/ru/plugins/index.md +0 -0
- package/mocks/generate-map/test2/input/ru/project/config.md +0 -0
- package/mocks/generate-map/test2/input/ru/project/index.md +0 -0
- package/mocks/generate-map/test2/input/ru/settings.md +0 -0
- package/mocks/generate-map/test2/input/ru/toc.yaml +18 -0
- package/mocks/generate-map/test3/input/.yfm +0 -0
- package/mocks/generate-map/test3/input/ru/_includes/file.md +0 -0
- package/mocks/generate-map/test3/input/ru/_includes/plugins.md +0 -0
- package/mocks/generate-map/test3/input/ru/folder1/a1.md +1 -0
- package/mocks/generate-map/test3/input/ru/folder1/folder2/a1.md +1 -0
- package/mocks/generate-map/test3/input/ru/folder1/folder2/toc.yaml +5 -0
- package/mocks/generate-map/test3/input/ru/folder1/toc.yaml +7 -0
- package/mocks/generate-map/test3/input/ru/index.md +0 -0
- package/mocks/generate-map/test3/input/ru/plugins/import.md +0 -0
- package/mocks/generate-map/test3/input/ru/plugins/index.md +0 -0
- package/mocks/generate-map/test3/input/ru/project/config.md +0 -0
- package/mocks/generate-map/test3/input/ru/project/index.md +0 -0
- package/mocks/generate-map/test3/input/ru/settings.md +0 -0
- package/mocks/generate-map/test3/input/ru/toc.yaml +22 -0
- package/mocks/include-toc/test1/input/a1.md +1 -0
- package/mocks/include-toc/test1/input/folder1/a1.md +1 -0
- package/mocks/include-toc/test1/input/folder1/folder2/a1.md +1 -0
- package/mocks/include-toc/test1/input/folder1/folder2/toc.yaml +5 -0
- package/mocks/include-toc/test1/input/folder1/toc.yaml +7 -0
- package/mocks/include-toc/test1/input/toc.yaml +9 -0
- package/mocks/include-toc/test2/input/.yfm +1 -0
- package/mocks/include-toc/test2/input/file1.md +1 -0
- package/mocks/include-toc/test2/input/fileX.md +1 -0
- package/mocks/include-toc/test2/input/folder/fileA.md +11 -0
- package/mocks/include-toc/test2/input/folder/fileB.md +9 -0
- package/mocks/include-toc/test2/input/folder/folder/fileC.md +1 -0
- package/mocks/include-toc/test2/input/folder/folder/toc.yaml +3 -0
- package/mocks/include-toc/test2/input/folder/toc.yaml +6 -0
- package/mocks/include-toc/test2/input/presets.yaml +2 -0
- package/mocks/include-toc/test2/input/toc.yaml +6 -0
- package/mocks/include-toc/test3/input/product1/core/_includes/inc.md +1 -0
- package/mocks/include-toc/test3/input/product1/core/article1.md +3 -0
- package/mocks/include-toc/test3/input/product1/core/toc_m.yaml +2 -0
- package/mocks/include-toc/test3/input/product1/product/toc_p.yaml +3 -0
- package/mocks/include-toc/test3/input/product1/toc.yaml +3 -0
- package/mocks/include-toc/test3/input/product2/core/_includes/inc.md +1 -0
- package/mocks/include-toc/test3/input/product2/core/article1.md +3 -0
- package/mocks/include-toc/test3/input/product2/core/toc_m.yaml +2 -0
- package/mocks/include-toc/test3/input/product2/overlay1/product/article1.md +3 -0
- package/mocks/include-toc/test3/input/product2/overlay1/product/toc_p.yaml +3 -0
- package/mocks/include-toc/test3/input/product2/overlay1/toc.yaml +2 -0
- package/mocks/include-toc/test3/input/product2/overlay2/product/article1.md +3 -0
- package/mocks/include-toc/test3/input/product2/overlay2/product/toc_p.yaml +3 -0
- package/mocks/include-toc/test3/input/product2/overlay2/toc.yaml +2 -0
- package/mocks/include-toc/test3/input/product2/overlay3/product/toc_p.yaml +3 -0
- package/mocks/include-toc/test3/input/product2/overlay3/toc.yaml +2 -0
- package/mocks/include-toc/test3/input/product2/p2.md +4 -0
- package/mocks/include-toc/test3/input/product2/toc.yaml +10 -0
- package/mocks/include-toc/test4/input/a1.md +1 -0
- package/mocks/include-toc/test4/input/index.yaml +20 -0
- package/mocks/include-toc/test4/input/toc.yaml +9 -0
- package/mocks/include-toc/test5/input/core/concepts/toc_i.yaml +2 -0
- package/mocks/include-toc/test5/input/core/concepts/toc_p.yaml +3 -0
- package/mocks/include-toc/test5/input/core/toc_i.yaml +6 -0
- package/mocks/include-toc/test5/input/core/toc_m.yaml +3 -0
- package/mocks/include-toc/test5/input/core/toc_p.yaml +5 -0
- package/mocks/include-toc/test5/input/overlay/toc_p.yaml +3 -0
- package/mocks/include-toc/test5/input/toc.yaml +4 -0
- package/mocks/include-toc/test6/input/test/index.md +4 -0
- package/mocks/include-toc/test6/input/test/sub/sub/sub-3.md +1 -0
- package/mocks/include-toc/test6/input/test/sub/sub-1.md +5 -0
- package/mocks/include-toc/test6/input/test/sub/sub-2.md +1 -0
- package/mocks/include-toc/test6/input/test/test.md +1 -0
- package/mocks/include-toc/test6/input/toc.yaml +7 -0
- package/mocks/include-toc/test7/input/.yfm +1 -0
- package/mocks/include-toc/test7/input/ru/presets.yaml +2 -0
- package/mocks/include-toc/test7/input/ru/sub/folder/index.yaml +4 -0
- package/mocks/include-toc/test7/input/ru/sub/folder/toc.yaml +3 -0
- package/mocks/include-toc/test7/input/ru/toc.yaml +3 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/.yfm +5 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/_assets/script/test1.js +0 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/_assets/style/test.css +13 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/index.yaml +9 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/page.md +7 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/project/config.md +1 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/toc.yaml +7 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/.yfm +5 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/_assets/script/test1.js +0 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/_assets/style/test.css +13 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/index.yaml +9 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/page.md +7 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/project/config.md +1 -0
- package/mocks/load-custom-resources/md2md-with-resources/input/toc.yaml +7 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/.yfm +5 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/_assets/script/test1.js +0 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/_assets/style/test.css +13 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/index.yaml +9 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/page.md +7 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/project/config.md +1 -0
- package/mocks/load-custom-resources/single-page-with-resources/input/toc.yaml +7 -0
- package/mocks/metadata/md2html-with-metadata/input/index.yaml +9 -0
- package/mocks/metadata/md2html-with-metadata/input/page.md +7 -0
- package/mocks/metadata/md2html-with-metadata/input/presets.yaml +6 -0
- package/mocks/metadata/md2html-with-metadata/input/project/config.md +7 -0
- package/mocks/metadata/md2html-with-metadata/input/toc.yaml +7 -0
- package/mocks/metadata/md2md-with-metadata/input/index.yaml +9 -0
- package/mocks/metadata/md2md-with-metadata/input/page.md +7 -0
- package/mocks/metadata/md2md-with-metadata/input/presets.yaml +6 -0
- package/mocks/metadata/md2md-with-metadata/input/project/config.md +7 -0
- package/mocks/metadata/md2md-with-metadata/input/toc.yaml +7 -0
- package/mocks/plugin-corner-cases/images-in-deflists/input/image.jpeg +0 -0
- package/mocks/plugin-corner-cases/images-in-deflists/input/index.md +5 -0
- package/mocks/plugin-corner-cases/images-in-deflists/input/toc.yaml +4 -0
- package/mocks/regression/input/1.md +27 -0
- package/mocks/regression/input/_assets/1.png +0 -0
- package/mocks/regression/input/_assets/2.png +0 -0
- package/mocks/regression/input/_assets/3.png +0 -0
- package/mocks/regression/input/_assets/4.png +0 -0
- package/mocks/regression/input/_assets/empty.pdf +0 -0
- package/mocks/regression/input/autotitle.md +23 -0
- package/mocks/regression/input/commented-include.md +3 -0
- package/mocks/regression/input/images.md +9 -0
- package/mocks/regression/input/included-item.md +13 -0
- package/mocks/regression/input/includes/presets.yaml +2 -0
- package/mocks/regression/input/includes/test.md +1 -0
- package/mocks/regression/input/includes/user.md +1 -0
- package/mocks/regression/input/includes.md +5 -0
- package/mocks/regression/input/index.yaml +9 -0
- package/mocks/regression/input/latex.md +3 -0
- package/mocks/regression/input/merge/merge.md +3 -0
- package/mocks/regression/input/merge/presets.yaml +2 -0
- package/mocks/regression/input/merge/toc.yaml +4 -0
- package/mocks/regression/input/merge-source/merged.md +3 -0
- package/mocks/regression/input/merge-source/toc-m.yaml +4 -0
- package/mocks/regression/input/mermaid.md +13 -0
- package/mocks/regression/input/openapi-spec.yaml +37 -0
- package/mocks/regression/input/presets.yaml +8 -0
- package/mocks/regression/input/sub/folder/item-1.md +3 -0
- package/mocks/regression/input/sub/toc.yaml +5 -0
- package/mocks/regression/input/toc-i.yaml +3 -0
- package/mocks/regression/input/toc.yaml +30 -0
- package/mocks/rtl/multidirectional-languages/input/.yfm +1 -0
- package/mocks/rtl/multidirectional-languages/input/ar/index.yaml +4 -0
- package/mocks/rtl/multidirectional-languages/input/ar/page.md +1 -0
- package/mocks/rtl/multidirectional-languages/input/ar/toc.yaml +5 -0
- package/mocks/rtl/multidirectional-languages/input/en/index.yaml +9 -0
- package/mocks/rtl/multidirectional-languages/input/en/page.md +7 -0
- package/mocks/rtl/multidirectional-languages/input/en/toc.yaml +5 -0
- package/mocks/rtl/rtl-language/input/.yfm +1 -0
- package/mocks/rtl/rtl-language/input/index.yaml +4 -0
- package/mocks/rtl/rtl-language/input/page.md +1 -0
- package/mocks/rtl/rtl-language/input/toc.yaml +5 -0
- package/package.json +42 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +30 -0
package/bin.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import {spawn} from 'node:child_process';
|
|
4
|
+
import {dirname, join, resolve} from 'node:path';
|
|
5
|
+
import {fileURLToPath} from 'node:url';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const vitestPath = require.resolve('vitest');
|
|
10
|
+
|
|
11
|
+
const vitest = spawn(
|
|
12
|
+
join(dirname(vitestPath), 'vitest.mjs'),
|
|
13
|
+
[
|
|
14
|
+
'run',
|
|
15
|
+
'--config',
|
|
16
|
+
resolve(dirname(fileURLToPath(import.meta.url)), 'vitest.config.ts'),
|
|
17
|
+
...process.argv.slice(2),
|
|
18
|
+
],
|
|
19
|
+
{
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
env: {
|
|
22
|
+
...process.env,
|
|
23
|
+
NODE_ENV: 'test',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
vitest.on('exit', (code) => {
|
|
29
|
+
process.exit(code || 0);
|
|
30
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`Generate map for > project with external links in toc 1`] = `
|
|
4
|
+
"{
|
|
5
|
+
"files": [
|
|
6
|
+
"ru/",
|
|
7
|
+
"ru/folder1/a1",
|
|
8
|
+
"ru/folder1/folder2/a1",
|
|
9
|
+
"ru/plugins/",
|
|
10
|
+
"ru/project/",
|
|
11
|
+
"ru/settings"
|
|
12
|
+
]
|
|
13
|
+
}"
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`Generate map for > project with multiple language 1`] = `
|
|
17
|
+
"{
|
|
18
|
+
"files": [
|
|
19
|
+
"en/",
|
|
20
|
+
"en/plugins/",
|
|
21
|
+
"en/plugins/import",
|
|
22
|
+
"en/project/",
|
|
23
|
+
"en/project/config",
|
|
24
|
+
"en/settings",
|
|
25
|
+
"ru/",
|
|
26
|
+
"ru/plugins/",
|
|
27
|
+
"ru/plugins/import",
|
|
28
|
+
"ru/project/",
|
|
29
|
+
"ru/project/config",
|
|
30
|
+
"ru/settings"
|
|
31
|
+
]
|
|
32
|
+
}"
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports[`Generate map for > project with single language and toc include - only md2html 1`] = `
|
|
36
|
+
"{
|
|
37
|
+
"files": [
|
|
38
|
+
"ru/",
|
|
39
|
+
"ru/folder1/a1",
|
|
40
|
+
"ru/folder1/folder2/a1",
|
|
41
|
+
"ru/plugins/",
|
|
42
|
+
"ru/plugins/import",
|
|
43
|
+
"ru/project/",
|
|
44
|
+
"ru/project/config",
|
|
45
|
+
"ru/settings"
|
|
46
|
+
]
|
|
47
|
+
}"
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`Generate map for > project with single language and toc include 1`] = `
|
|
51
|
+
"{
|
|
52
|
+
"files": [
|
|
53
|
+
"ru/",
|
|
54
|
+
"ru/folder1/a1",
|
|
55
|
+
"ru/folder1/folder2/a1",
|
|
56
|
+
"ru/plugins/",
|
|
57
|
+
"ru/plugins/import",
|
|
58
|
+
"ru/project/",
|
|
59
|
+
"ru/project/config",
|
|
60
|
+
"ru/settings"
|
|
61
|
+
]
|
|
62
|
+
}"
|
|
63
|
+
`;
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > filelist 1`] = `
|
|
4
|
+
"[
|
|
5
|
+
"product1/_includes/inc.md",
|
|
6
|
+
"product1/article1.md",
|
|
7
|
+
"product1/toc.yaml",
|
|
8
|
+
"product2/overlay1/_includes/inc.md",
|
|
9
|
+
"product2/overlay1/article1.md",
|
|
10
|
+
"product2/overlay2/_includes/inc.md",
|
|
11
|
+
"product2/overlay2/article1.md",
|
|
12
|
+
"product2/overlay3/_includes/inc.md",
|
|
13
|
+
"product2/overlay3/article1.md",
|
|
14
|
+
"product2/p2.md",
|
|
15
|
+
"product2/toc.yaml"
|
|
16
|
+
]"
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product1/_includes/inc.md 1`] = `"This is the core include."`;
|
|
20
|
+
|
|
21
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product1/article1.md 1`] = `
|
|
22
|
+
"---
|
|
23
|
+
metadata:
|
|
24
|
+
- name: generator
|
|
25
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
26
|
+
sourcePath: product1/core/article1.md
|
|
27
|
+
---
|
|
28
|
+
This is the core content of Article 1.
|
|
29
|
+
|
|
30
|
+
{% include [x](_includes/inc.md) %}
|
|
31
|
+
"
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product1/toc.yaml 1`] = `
|
|
35
|
+
"title: Product 1 title
|
|
36
|
+
items:
|
|
37
|
+
- name: Article1
|
|
38
|
+
href: article1.md
|
|
39
|
+
"
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/_includes/inc.md 1`] = `
|
|
43
|
+
"This is the core include.
|
|
44
|
+
"
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/article1.md 1`] = `
|
|
48
|
+
"---
|
|
49
|
+
metadata:
|
|
50
|
+
- name: generator
|
|
51
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
52
|
+
sourcePath: product2/overlay1/product/article1.md
|
|
53
|
+
---
|
|
54
|
+
This is the overlay content of Article 1 for product 2.
|
|
55
|
+
|
|
56
|
+
{% include [x](_includes/inc.md) %}
|
|
57
|
+
"
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/_includes/inc.md 1`] = `
|
|
61
|
+
"This is the core include.
|
|
62
|
+
"
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/article1.md 1`] = `
|
|
66
|
+
"---
|
|
67
|
+
metadata:
|
|
68
|
+
- name: generator
|
|
69
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
70
|
+
sourcePath: product2/overlay2/product/article1.md
|
|
71
|
+
---
|
|
72
|
+
This is the overlay number #2 of Article 1 content for product 2.
|
|
73
|
+
|
|
74
|
+
{% include [x](_includes/inc.md) %}
|
|
75
|
+
"
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/_includes/inc.md 1`] = `
|
|
79
|
+
"This is the core include.
|
|
80
|
+
"
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/article1.md 1`] = `
|
|
84
|
+
"---
|
|
85
|
+
metadata:
|
|
86
|
+
- name: generator
|
|
87
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
88
|
+
sourcePath: product2/core/article1.md
|
|
89
|
+
---
|
|
90
|
+
This is the core content of Article 1.
|
|
91
|
+
|
|
92
|
+
{% include [x](_includes/inc.md) %}
|
|
93
|
+
"
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/p2.md 1`] = `
|
|
97
|
+
"---
|
|
98
|
+
metadata:
|
|
99
|
+
- name: generator
|
|
100
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
101
|
+
---
|
|
102
|
+
This is the product 2 specific article.
|
|
103
|
+
|
|
104
|
+
Check here link to [Article1 overlay 1](overlay1/article1.md)
|
|
105
|
+
Check here link to [Article1 overlay 2](overlay2/article1.md)"
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes > product2/toc.yaml 1`] = `
|
|
109
|
+
"title: Product 2 title
|
|
110
|
+
items:
|
|
111
|
+
- name: P2 Article
|
|
112
|
+
href: p2.md
|
|
113
|
+
- name: Overlay1
|
|
114
|
+
items:
|
|
115
|
+
- name: Article1
|
|
116
|
+
href: overlay1/article1.md
|
|
117
|
+
- name: Overlay 2
|
|
118
|
+
items:
|
|
119
|
+
- name: Article1
|
|
120
|
+
href: overlay2/article1.md
|
|
121
|
+
- name: Overlay 3
|
|
122
|
+
items:
|
|
123
|
+
- name: Article1
|
|
124
|
+
href: overlay3/article1.md
|
|
125
|
+
"
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes 2 > filelist 1`] = `
|
|
129
|
+
"[
|
|
130
|
+
"toc.yaml"
|
|
131
|
+
]"
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
exports[`Include toc > Nested toc inclusions with mixed including modes 2 > toc.yaml 1`] = `
|
|
135
|
+
"title: main
|
|
136
|
+
items:
|
|
137
|
+
- name: toc_i/item
|
|
138
|
+
- name: core/toc_m/item
|
|
139
|
+
- name: overlay/toc_p/item
|
|
140
|
+
- name: core/toc_i/item
|
|
141
|
+
- name: test
|
|
142
|
+
items:
|
|
143
|
+
- name: core/concepts/toc_i/item
|
|
144
|
+
- name: core/concepts/toc_p/item
|
|
145
|
+
"
|
|
146
|
+
`;
|
|
147
|
+
|
|
148
|
+
exports[`Include toc > Toc is included in link mode > a1.md 1`] = `
|
|
149
|
+
"---
|
|
150
|
+
metadata:
|
|
151
|
+
- name: generator
|
|
152
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
153
|
+
---
|
|
154
|
+
This is the /a1.md file content.
|
|
155
|
+
"
|
|
156
|
+
`;
|
|
157
|
+
|
|
158
|
+
exports[`Include toc > Toc is included in link mode > filelist 1`] = `
|
|
159
|
+
"[
|
|
160
|
+
"a1.md",
|
|
161
|
+
"folder1/a1.md",
|
|
162
|
+
"folder1/folder2/a1.md",
|
|
163
|
+
"toc.yaml"
|
|
164
|
+
]"
|
|
165
|
+
`;
|
|
166
|
+
|
|
167
|
+
exports[`Include toc > Toc is included in link mode > folder1/a1.md 1`] = `
|
|
168
|
+
"---
|
|
169
|
+
metadata:
|
|
170
|
+
- name: generator
|
|
171
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
172
|
+
---
|
|
173
|
+
This is the /folder1/a1.md file content.
|
|
174
|
+
"
|
|
175
|
+
`;
|
|
176
|
+
|
|
177
|
+
exports[`Include toc > Toc is included in link mode > folder1/folder2/a1.md 1`] = `
|
|
178
|
+
"---
|
|
179
|
+
metadata:
|
|
180
|
+
- name: generator
|
|
181
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
182
|
+
---
|
|
183
|
+
This is the /folder1/folder1/a1.md file content.
|
|
184
|
+
"
|
|
185
|
+
`;
|
|
186
|
+
|
|
187
|
+
exports[`Include toc > Toc is included in link mode > toc.yaml 1`] = `
|
|
188
|
+
"items:
|
|
189
|
+
- name: A1
|
|
190
|
+
href: a1.md
|
|
191
|
+
- name: folder1
|
|
192
|
+
items:
|
|
193
|
+
- name: A1
|
|
194
|
+
href: folder1/a1.md
|
|
195
|
+
- name: folder1
|
|
196
|
+
items:
|
|
197
|
+
- name: A1
|
|
198
|
+
href: folder1/folder2/a1.md
|
|
199
|
+
"
|
|
200
|
+
`;
|
|
201
|
+
|
|
202
|
+
exports[`Include toc > Toc is included inline, not as a new section > .yfm 1`] = `
|
|
203
|
+
"applyPresets: true
|
|
204
|
+
"
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
exports[`Include toc > Toc is included inline, not as a new section > file1.md 1`] = `
|
|
208
|
+
"---
|
|
209
|
+
metadata:
|
|
210
|
+
- name: generator
|
|
211
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
212
|
+
---
|
|
213
|
+
# File 1
|
|
214
|
+
"
|
|
215
|
+
`;
|
|
216
|
+
|
|
217
|
+
exports[`Include toc > Toc is included inline, not as a new section > fileA.md 1`] = `
|
|
218
|
+
"---
|
|
219
|
+
metadata:
|
|
220
|
+
- name: generator
|
|
221
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
222
|
+
sourcePath: folder/fileA.md
|
|
223
|
+
title: File A
|
|
224
|
+
description: YFM description
|
|
225
|
+
---
|
|
226
|
+
# File A
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
"
|
|
234
|
+
`;
|
|
235
|
+
|
|
236
|
+
exports[`Include toc > Toc is included inline, not as a new section > fileB.md 1`] = `
|
|
237
|
+
"---
|
|
238
|
+
metadata:
|
|
239
|
+
- name: generator
|
|
240
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
241
|
+
sourcePath: folder/fileB.md
|
|
242
|
+
---
|
|
243
|
+
# File B
|
|
244
|
+
|
|
245
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
"
|
|
253
|
+
`;
|
|
254
|
+
|
|
255
|
+
exports[`Include toc > Toc is included inline, not as a new section > fileC.md 1`] = `
|
|
256
|
+
"---
|
|
257
|
+
metadata:
|
|
258
|
+
- name: generator
|
|
259
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
260
|
+
sourcePath: folder/folder/fileC.md
|
|
261
|
+
---
|
|
262
|
+
# File C
|
|
263
|
+
"
|
|
264
|
+
`;
|
|
265
|
+
|
|
266
|
+
exports[`Include toc > Toc is included inline, not as a new section > fileX.md 1`] = `
|
|
267
|
+
"---
|
|
268
|
+
metadata:
|
|
269
|
+
- name: generator
|
|
270
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
271
|
+
---
|
|
272
|
+
# File X
|
|
273
|
+
"
|
|
274
|
+
`;
|
|
275
|
+
|
|
276
|
+
exports[`Include toc > Toc is included inline, not as a new section > filelist 1`] = `
|
|
277
|
+
"[
|
|
278
|
+
".yfm",
|
|
279
|
+
"file1.md",
|
|
280
|
+
"fileA.md",
|
|
281
|
+
"fileB.md",
|
|
282
|
+
"fileC.md",
|
|
283
|
+
"fileX.md",
|
|
284
|
+
"toc.yaml"
|
|
285
|
+
]"
|
|
286
|
+
`;
|
|
287
|
+
|
|
288
|
+
exports[`Include toc > Toc is included inline, not as a new section > toc.yaml 1`] = `
|
|
289
|
+
"items:
|
|
290
|
+
- name: Name1
|
|
291
|
+
href: file1.md
|
|
292
|
+
- name: NameA
|
|
293
|
+
href: fileA.md
|
|
294
|
+
- name: NameB
|
|
295
|
+
href: fileB.md
|
|
296
|
+
- name: NameC
|
|
297
|
+
href: fileC.md
|
|
298
|
+
- name: NameX
|
|
299
|
+
href: fileX.md
|
|
300
|
+
"
|
|
301
|
+
`;
|
|
302
|
+
|
|
303
|
+
exports[`Include toc > Toc root merge on non root dir > .yfm 1`] = `
|
|
304
|
+
"allowHtml: true
|
|
305
|
+
"
|
|
306
|
+
`;
|
|
307
|
+
|
|
308
|
+
exports[`Include toc > Toc root merge on non root dir > filelist 1`] = `
|
|
309
|
+
"[
|
|
310
|
+
".yfm",
|
|
311
|
+
"ru/index.yaml",
|
|
312
|
+
"ru/toc.yaml"
|
|
313
|
+
]"
|
|
314
|
+
`;
|
|
315
|
+
|
|
316
|
+
exports[`Include toc > Toc root merge on non root dir > ru/index.yaml 1`] = `
|
|
317
|
+
"blocks:
|
|
318
|
+
- type: header-block
|
|
319
|
+
title: Title
|
|
320
|
+
description: Description
|
|
321
|
+
links: []
|
|
322
|
+
meta:
|
|
323
|
+
metadata:
|
|
324
|
+
- name: generator
|
|
325
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
326
|
+
sourcePath: ru/sub/folder/index.yaml
|
|
327
|
+
"
|
|
328
|
+
`;
|
|
329
|
+
|
|
330
|
+
exports[`Include toc > Toc root merge on non root dir > ru/toc.yaml 1`] = `
|
|
331
|
+
"title: Toc
|
|
332
|
+
items:
|
|
333
|
+
- name: sub-page
|
|
334
|
+
href: index.yaml
|
|
335
|
+
"
|
|
336
|
+
`;
|
|
337
|
+
|
|
338
|
+
exports[`Include toc > Toc with expressions > a1.md 1`] = `
|
|
339
|
+
"---
|
|
340
|
+
metadata:
|
|
341
|
+
- name: generator
|
|
342
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
343
|
+
---
|
|
344
|
+
This is the /a1.md file content.
|
|
345
|
+
"
|
|
346
|
+
`;
|
|
347
|
+
|
|
348
|
+
exports[`Include toc > Toc with expressions > filelist 1`] = `
|
|
349
|
+
"[
|
|
350
|
+
"a1.md",
|
|
351
|
+
"index.yaml",
|
|
352
|
+
"toc.yaml"
|
|
353
|
+
]"
|
|
354
|
+
`;
|
|
355
|
+
|
|
356
|
+
exports[`Include toc > Toc with expressions > index.yaml 1`] = `
|
|
357
|
+
"title: Title A
|
|
358
|
+
description:
|
|
359
|
+
- Desc A
|
|
360
|
+
meta:
|
|
361
|
+
metadata:
|
|
362
|
+
- name: generator
|
|
363
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
364
|
+
title: Meta A
|
|
365
|
+
links:
|
|
366
|
+
- title: A1
|
|
367
|
+
description: A1 desc
|
|
368
|
+
href: a1
|
|
369
|
+
"
|
|
370
|
+
`;
|
|
371
|
+
|
|
372
|
+
exports[`Include toc > Toc with expressions > toc.yaml 1`] = `
|
|
373
|
+
"title: Title A
|
|
374
|
+
href: index.yaml
|
|
375
|
+
items:
|
|
376
|
+
- name: A1
|
|
377
|
+
href: a1.md
|
|
378
|
+
"
|
|
379
|
+
`;
|
|
380
|
+
|
|
381
|
+
exports[`Include toc > Toc with generic includer > filelist 1`] = `
|
|
382
|
+
"[
|
|
383
|
+
"test/index.md",
|
|
384
|
+
"test/sub/sub-1.md",
|
|
385
|
+
"test/sub/sub-2.md",
|
|
386
|
+
"test/sub/sub/sub-3.md",
|
|
387
|
+
"test/test.md",
|
|
388
|
+
"toc.yaml"
|
|
389
|
+
]"
|
|
390
|
+
`;
|
|
391
|
+
|
|
392
|
+
exports[`Include toc > Toc with generic includer > test/index.md 1`] = `
|
|
393
|
+
"---
|
|
394
|
+
metadata:
|
|
395
|
+
- name: generator
|
|
396
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
397
|
+
---
|
|
398
|
+
# H1
|
|
399
|
+
|
|
400
|
+
[same level link](./test.md)
|
|
401
|
+
[inner link](./sub/sub-1.md)
|
|
402
|
+
"
|
|
403
|
+
`;
|
|
404
|
+
|
|
405
|
+
exports[`Include toc > Toc with generic includer > test/sub/sub/sub-3.md 1`] = `
|
|
406
|
+
"---
|
|
407
|
+
metadata:
|
|
408
|
+
- name: generator
|
|
409
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
410
|
+
---
|
|
411
|
+
# H1"
|
|
412
|
+
`;
|
|
413
|
+
|
|
414
|
+
exports[`Include toc > Toc with generic includer > test/sub/sub-1.md 1`] = `
|
|
415
|
+
"---
|
|
416
|
+
metadata:
|
|
417
|
+
- name: generator
|
|
418
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
419
|
+
---
|
|
420
|
+
# H1
|
|
421
|
+
|
|
422
|
+
[same level link](./sub-2.md)
|
|
423
|
+
[outer link](../test.md)
|
|
424
|
+
[inner link](./sub/sub-3.md)
|
|
425
|
+
"
|
|
426
|
+
`;
|
|
427
|
+
|
|
428
|
+
exports[`Include toc > Toc with generic includer > test/sub/sub-2.md 1`] = `
|
|
429
|
+
"---
|
|
430
|
+
metadata:
|
|
431
|
+
- name: generator
|
|
432
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
433
|
+
---
|
|
434
|
+
# H1"
|
|
435
|
+
`;
|
|
436
|
+
|
|
437
|
+
exports[`Include toc > Toc with generic includer > test/test.md 1`] = `
|
|
438
|
+
"---
|
|
439
|
+
metadata:
|
|
440
|
+
- name: generator
|
|
441
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
442
|
+
---
|
|
443
|
+
# H1"
|
|
444
|
+
`;
|
|
445
|
+
|
|
446
|
+
exports[`Include toc > Toc with generic includer > toc.yaml 1`] = `
|
|
447
|
+
"title: main
|
|
448
|
+
items:
|
|
449
|
+
- name: test
|
|
450
|
+
href: test/test.md
|
|
451
|
+
- name: Overview
|
|
452
|
+
href: test/index.md
|
|
453
|
+
- name: sub
|
|
454
|
+
items:
|
|
455
|
+
- name: sub-2
|
|
456
|
+
href: test/sub/sub-2.md
|
|
457
|
+
- name: sub-1
|
|
458
|
+
href: test/sub/sub-1.md
|
|
459
|
+
- name: sub
|
|
460
|
+
items:
|
|
461
|
+
- name: sub-3
|
|
462
|
+
href: test/sub/sub/sub-3.md
|
|
463
|
+
"
|
|
464
|
+
`;
|