@diplodoc/cli-tests 0.0.0-rc-fix-translate-openapi-includer-202507171205 → 0.0.0-rc-liquid-conditions-saving-202509050811
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/e2e/__snapshots__/generate-map.spec.ts.snap +345 -0
- package/e2e/__snapshots__/include-toc.test.ts.snap +8 -0
- package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +64 -59
- package/e2e/__snapshots__/metadata.spec.ts.snap +29 -24
- package/e2e/__snapshots__/preprocess.test.ts.snap +549 -0
- package/e2e/__snapshots__/regression.test.ts.snap +177 -142
- package/e2e/__snapshots__/rtl.spec.ts.snap +44 -41
- package/e2e/__snapshots__/search.test.ts.snap +37 -22
- package/e2e/__snapshots__/skip-html-extension.spec.ts.snap +211 -0
- package/e2e/__snapshots__/translation.spec.ts.snap +518 -2
- package/e2e/errors.spec.ts +33 -2
- package/e2e/generate-map.spec.ts +9 -3
- package/e2e/preprocess.test.ts +33 -0
- package/e2e/redirects-validation.spec.ts +61 -0
- package/e2e/search.test.ts +1 -1
- package/e2e/skip-html-extension.spec.ts +15 -0
- package/e2e/translation.spec.ts +47 -2
- package/fixtures/cliAdapter.ts +23 -0
- package/fixtures/globals.d.ts +4 -0
- package/fixtures/runners/binary.ts +4 -3
- package/fixtures/runners/types.ts +1 -2
- package/fixtures/utils/file.ts +5 -5
- package/fixtures/utils/test.ts +17 -8
- package/mocks/docs-viewer-interface/input/.yfm +6 -0
- package/mocks/docs-viewer-interface/input/index.md +3 -0
- package/mocks/docs-viewer-interface/input/toc.yaml +5 -0
- package/mocks/errors/extract-filtered-link/input/filtered.md +1 -0
- package/mocks/errors/extract-filtered-link/input/filtered2.md +0 -0
- package/mocks/errors/extract-filtered-link/input/index.md +7 -0
- package/mocks/errors/extract-filtered-link/input/toc.yaml +1 -0
- package/mocks/load-custom-resources/md2html-with-resources/input/page.md +9 -2
- package/mocks/load-custom-resources/md2md-with-resources/input/page.md +9 -2
- package/mocks/load-custom-resources/single-page-with-resources/input/page.md +9 -2
- package/mocks/metadata/md2html-with-metadata/input/page.md +8 -1
- package/mocks/metadata/md2md-with-metadata/input/page.md +7 -0
- package/mocks/preprocess/input/.yfm +1 -0
- package/mocks/preprocess/input/1.md +29 -0
- package/mocks/preprocess/input/_assets/1.png +0 -0
- package/mocks/preprocess/input/_assets/1.svg +0 -0
- package/mocks/preprocess/input/autotitle.md +23 -0
- package/mocks/preprocess/input/commented-include.md +3 -0
- package/mocks/preprocess/input/images.md +5 -0
- package/mocks/preprocess/input/included-item.md +12 -0
- package/mocks/preprocess/input/includes/deep.md +1 -0
- package/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
- package/mocks/preprocess/input/includes/presets.yaml +2 -0
- package/mocks/preprocess/input/includes/sub/user.md +1 -0
- package/mocks/preprocess/input/includes/sub/userWithIndent.md +5 -0
- package/mocks/preprocess/input/includes/test.md +1 -0
- package/mocks/preprocess/input/includes/user.md +1 -0
- package/mocks/preprocess/input/includes.md +18 -0
- package/mocks/preprocess/input/latex.md +3 -0
- package/mocks/preprocess/input/mermaid.md +13 -0
- package/mocks/preprocess/input/presets.yaml +8 -0
- package/mocks/preprocess/input/sub/folder/item-1.md +7 -0
- package/mocks/preprocess/input/sub/toc.yaml +5 -0
- package/mocks/preprocess/input/toc-i.yaml +3 -0
- package/mocks/preprocess/input/toc.yaml +16 -0
- package/mocks/redirects-validation/extensions-deprecation/input/blah.md +0 -0
- package/mocks/redirects-validation/extensions-deprecation/input/redirects.yaml +5 -0
- package/mocks/redirects-validation/extensions-deprecation/input/toc.yaml +4 -0
- package/mocks/redirects-validation/invalid-regex/input/blah.md +0 -0
- package/mocks/redirects-validation/invalid-regex/input/redirects.yaml +3 -0
- package/mocks/redirects-validation/invalid-regex/input/toc.yaml +4 -0
- package/mocks/redirects-validation/malformed-redirect/input/blah.md +0 -0
- package/mocks/redirects-validation/malformed-redirect/input/redirects.yaml +6 -0
- package/mocks/redirects-validation/malformed-redirect/input/toc.yaml +4 -0
- package/mocks/redirects-validation/same-path/input/blah.md +0 -0
- package/mocks/redirects-validation/same-path/input/redirects.yaml +3 -0
- package/mocks/redirects-validation/same-path/input/toc.yaml +4 -0
- package/mocks/redirects-validation/unparseable/input/blah.md +0 -0
- package/mocks/redirects-validation/unparseable/input/redirects.yaml +11 -0
- package/mocks/redirects-validation/unparseable/input/toc.yaml +4 -0
- package/mocks/regression/input/.yfm +2 -0
- package/mocks/regression/input/images.md +2 -0
- package/mocks/regression/input/includes/deep.md +2 -0
- package/mocks/regression/input/includes/presets.yaml +1 -0
- package/mocks/regression/input/includes/tools.md +1 -0
- package/mocks/regression/input/includes.md +5 -0
- package/mocks/regression/input/merge/merge.md +2 -0
- package/mocks/regression/input/merge/presets.yaml +1 -0
- package/mocks/regression/input/merge/toc.yaml +2 -0
- package/mocks/regression/input/presets.yaml +1 -0
- package/mocks/regression/input/toc.yaml +2 -0
- package/mocks/search/input/.yfm +12 -0
- package/mocks/skip-html-extension/input/.yfm +1 -0
- package/mocks/skip-html-extension/input/folder/index.md +1 -0
- package/mocks/skip-html-extension/input/index-test-html/index.md +4 -0
- package/mocks/skip-html-extension/input/index.md +6 -0
- package/mocks/skip-html-extension/input/page1.md +3 -0
- package/mocks/skip-html-extension/input/page2.md +6 -0
- package/mocks/skip-html-extension/input/toc.yaml +13 -0
- package/mocks/translation/conditions/input/index.md +37 -0
- package/mocks/translation/dir-files/input/.yfm +6 -0
- package/mocks/translation/dir-files/input/ru/aboba.md +2 -4
- package/mocks/translation/dir-files/input/ru/nested/a1.md +3 -0
- package/mocks/translation/dir-files/input/ru/nested/folder1/a1.md +3 -0
- package/mocks/translation/dir-files/input/ru/nested/folder1/toc-i.yaml +3 -0
- package/mocks/translation/dir-files/input/ru/nested/syntax/base.md +2 -0
- package/mocks/translation/dir-files/input/ru/nested/toc.yaml +1 -0
- package/mocks/translation/dir-files/input/ru/no-var-page.md +3 -0
- package/mocks/translation/dir-files/input/ru/to-be-excluded.md +1 -0
- package/mocks/translation/dir-files/input/ru/toc.yaml +7 -1
- package/mocks/translation/openapi/input/toc.yaml +1 -1
- package/mocks/warning/unreachable-autotitle/input/index.md +1 -0
- package/mocks/warning/unreachable-autotitle/input/link.md +0 -0
- package/mocks/warning/unreachable-autotitle/input/toc.yaml +4 -0
- package/package.json +5 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {describe, test} from 'vitest';
|
|
2
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
3
|
+
|
|
4
|
+
const generateFilesYamlTestTemplate = (
|
|
5
|
+
testTitle: string,
|
|
6
|
+
testRootPath: string,
|
|
7
|
+
args: string[] = [],
|
|
8
|
+
) => {
|
|
9
|
+
test(testTitle, async () => {
|
|
10
|
+
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
11
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
12
|
+
md2md:true,
|
|
13
|
+
md2html: false,
|
|
14
|
+
args: args.join(' '),
|
|
15
|
+
});
|
|
16
|
+
await TestAdapter.testBuildPass(outputPath, outputPath + '-html', {
|
|
17
|
+
md2md: false,
|
|
18
|
+
md2html: true,
|
|
19
|
+
args: args.join(' '),
|
|
20
|
+
});
|
|
21
|
+
await compareDirectories(outputPath);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
describe('Preprocess', () => {
|
|
26
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess', [
|
|
27
|
+
'--no-merge-autotitles'
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess');
|
|
31
|
+
|
|
32
|
+
// generateFilesYamlTestTemplate('Nested toc restricted access', 'mocks/preprocess/test3');
|
|
33
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
3
|
+
|
|
4
|
+
describe('Redirects validation', () => {
|
|
5
|
+
it('should emit an error on an unparseable redirects.yaml', async () => {
|
|
6
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/unparseable');
|
|
7
|
+
|
|
8
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
9
|
+
|
|
10
|
+
expect(report.code).toBe(1);
|
|
11
|
+
expect(report.errors).toContainEqual(expect.stringMatching(/redirects.yaml parsing error/));
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it.skip('should emit a warning when supplied with a `redirects.yaml` that mentions file extensions', async () => {
|
|
15
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
16
|
+
'mocks/redirects-validation/extensions-deprecation',
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
20
|
+
|
|
21
|
+
expect(report.code).toBe(0);
|
|
22
|
+
expect(report.warns).toContainEqual(
|
|
23
|
+
expect.stringMatching(/Redirects with explicit extensions are deprecated./),
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should emit an error when an invalid regular expression pattern is encountered', async () => {
|
|
28
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/invalid-regex');
|
|
29
|
+
|
|
30
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
31
|
+
|
|
32
|
+
expect(report.code).toBe(1);
|
|
33
|
+
expect(report.errors).toContainEqual(
|
|
34
|
+
expect.stringMatching(
|
|
35
|
+
/Redirects configuration results in a non-valid regular expression/,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should emit an error when a redirect is malformed', async () => {
|
|
41
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/malformed-redirect');
|
|
42
|
+
|
|
43
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
44
|
+
|
|
45
|
+
expect(report.code).toBe(1);
|
|
46
|
+
expect(report.errors).toContainEqual(
|
|
47
|
+
expect.stringMatching(/One of the two parameters is missing/),
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should emit an error when a redirect leads to the same path', async () => {
|
|
52
|
+
const {inputPath, outputPath} = getTestPaths('mocks/redirects-validation/same-path');
|
|
53
|
+
|
|
54
|
+
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
55
|
+
|
|
56
|
+
expect(report.code).toBe(1);
|
|
57
|
+
expect(report.errors).toContainEqual(
|
|
58
|
+
expect.stringMatching(/Parameters must be different/),
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
});
|
package/e2e/search.test.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {describe, it} from 'vitest';
|
|
2
|
+
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
3
|
+
|
|
4
|
+
describe('Skip html extension', () => {
|
|
5
|
+
it('transforms links correctly', async () => {
|
|
6
|
+
const {inputPath, outputPath} = getTestPaths('mocks/skip-html-extension');
|
|
7
|
+
|
|
8
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
9
|
+
md2md: false,
|
|
10
|
+
md2html: true,
|
|
11
|
+
args: '-j2 --skip-html-extension',
|
|
12
|
+
});
|
|
13
|
+
await compareDirectories(outputPath);
|
|
14
|
+
});
|
|
15
|
+
});
|
package/e2e/translation.spec.ts
CHANGED
|
@@ -7,7 +7,7 @@ const generateMapTestTemplate = (
|
|
|
7
7
|
args: TranslateRunArgs,
|
|
8
8
|
ignoreFileContent = true,
|
|
9
9
|
) => {
|
|
10
|
-
test
|
|
10
|
+
test(testTitle, async () => {
|
|
11
11
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
12
12
|
|
|
13
13
|
await TestAdapter.testTranslatePass(inputPath, outputPath, args);
|
|
@@ -56,10 +56,17 @@ describe('Translate command', () => {
|
|
|
56
56
|
target: 'es-ES',
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
generateMapTestTemplate('do not filter files on extract', 'mocks/translation/dir-files', {
|
|
60
|
+
subcommand: 'extract',
|
|
61
|
+
source: 'ru-RU',
|
|
62
|
+
target: 'es-ES',
|
|
63
|
+
});
|
|
64
|
+
|
|
59
65
|
generateMapTestTemplate('filter files on extract', 'mocks/translation/dir-files', {
|
|
60
66
|
subcommand: 'extract',
|
|
61
67
|
source: 'ru-RU',
|
|
62
68
|
target: 'es-ES',
|
|
69
|
+
additionalArgs: '--filter'
|
|
63
70
|
});
|
|
64
71
|
|
|
65
72
|
generateMapTestTemplate(
|
|
@@ -69,7 +76,19 @@ describe('Translate command', () => {
|
|
|
69
76
|
subcommand: 'extract',
|
|
70
77
|
source: 'ru-RU',
|
|
71
78
|
target: 'es-ES',
|
|
72
|
-
additionalArgs: '--exclude ru/
|
|
79
|
+
additionalArgs: '--exclude ru/to-be-excluded.md --filter',
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const vars = {skip: 'prod'}
|
|
84
|
+
generateMapTestTemplate(
|
|
85
|
+
'filter files on extract with extra vars option',
|
|
86
|
+
'mocks/translation/dir-files',
|
|
87
|
+
{
|
|
88
|
+
subcommand: 'extract',
|
|
89
|
+
source: 'ru-RU',
|
|
90
|
+
target: 'es-ES',
|
|
91
|
+
additionalArgs: `--vars ${JSON.stringify(vars)} --filter`,
|
|
73
92
|
},
|
|
74
93
|
);
|
|
75
94
|
|
|
@@ -89,4 +108,30 @@ describe('Translate command', () => {
|
|
|
89
108
|
source: 'ru-RU',
|
|
90
109
|
target: 'en-US',
|
|
91
110
|
});
|
|
111
|
+
|
|
112
|
+
let conditionVars = {prod: true, inner: true, list: ['item']};
|
|
113
|
+
generateMapTestTemplate(
|
|
114
|
+
'save truthy liquid conditions structures',
|
|
115
|
+
'mocks/translation/conditions',
|
|
116
|
+
{
|
|
117
|
+
subcommand: 'extract',
|
|
118
|
+
source: 'ru-RU',
|
|
119
|
+
target: 'es-ES',
|
|
120
|
+
additionalArgs: `--vars ${JSON.stringify(conditionVars)}`,
|
|
121
|
+
},
|
|
122
|
+
false,
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
conditionVars = {prod: false, inner: false, list: ['item']};
|
|
126
|
+
generateMapTestTemplate(
|
|
127
|
+
'remove falsy liquid conditions structures',
|
|
128
|
+
'mocks/translation/conditions',
|
|
129
|
+
{
|
|
130
|
+
subcommand: 'extract',
|
|
131
|
+
source: 'ru-RU',
|
|
132
|
+
target: 'es-ES',
|
|
133
|
+
additionalArgs: `--vars ${JSON.stringify(conditionVars)}`,
|
|
134
|
+
},
|
|
135
|
+
false,
|
|
136
|
+
);
|
|
92
137
|
});
|
package/fixtures/cliAdapter.ts
CHANGED
|
@@ -34,11 +34,34 @@ class Build {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
class Extract {
|
|
38
|
+
private readonly runner: Runner;
|
|
39
|
+
|
|
40
|
+
constructor(runner: Runner) {
|
|
41
|
+
this.runner = runner;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
run(input: string, output: string, args: string[]) {
|
|
45
|
+
return this.runner.runYfmDocs([
|
|
46
|
+
'translate',
|
|
47
|
+
'extract',
|
|
48
|
+
'--input',
|
|
49
|
+
input,
|
|
50
|
+
'--output',
|
|
51
|
+
output,
|
|
52
|
+
'--quiet',
|
|
53
|
+
...args,
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
37
58
|
export class CliTestAdapter {
|
|
38
59
|
readonly runner: Runner = createRunner();
|
|
39
60
|
|
|
40
61
|
readonly build = new Build(this.runner);
|
|
41
62
|
|
|
63
|
+
readonly extract = new Extract(this.runner);
|
|
64
|
+
|
|
42
65
|
async testBuildPass(
|
|
43
66
|
inputPath: string,
|
|
44
67
|
outputPath: string,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {Runner} from './types';
|
|
2
2
|
import {execa} from 'execa';
|
|
3
|
+
import strip from 'strip-ansi';
|
|
3
4
|
|
|
4
5
|
export class BinaryRunner implements Runner {
|
|
5
6
|
private readonly binaryPath: string;
|
|
@@ -29,7 +30,7 @@ export class BinaryRunner implements Runner {
|
|
|
29
30
|
|
|
30
31
|
function fillLog(filter: RegExp, source: string) {
|
|
31
32
|
return source.split('\n')
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.filter(
|
|
33
|
+
.map((line) => strip(line).trim())
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.filter((line) => line.match(filter));
|
|
35
36
|
}
|
package/fixtures/utils/file.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {readFileSync} from 'node:fs';
|
|
2
|
+
import {rm} from 'node:fs/promises';
|
|
2
3
|
import {join, resolve} from 'node:path';
|
|
3
4
|
import {glob} from 'glob';
|
|
4
5
|
import {bundleless, hashless, platformless} from './test';
|
|
5
6
|
import {expect} from 'vitest';
|
|
6
|
-
import {$} from 'execa';
|
|
7
7
|
|
|
8
8
|
export function getFileContent(filePath: string) {
|
|
9
|
-
return bundleless(
|
|
9
|
+
return platformless(bundleless(readFileSync(filePath, 'utf8')));
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const uselessFile = (file: string) =>
|
|
@@ -21,9 +21,9 @@ export async function compareDirectories(outputPath: string, ignoreFileContent =
|
|
|
21
21
|
nodir: true,
|
|
22
22
|
posix: true,
|
|
23
23
|
})
|
|
24
|
-
).sort();
|
|
24
|
+
).map(bundleless).sort();
|
|
25
25
|
|
|
26
|
-
expect(hashless(
|
|
26
|
+
expect(hashless(JSON.stringify(filesFromOutput, null, 2))).toMatchSnapshot('filelist');
|
|
27
27
|
|
|
28
28
|
if (!ignoreFileContent) {
|
|
29
29
|
filesFromOutput.filter(uselessFile).forEach((filePath) => {
|
|
@@ -46,5 +46,5 @@ export function getTestPaths(testRootPath: string): TestPaths {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export function cleanupDirectory(path: string) {
|
|
49
|
-
return
|
|
49
|
+
return rm(path, {recursive: true, force: true});
|
|
50
50
|
}
|
package/fixtures/utils/test.ts
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import assets from '@diplodoc/cli/manifest';
|
|
2
2
|
|
|
3
3
|
export function platformless(text: string): string {
|
|
4
|
+
let index = 1;
|
|
5
|
+
|
|
4
6
|
return hashless(text)
|
|
5
7
|
.replace(/\r\n/g, '\n')
|
|
8
|
+
// Fix for XML equiv-text attributes in Windows - handle various patterns
|
|
9
|
+
.replace(/equiv-text="[\r\n]+ "/g, 'equiv-text=" "')
|
|
10
|
+
.replace(/equiv-text="[\r\n]+
"/g, 'equiv-text="
"')
|
|
11
|
+
// Also normalize any other attributes that might have line ending issues
|
|
12
|
+
.replace(/(ctype|id)="[\r\n]+(.*?)"/g, '$1="$2"')
|
|
6
13
|
.replace(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/g, 'UUID')
|
|
7
|
-
.replace(
|
|
8
|
-
|
|
14
|
+
.replace(
|
|
15
|
+
/(content"?[:=]{1}[" ]{1}Diplodoc.*? )v\d+\.\d+\.\d+(?:-[\w-]+)?/g,
|
|
16
|
+
`$1vDIPLODOC-VERSION`,
|
|
17
|
+
)
|
|
18
|
+
.replace(/(\\(?![/"'])){1,2}/g, '/')
|
|
19
|
+
.replace(
|
|
20
|
+
/id=\\"inline-code-id-[a-zA-Z0-9]{8}\\"/g,
|
|
21
|
+
() => `id="inline-code-id-${index++}"`
|
|
22
|
+
)
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
export function hashless(text: string): string {
|
|
@@ -15,8 +29,6 @@ export function hashless(text: string): string {
|
|
|
15
29
|
}
|
|
16
30
|
|
|
17
31
|
export function bundleless(text: string): string {
|
|
18
|
-
const assets = require('@diplodoc/client/manifest') as Record<string, Record<string, string[]>>;
|
|
19
|
-
|
|
20
32
|
for (const [entryKey, entry] of Object.entries(assets)) {
|
|
21
33
|
for (const [typeKey, type] of Object.entries(entry)) {
|
|
22
34
|
for (let index = 0; index < type.length; index++) {
|
|
@@ -32,6 +44,3 @@ export function bundleless(text: string): string {
|
|
|
32
44
|
return text;
|
|
33
45
|
}
|
|
34
46
|
|
|
35
|
-
export function getNormalizedContent(filePath: string): string {
|
|
36
|
-
return bundleless(platformless(readFileSync(filePath, 'utf8')));
|
|
37
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
File exists but not attached to toc
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
href: index.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
allowHtml: true
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Title
|
|
2
|
+
|
|
3
|
+
Text not_var{{not-var}} not_var{{skip()}} {{default-var}}
|
|
4
|
+
|
|
5
|
+
Text `not_var{{not-var}}` `not_var{{skip()}}` `{{default-var}}`
|
|
6
|
+
|
|
7
|
+
Text
|
|
8
|
+
```
|
|
9
|
+
not_var{{not-var}}
|
|
10
|
+
|
|
11
|
+
not_var{{skip()}}
|
|
12
|
+
|
|
13
|
+
{{default-var}}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
`[not a link](./path/to/relative/file.md)`
|
|
18
|
+
|
|
19
|
+
## Subtitle {#subtitle}
|
|
20
|
+
|
|
21
|
+
[{#T}](mermaid.md)
|
|
22
|
+
|
|
23
|
+
[{#T}](mermaid.md#info)
|
|
24
|
+
|
|
25
|
+
[](latex.md)
|
|
26
|
+
|
|
27
|
+
[noext-link](includes)
|
|
28
|
+
|
|
29
|
+
{% include [user](includes/user.md) %}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Autotitles 
|
|
2
|
+
|
|
3
|
+
Empty title
|
|
4
|
+
[](./1.md)
|
|
5
|
+
|
|
6
|
+
Empty subtitle
|
|
7
|
+
[](./1.md#subtitle)
|
|
8
|
+
|
|
9
|
+
Special title
|
|
10
|
+
[{#T}](./1.md)
|
|
11
|
+
|
|
12
|
+
Special subtitle
|
|
13
|
+
[{#T}](./1.md#subtitle)
|
|
14
|
+
|
|
15
|
+
Empty local title
|
|
16
|
+
[](#header)
|
|
17
|
+
|
|
18
|
+
Special local title
|
|
19
|
+
[{#T}](#header)
|
|
20
|
+
|
|
21
|
+
## Header {#header}
|
|
22
|
+
|
|
23
|
+
Content
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include [user](sub/user.md) %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{user}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{user}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Text
|
|
2
|
+
|
|
3
|
+
{% include [user](includes/user.md) %}
|
|
4
|
+
|
|
5
|
+
{% include [test](includes/test.md) %}
|
|
6
|
+
|
|
7
|
+
Link after include
|
|
8
|
+
[{#T}](./1.md)
|
|
9
|
+
|
|
10
|
+
<!--{% include [For includes/deep.md](includes/deep.md) %}-->
|
|
11
|
+
{% include [For includes/deep.md](includes/deep.md) %}
|
|
12
|
+
|
|
13
|
+
Include with big indent
|
|
14
|
+
|
|
15
|
+
{% include [For includes/deep.md](includes/deepWithIndent.md) %}
|
|
16
|
+
|
|
17
|
+
Link after include
|
|
18
|
+
[{#T}](./1.md#subtitle)
|