@diplodoc/cli-tests 5.8.2 → 5.8.4
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__/preprocess.test.ts.snap +53 -24
- package/e2e/preprocess.test.ts +16 -4
- package/mocks/preprocess/input/.yfm +1 -0
- package/mocks/preprocess/{test1/input → input}/1.md +4 -4
- package/mocks/preprocess/{test2/input → input}/autotitle.md +1 -1
- package/mocks/preprocess/input/includes/deep.md +1 -0
- package/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
- package/mocks/preprocess/{test2/input → input}/sub/folder/item-1.md +2 -0
- package/package.json +1 -1
- package/mocks/preprocess/test1/input/.yfm +0 -2
- package/mocks/preprocess/test1/input/autotitle.md +0 -23
- package/mocks/preprocess/test1/input/includes/deep.md +0 -1
- package/mocks/preprocess/test1/input/includes.md +0 -14
- package/mocks/preprocess/test1/input/sub/folder/item-1.md +0 -5
- package/mocks/preprocess/test2/input/.yfm +0 -2
- package/mocks/preprocess/test2/input/1.md +0 -29
- package/mocks/preprocess/test2/input/commented-include.md +0 -3
- package/mocks/preprocess/test2/input/images.md +0 -5
- package/mocks/preprocess/test2/input/included-item.md +0 -12
- package/mocks/preprocess/test2/input/includes/deep.md +0 -1
- package/mocks/preprocess/test2/input/includes/deepWithIndent.md +0 -6
- package/mocks/preprocess/test2/input/includes/presets.yaml +0 -2
- package/mocks/preprocess/test2/input/includes/sub/user.md +0 -1
- package/mocks/preprocess/test2/input/includes/test.md +0 -1
- package/mocks/preprocess/test2/input/includes/user.md +0 -1
- package/mocks/preprocess/test2/input/latex.md +0 -3
- package/mocks/preprocess/test2/input/mermaid.md +0 -13
- package/mocks/preprocess/test2/input/presets.yaml +0 -8
- package/mocks/preprocess/test2/input/sub/toc.yaml +0 -5
- package/mocks/preprocess/test2/input/toc-i.yaml +0 -3
- package/mocks/preprocess/test2/input/toc.yaml +0 -16
- /package/mocks/preprocess/{test1/input → input}/_assets/1.png +0 -0
- /package/mocks/preprocess/{test2/input/_assets/1.png → input/_assets/1.svg} +0 -0
- /package/mocks/preprocess/{test1/input → input}/commented-include.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/images.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/included-item.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/includes/presets.yaml +0 -0
- /package/mocks/preprocess/{test1/input → input}/includes/sub/user.md +0 -0
- /package/mocks/preprocess/{test2/input → input}/includes/sub/userWithIndent.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/includes/test.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/includes/user.md +0 -0
- /package/mocks/preprocess/{test2/input → input}/includes.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/latex.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/mermaid.md +0 -0
- /package/mocks/preprocess/{test1/input → input}/presets.yaml +0 -0
- /package/mocks/preprocess/{test1/input → input}/sub/toc.yaml +0 -0
- /package/mocks/preprocess/{test1/input → input}/toc-i.yaml +0 -0
- /package/mocks/preprocess/{test1/input → input}/toc.yaml +0 -0
|
@@ -5,12 +5,15 @@ exports[`Preprocess > HashIncludes=true,Autotitles=false > filelist 1`] = `
|
|
|
5
5
|
".yfm",
|
|
6
6
|
"1.md",
|
|
7
7
|
"_assets/1.png",
|
|
8
|
+
"_assets/1.svg",
|
|
8
9
|
"autotitle.md",
|
|
9
10
|
"images.md",
|
|
10
11
|
"included-item.md",
|
|
11
12
|
"includes.md",
|
|
12
13
|
"includes/deep-hash.md",
|
|
14
|
+
"includes/deepWithIndent-hash.md",
|
|
13
15
|
"includes/sub/user-hash.md",
|
|
16
|
+
"includes/sub/userWithIndent-hash.md",
|
|
14
17
|
"includes/test-hash.md",
|
|
15
18
|
"includes/user-hash.md",
|
|
16
19
|
"latex.md",
|
|
@@ -21,8 +24,7 @@ exports[`Preprocess > HashIncludes=true,Autotitles=false > filelist 1`] = `
|
|
|
21
24
|
`;
|
|
22
25
|
|
|
23
26
|
exports[`Preprocess > HashIncludes=true,Autotitles=false 1`] = `
|
|
24
|
-
"
|
|
25
|
-
mergeAutotitles: false
|
|
27
|
+
"allowHtml: true
|
|
26
28
|
"
|
|
27
29
|
`;
|
|
28
30
|
|
|
@@ -52,13 +54,13 @@ default-var-value
|
|
|
52
54
|
|
|
53
55
|
## Subtitle {#subtitle}
|
|
54
56
|
|
|
55
|
-
[{#T}](
|
|
57
|
+
[{#T}](mermaid.md)
|
|
56
58
|
|
|
57
|
-
[{#T}](
|
|
59
|
+
[{#T}](mermaid.md#info)
|
|
58
60
|
|
|
59
|
-
[](
|
|
61
|
+
[](latex.md)
|
|
60
62
|
|
|
61
|
-
[noext-link](
|
|
63
|
+
[noext-link](includes)
|
|
62
64
|
|
|
63
65
|
{% include [user](includes/user-hash.md) %}
|
|
64
66
|
"
|
|
@@ -70,7 +72,7 @@ metadata:
|
|
|
70
72
|
- name: generator
|
|
71
73
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
72
74
|
---
|
|
73
|
-
# Autotitles
|
|
75
|
+
# Autotitles 
|
|
74
76
|
|
|
75
77
|
Empty title
|
|
76
78
|
[](./1.md)
|
|
@@ -149,32 +151,54 @@ Link after include
|
|
|
149
151
|
<!--{% include [For includes/deep.md](includes/deep.md) %}-->
|
|
150
152
|
{% include [For includes/deep-hash.md](includes/deep-hash.md) %}
|
|
151
153
|
|
|
154
|
+
Include with big indent
|
|
155
|
+
|
|
156
|
+
{% include [For includes/deep.md](includes/deepWithIndent-hash.md) %}
|
|
157
|
+
|
|
152
158
|
Link after include
|
|
153
159
|
[{#T}](./1.md#subtitle)
|
|
154
160
|
"
|
|
155
161
|
`;
|
|
156
162
|
|
|
157
163
|
exports[`Preprocess > HashIncludes=true,Autotitles=false 7`] = `
|
|
158
|
-
"{% include [user](
|
|
164
|
+
"{% include [user](sub/user-hash.md) %}
|
|
159
165
|
"
|
|
160
166
|
`;
|
|
161
167
|
|
|
162
168
|
exports[`Preprocess > HashIncludes=true,Autotitles=false 8`] = `
|
|
163
|
-
"
|
|
169
|
+
"- list item
|
|
170
|
+
|
|
171
|
+
{% include [user](sub/userWithIndent-hash.md) %}
|
|
172
|
+
|
|
173
|
+
Link to mermaid diagram from 1 level
|
|
174
|
+
[](../mermaid.md)
|
|
164
175
|
"
|
|
165
176
|
`;
|
|
166
177
|
|
|
167
178
|
exports[`Preprocess > HashIncludes=true,Autotitles=false 9`] = `
|
|
168
|
-
"
|
|
179
|
+
"Bob
|
|
169
180
|
"
|
|
170
181
|
`;
|
|
171
182
|
|
|
172
183
|
exports[`Preprocess > HashIncludes=true,Autotitles=false 10`] = `
|
|
184
|
+
"Link to mermaid diagram from 2 level
|
|
185
|
+
[](../../mermaid.md)
|
|
186
|
+
|
|
187
|
+
- User
|
|
188
|
+
Bob"
|
|
189
|
+
`;
|
|
190
|
+
|
|
191
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 11`] = `
|
|
192
|
+
"Test
|
|
193
|
+
"
|
|
194
|
+
`;
|
|
195
|
+
|
|
196
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 12`] = `
|
|
173
197
|
"Bob
|
|
174
198
|
"
|
|
175
199
|
`;
|
|
176
200
|
|
|
177
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=false
|
|
201
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 13`] = `
|
|
178
202
|
"---
|
|
179
203
|
metadata:
|
|
180
204
|
- name: generator
|
|
@@ -186,7 +210,7 @@ $/sqrt{3x-1}+(1+x)^2$
|
|
|
186
210
|
"
|
|
187
211
|
`;
|
|
188
212
|
|
|
189
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=false
|
|
213
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 14`] = `
|
|
190
214
|
"---
|
|
191
215
|
metadata:
|
|
192
216
|
- name: generator
|
|
@@ -208,7 +232,7 @@ Some mermaid info
|
|
|
208
232
|
"
|
|
209
233
|
`;
|
|
210
234
|
|
|
211
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=false
|
|
235
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 15`] = `
|
|
212
236
|
"---
|
|
213
237
|
metadata:
|
|
214
238
|
- name: generator
|
|
@@ -219,10 +243,12 @@ metadata:
|
|
|
219
243
|
Item 1 text
|
|
220
244
|
|
|
221
245
|
[{#T}](../../images.md)
|
|
246
|
+
|
|
247
|
+
[{#T}](../../autotitle.md)
|
|
222
248
|
"
|
|
223
249
|
`;
|
|
224
250
|
|
|
225
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=false
|
|
251
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=false 16`] = `
|
|
226
252
|
"items:
|
|
227
253
|
- name: Md item with not_var syntax
|
|
228
254
|
href: 1.md
|
|
@@ -253,6 +279,7 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true > filelist 1`] = `
|
|
|
253
279
|
".yfm",
|
|
254
280
|
"1.md",
|
|
255
281
|
"_assets/1.png",
|
|
282
|
+
"_assets/1.svg",
|
|
256
283
|
"autotitle.md",
|
|
257
284
|
"images.md",
|
|
258
285
|
"included-item.md",
|
|
@@ -271,8 +298,7 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true > filelist 1`] = `
|
|
|
271
298
|
`;
|
|
272
299
|
|
|
273
300
|
exports[`Preprocess > HashIncludes=true,Autotitles=true 1`] = `
|
|
274
|
-
"
|
|
275
|
-
mergeAutotitles: true
|
|
301
|
+
"allowHtml: true
|
|
276
302
|
"
|
|
277
303
|
`;
|
|
278
304
|
|
|
@@ -302,13 +328,13 @@ default-var-value
|
|
|
302
328
|
|
|
303
329
|
## Subtitle {#subtitle}
|
|
304
330
|
|
|
305
|
-
[Mermaid usage](
|
|
331
|
+
[Mermaid usage](mermaid.md)
|
|
306
332
|
|
|
307
|
-
[Mermaid info](
|
|
333
|
+
[Mermaid info](mermaid.md#info)
|
|
308
334
|
|
|
309
|
-
[Latex usage](
|
|
335
|
+
[Latex usage](latex.md)
|
|
310
336
|
|
|
311
|
-
[noext-link](
|
|
337
|
+
[noext-link](includes)
|
|
312
338
|
|
|
313
339
|
{% include [user](includes/user-hash.md) %}
|
|
314
340
|
"
|
|
@@ -320,7 +346,7 @@ metadata:
|
|
|
320
346
|
- name: generator
|
|
321
347
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
322
348
|
---
|
|
323
|
-
# Autotitles
|
|
349
|
+
# Autotitles 
|
|
324
350
|
|
|
325
351
|
Empty title
|
|
326
352
|
[Title](./1.md)
|
|
@@ -409,17 +435,18 @@ Link after include
|
|
|
409
435
|
`;
|
|
410
436
|
|
|
411
437
|
exports[`Preprocess > HashIncludes=true,Autotitles=true 7`] = `
|
|
412
|
-
"{% include [user](
|
|
438
|
+
"{% include [user](sub/user-hash.md) %}
|
|
413
439
|
"
|
|
414
440
|
`;
|
|
415
441
|
|
|
416
442
|
exports[`Preprocess > HashIncludes=true,Autotitles=true 8`] = `
|
|
417
443
|
"- list item
|
|
418
444
|
|
|
419
|
-
{% include [user](
|
|
445
|
+
{% include [user](sub/userWithIndent-hash.md) %}
|
|
420
446
|
|
|
421
447
|
Link to mermaid diagram from 1 level
|
|
422
|
-
[Mermaid usage](../mermaid.md)
|
|
448
|
+
[Mermaid usage](../mermaid.md)
|
|
449
|
+
"
|
|
423
450
|
`;
|
|
424
451
|
|
|
425
452
|
exports[`Preprocess > HashIncludes=true,Autotitles=true 9`] = `
|
|
@@ -490,6 +517,8 @@ metadata:
|
|
|
490
517
|
Item 1 text
|
|
491
518
|
|
|
492
519
|
[Images](../../images.md)
|
|
520
|
+
|
|
521
|
+
[Autotitles 
|
|
493
522
|
"
|
|
494
523
|
`;
|
|
495
524
|
|
package/e2e/preprocess.test.ts
CHANGED
|
@@ -3,19 +3,31 @@ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
|
3
3
|
|
|
4
4
|
const generateFilesYamlTestTemplate = (
|
|
5
5
|
testTitle: string,
|
|
6
|
-
testRootPath: string
|
|
6
|
+
testRootPath: string,
|
|
7
|
+
args: string[] = [],
|
|
7
8
|
) => {
|
|
8
9
|
test(testTitle, async () => {
|
|
9
10
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
10
|
-
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
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
|
+
});
|
|
11
21
|
await compareDirectories(outputPath);
|
|
12
22
|
});
|
|
13
23
|
};
|
|
14
24
|
|
|
15
25
|
describe('Preprocess', () => {
|
|
16
|
-
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess
|
|
26
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess', [
|
|
27
|
+
'--no-merge-autotitles'
|
|
28
|
+
]);
|
|
17
29
|
|
|
18
|
-
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess
|
|
30
|
+
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess');
|
|
19
31
|
|
|
20
32
|
// generateFilesYamlTestTemplate('Nested toc restricted access', 'mocks/preprocess/test3');
|
|
21
33
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
allowHtml: true
|
|
@@ -18,12 +18,12 @@ not_var{{skip()}}
|
|
|
18
18
|
|
|
19
19
|
## Subtitle {#subtitle}
|
|
20
20
|
|
|
21
|
-
[{#T}](
|
|
21
|
+
[{#T}](mermaid.md)
|
|
22
22
|
|
|
23
|
-
[{#T}](
|
|
23
|
+
[{#T}](mermaid.md#info)
|
|
24
24
|
|
|
25
|
-
[](
|
|
25
|
+
[](latex.md)
|
|
26
26
|
|
|
27
|
-
[noext-link](
|
|
27
|
+
[noext-link](includes)
|
|
28
28
|
|
|
29
29
|
{% include [user](includes/user.md) %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include [user](sub/user.md) %}
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{% include [user](./sub/user.md) %}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
Link after include
|
|
14
|
-
[{#T}](./1.md#subtitle)
|
|
@@ -1,29 +0,0 @@
|
|
|
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) %}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{% include [user](./sub/user.md) %}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{{user}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Test
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{{user}}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
items:
|
|
2
|
-
- name: Md item with not_var syntax
|
|
3
|
-
href: ./1.md
|
|
4
|
-
- name: Md item named without extension
|
|
5
|
-
href: ./1
|
|
6
|
-
- include: {path: toc-i.yaml}
|
|
7
|
-
- include: {path: sub/toc.yaml, mode: link}
|
|
8
|
-
- href: ./mermaid
|
|
9
|
-
- name: '{#T}'
|
|
10
|
-
href: ./latex
|
|
11
|
-
- name: Images
|
|
12
|
-
href: ./images
|
|
13
|
-
- name: Autotitle
|
|
14
|
-
href: ./autotitle
|
|
15
|
-
- name: includes
|
|
16
|
-
href: ./includes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|