@diplodoc/cli-tests 5.8.2 → 5.8.3

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.
Files changed (48) hide show
  1. package/e2e/__snapshots__/preprocess.test.ts.snap +53 -24
  2. package/e2e/preprocess.test.ts +16 -4
  3. package/mocks/preprocess/input/.yfm +1 -0
  4. package/mocks/preprocess/{test1/input → input}/1.md +4 -4
  5. package/mocks/preprocess/{test2/input → input}/autotitle.md +1 -1
  6. package/mocks/preprocess/input/includes/deep.md +1 -0
  7. package/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
  8. package/mocks/preprocess/{test2/input → input}/sub/folder/item-1.md +2 -0
  9. package/package.json +1 -1
  10. package/mocks/preprocess/test1/input/.yfm +0 -2
  11. package/mocks/preprocess/test1/input/autotitle.md +0 -23
  12. package/mocks/preprocess/test1/input/includes/deep.md +0 -1
  13. package/mocks/preprocess/test1/input/includes.md +0 -14
  14. package/mocks/preprocess/test1/input/sub/folder/item-1.md +0 -5
  15. package/mocks/preprocess/test2/input/.yfm +0 -2
  16. package/mocks/preprocess/test2/input/1.md +0 -29
  17. package/mocks/preprocess/test2/input/commented-include.md +0 -3
  18. package/mocks/preprocess/test2/input/images.md +0 -5
  19. package/mocks/preprocess/test2/input/included-item.md +0 -12
  20. package/mocks/preprocess/test2/input/includes/deep.md +0 -1
  21. package/mocks/preprocess/test2/input/includes/deepWithIndent.md +0 -6
  22. package/mocks/preprocess/test2/input/includes/presets.yaml +0 -2
  23. package/mocks/preprocess/test2/input/includes/sub/user.md +0 -1
  24. package/mocks/preprocess/test2/input/includes/test.md +0 -1
  25. package/mocks/preprocess/test2/input/includes/user.md +0 -1
  26. package/mocks/preprocess/test2/input/latex.md +0 -3
  27. package/mocks/preprocess/test2/input/mermaid.md +0 -13
  28. package/mocks/preprocess/test2/input/presets.yaml +0 -8
  29. package/mocks/preprocess/test2/input/sub/toc.yaml +0 -5
  30. package/mocks/preprocess/test2/input/toc-i.yaml +0 -3
  31. package/mocks/preprocess/test2/input/toc.yaml +0 -16
  32. /package/mocks/preprocess/{test1/input → input}/_assets/1.png +0 -0
  33. /package/mocks/preprocess/{test2/input/_assets/1.png → input/_assets/1.svg} +0 -0
  34. /package/mocks/preprocess/{test1/input → input}/commented-include.md +0 -0
  35. /package/mocks/preprocess/{test1/input → input}/images.md +0 -0
  36. /package/mocks/preprocess/{test1/input → input}/included-item.md +0 -0
  37. /package/mocks/preprocess/{test1/input → input}/includes/presets.yaml +0 -0
  38. /package/mocks/preprocess/{test1/input → input}/includes/sub/user.md +0 -0
  39. /package/mocks/preprocess/{test2/input → input}/includes/sub/userWithIndent.md +0 -0
  40. /package/mocks/preprocess/{test1/input → input}/includes/test.md +0 -0
  41. /package/mocks/preprocess/{test1/input → input}/includes/user.md +0 -0
  42. /package/mocks/preprocess/{test2/input → input}/includes.md +0 -0
  43. /package/mocks/preprocess/{test1/input → input}/latex.md +0 -0
  44. /package/mocks/preprocess/{test1/input → input}/mermaid.md +0 -0
  45. /package/mocks/preprocess/{test1/input → input}/presets.yaml +0 -0
  46. /package/mocks/preprocess/{test1/input → input}/sub/toc.yaml +0 -0
  47. /package/mocks/preprocess/{test1/input → input}/toc-i.yaml +0 -0
  48. /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
- "preprocess:
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}](./mermaid.md)
57
+ [{#T}](mermaid.md)
56
58
 
57
- [{#T}](./mermaid.md#info)
59
+ [{#T}](mermaid.md#info)
58
60
 
59
- [](./latex.md)
61
+ [](latex.md)
60
62
 
61
- [noext-link](./includes)
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 ![](_assets/1.svg)
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](./sub/user-hash.md) %}
164
+ "{% include [user](sub/user-hash.md) %}
159
165
  "
160
166
  `;
161
167
 
162
168
  exports[`Preprocess > HashIncludes=true,Autotitles=false 8`] = `
163
- "Bob
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
- "Test
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 11`] = `
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 12`] = `
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 13`] = `
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 14`] = `
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
- "preprocess:
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](./mermaid.md)
331
+ [Mermaid usage](mermaid.md)
306
332
 
307
- [Mermaid info](./mermaid.md#info)
333
+ [Mermaid info](mermaid.md#info)
308
334
 
309
- [Latex usage](./latex.md)
335
+ [Latex usage](latex.md)
310
336
 
311
- [noext-link](./includes)
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 ![](_assets/1.svg)
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](./sub/user-hash.md) %}
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](./sub/userWithIndent-hash.md) %}
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 ![../../_assets/1.svg](../../autotitle.md)
493
522
  "
494
523
  `;
495
524
 
@@ -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, {md2md:true});
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/test1');
26
+ generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess', [
27
+ '--no-merge-autotitles'
28
+ ]);
17
29
 
18
- generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess/test2');
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}](./mermaid.md)
21
+ [{#T}](mermaid.md)
22
22
 
23
- [{#T}](./mermaid.md#info)
23
+ [{#T}](mermaid.md#info)
24
24
 
25
- [](./latex.md)
25
+ [](latex.md)
26
26
 
27
- [noext-link](./includes)
27
+ [noext-link](includes)
28
28
 
29
29
  {% include [user](includes/user.md) %}
@@ -1,4 +1,4 @@
1
- # Autotitles
1
+ # Autotitles ![](_assets/1.svg)
2
2
 
3
3
  Empty title
4
4
  [](./1.md)
@@ -0,0 +1 @@
1
+ {% include [user](sub/user.md) %}
@@ -0,0 +1,6 @@
1
+ - list item
2
+
3
+ {% include [user](sub/userWithIndent.md) %}
4
+
5
+ Link to mermaid diagram from 1 level
6
+ [](../mermaid.md)
@@ -3,3 +3,5 @@
3
3
  Item 1 text
4
4
 
5
5
  [{#T}](../../images.md)
6
+
7
+ [{#T}](../../autotitle.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.8.2",
3
+ "version": "5.8.3",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
@@ -1,2 +0,0 @@
1
- preprocess:
2
- mergeAutotitles: false
@@ -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,5 +0,0 @@
1
- # Item 1
2
-
3
- Item 1 text
4
-
5
- [{#T}](../../images.md)
@@ -1,2 +0,0 @@
1
- preprocess:
2
- mergeAutotitles: true
@@ -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,3 +0,0 @@
1
- ![](./missed-asset.png)
2
-
3
- [](./missed-link.md)
@@ -1,5 +0,0 @@
1
- # Images
2
-
3
- ![simple image](_assets/1.png)
4
-
5
-
@@ -1,12 +0,0 @@
1
- # Included item
2
-
3
- Included item text
4
-
5
- <!-- : {% include [rec-off](./commented-include.md) %} -->
6
-
7
- {% note alert "Alert!" %}
8
-
9
- <!-- content -->
10
-
11
- {% endnote %}
12
-
@@ -1 +0,0 @@
1
- {% include [user](./sub/user.md) %}
@@ -1,6 +0,0 @@
1
- - list item
2
-
3
- {% include [user](./sub/userWithIndent.md) %}
4
-
5
- Link to mermaid diagram from 1 level
6
- [](../mermaid.md)
@@ -1,2 +0,0 @@
1
- default:
2
- user: Alice
@@ -1 +0,0 @@
1
- {{user}}
@@ -1 +0,0 @@
1
- {{user}}
@@ -1,3 +0,0 @@
1
- # Latex usage
2
-
3
- $\sqrt{3x-1}+(1+x)^2$
@@ -1,13 +0,0 @@
1
- # Mermaid usage
2
-
3
- ```mermaid
4
-
5
- sequenceDiagram
6
- rect rgba(251, 243, 232, 0.2)
7
- Alice ->> Bob:
8
- end
9
- ```
10
-
11
- ## Mermaid info {#info}
12
-
13
- Some mermaid info
@@ -1,8 +0,0 @@
1
- default:
2
- default-var: default-var-value
3
- not-var: not-var-value
4
- product: root
5
- user: Bob
6
-
7
- internal:
8
- default-var: default-var-internal-value
@@ -1,5 +0,0 @@
1
- items:
2
- name: Named include (items is Object here - this is not an error)
3
- items:
4
- - name: Item 1
5
- href: folder/item-1.md
@@ -1,3 +0,0 @@
1
- items:
2
- - name: Included Item
3
- href: ./included-item.md
@@ -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