@diplodoc/cli-tests 5.8.1 → 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 (52) hide show
  1. package/e2e/__snapshots__/preprocess.test.ts.snap +53 -24
  2. package/e2e/__snapshots__/regression.test.ts.snap +44 -36
  3. package/e2e/preprocess.test.ts +16 -4
  4. package/mocks/preprocess/input/.yfm +1 -0
  5. package/mocks/preprocess/{test1/input → input}/1.md +4 -4
  6. package/mocks/preprocess/{test2/input → input}/autotitle.md +1 -1
  7. package/mocks/preprocess/input/includes/deep.md +1 -0
  8. package/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
  9. package/mocks/preprocess/{test2/input → input}/sub/folder/item-1.md +2 -0
  10. package/mocks/regression/input/includes/tools.md +1 -0
  11. package/mocks/regression/input/merge/merge.md +2 -0
  12. package/mocks/regression/input/merge/presets.yaml +1 -0
  13. package/package.json +1 -1
  14. package/mocks/preprocess/test1/input/.yfm +0 -2
  15. package/mocks/preprocess/test1/input/autotitle.md +0 -23
  16. package/mocks/preprocess/test1/input/includes/deep.md +0 -1
  17. package/mocks/preprocess/test1/input/includes.md +0 -14
  18. package/mocks/preprocess/test1/input/sub/folder/item-1.md +0 -5
  19. package/mocks/preprocess/test2/input/.yfm +0 -2
  20. package/mocks/preprocess/test2/input/1.md +0 -29
  21. package/mocks/preprocess/test2/input/commented-include.md +0 -3
  22. package/mocks/preprocess/test2/input/images.md +0 -5
  23. package/mocks/preprocess/test2/input/included-item.md +0 -12
  24. package/mocks/preprocess/test2/input/includes/deep.md +0 -1
  25. package/mocks/preprocess/test2/input/includes/deepWithIndent.md +0 -6
  26. package/mocks/preprocess/test2/input/includes/presets.yaml +0 -2
  27. package/mocks/preprocess/test2/input/includes/sub/user.md +0 -1
  28. package/mocks/preprocess/test2/input/includes/test.md +0 -1
  29. package/mocks/preprocess/test2/input/includes/user.md +0 -1
  30. package/mocks/preprocess/test2/input/latex.md +0 -3
  31. package/mocks/preprocess/test2/input/mermaid.md +0 -13
  32. package/mocks/preprocess/test2/input/presets.yaml +0 -8
  33. package/mocks/preprocess/test2/input/sub/toc.yaml +0 -5
  34. package/mocks/preprocess/test2/input/toc-i.yaml +0 -3
  35. package/mocks/preprocess/test2/input/toc.yaml +0 -16
  36. /package/mocks/preprocess/{test1/input → input}/_assets/1.png +0 -0
  37. /package/mocks/preprocess/{test2/input/_assets/1.png → input/_assets/1.svg} +0 -0
  38. /package/mocks/preprocess/{test1/input → input}/commented-include.md +0 -0
  39. /package/mocks/preprocess/{test1/input → input}/images.md +0 -0
  40. /package/mocks/preprocess/{test1/input → input}/included-item.md +0 -0
  41. /package/mocks/preprocess/{test1/input → input}/includes/presets.yaml +0 -0
  42. /package/mocks/preprocess/{test1/input → input}/includes/sub/user.md +0 -0
  43. /package/mocks/preprocess/{test2/input → input}/includes/sub/userWithIndent.md +0 -0
  44. /package/mocks/preprocess/{test1/input → input}/includes/test.md +0 -0
  45. /package/mocks/preprocess/{test1/input → input}/includes/user.md +0 -0
  46. /package/mocks/preprocess/{test2/input → input}/includes.md +0 -0
  47. /package/mocks/preprocess/{test1/input → input}/latex.md +0 -0
  48. /package/mocks/preprocess/{test1/input → input}/mermaid.md +0 -0
  49. /package/mocks/preprocess/{test1/input → input}/presets.yaml +0 -0
  50. /package/mocks/preprocess/{test1/input → input}/sub/toc.yaml +0 -0
  51. /package/mocks/preprocess/{test1/input → input}/toc-i.yaml +0 -0
  52. /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
 
@@ -20,6 +20,7 @@ exports[`Regression > internal > filelist 1`] = `
20
20
  "includes.md",
21
21
  "includes/deep-hash.md",
22
22
  "includes/test-hash.md",
23
+ "includes/tools-hash.md",
23
24
  "includes/user-hash.md",
24
25
  "index.yaml",
25
26
  "latex.md",
@@ -297,11 +298,16 @@ exports[`Regression > internal 13`] = `
297
298
  `;
298
299
 
299
300
  exports[`Regression > internal 14`] = `
300
- "Bob
301
+ "Tool: Hammer and Laser
301
302
  "
302
303
  `;
303
304
 
304
305
  exports[`Regression > internal 15`] = `
306
+ "Bob
307
+ "
308
+ `;
309
+
310
+ exports[`Regression > internal 16`] = `
305
311
  "description:
306
312
  - Some text
307
313
  links:
@@ -316,7 +322,7 @@ meta:
316
322
  "
317
323
  `;
318
324
 
319
- exports[`Regression > internal 16`] = `
325
+ exports[`Regression > internal 17`] = `
320
326
  "---
321
327
  metadata:
322
328
  - name: generator
@@ -328,7 +334,7 @@ $/sqrt{3x-1}+(1+x)^2$
328
334
  "
329
335
  `;
330
336
 
331
- exports[`Regression > internal 17`] = `
337
+ exports[`Regression > internal 18`] = `
332
338
  "---
333
339
  metadata:
334
340
  - name: generator
@@ -337,10 +343,12 @@ metadata:
337
343
  # Should use merged item
338
344
 
339
345
  [merged](./merged.md)
346
+
347
+ {% include [tools](../includes/tools-hash.md) %}
340
348
  "
341
349
  `;
342
350
 
343
- exports[`Regression > internal 18`] = `
351
+ exports[`Regression > internal 19`] = `
344
352
  "---
345
353
  metadata:
346
354
  - name: generator
@@ -353,7 +361,7 @@ Should be linked in toc.yaml
353
361
  "
354
362
  `;
355
363
 
356
- exports[`Regression > internal 19`] = `
364
+ exports[`Regression > internal 20`] = `
357
365
  "items:
358
366
  - name: Use merged
359
367
  href: merge.md
@@ -365,7 +373,7 @@ path: merge/toc.yaml
365
373
  "
366
374
  `;
367
375
 
368
- exports[`Regression > internal 20`] = `
376
+ exports[`Regression > internal 21`] = `
369
377
  "---
370
378
  metadata:
371
379
  - name: generator
@@ -387,7 +395,7 @@ Some mermaid info
387
395
  "
388
396
  `;
389
397
 
390
- exports[`Regression > internal 21`] = `
398
+ exports[`Regression > internal 22`] = `
391
399
  "---
392
400
  metadata:
393
401
  - name: generator
@@ -486,7 +494,7 @@ metadata:
486
494
  <!-- markdownlint-disable-file -->"
487
495
  `;
488
496
 
489
- exports[`Regression > internal 22`] = `
497
+ exports[`Regression > internal 23`] = `
490
498
  "---
491
499
  metadata:
492
500
  - name: generator
@@ -570,7 +578,7 @@ Generated server url
570
578
  [*Deprecated]: No longer supported, please use an alternative and newer version."
571
579
  `;
572
580
 
573
- exports[`Regression > internal 23`] = `
581
+ exports[`Regression > internal 24`] = `
574
582
  "---
575
583
  metadata:
576
584
  - name: generator
@@ -585,7 +593,7 @@ metadata:
585
593
  <!-- markdownlint-disable-file -->"
586
594
  `;
587
595
 
588
- exports[`Regression > internal 24`] = `
596
+ exports[`Regression > internal 25`] = `
589
597
  "files:
590
598
  - from: c.md
591
599
  to: d.md
@@ -595,7 +603,7 @@ common:
595
603
  "
596
604
  `;
597
605
 
598
- exports[`Regression > internal 25`] = `
606
+ exports[`Regression > internal 26`] = `
599
607
  "---
600
608
  metadata:
601
609
  - name: generator
@@ -609,7 +617,7 @@ Item 1 text
609
617
  "
610
618
  `;
611
619
 
612
- exports[`Regression > internal 26`] = `
620
+ exports[`Regression > internal 27`] = `
613
621
  "items:
614
622
  - name: Verbose root (index.yaml) will be transformed to index.html
615
623
  href: index.yaml
@@ -666,13 +674,13 @@ path: toc.yaml
666
674
  "
667
675
  `;
668
676
 
669
- exports[`Regression > internal 27`] = `
677
+ exports[`Regression > internal 28`] = `
670
678
  "preprocess:
671
679
  mergeAutotitles: true
672
680
  "
673
681
  `;
674
682
 
675
- exports[`Regression > internal 28`] = `
683
+ exports[`Regression > internal 29`] = `
676
684
  "<!DOCTYPE html>
677
685
  <html lang="ru" dir="ltr">
678
686
  <head>
@@ -709,7 +717,7 @@ exports[`Regression > internal 28`] = `
709
717
  </html>"
710
718
  `;
711
719
 
712
- exports[`Regression > internal 29`] = `
720
+ exports[`Regression > internal 30`] = `
713
721
  "<!DOCTYPE html>
714
722
  <html lang="ru" dir="ltr">
715
723
  <head>
@@ -746,7 +754,7 @@ exports[`Regression > internal 29`] = `
746
754
  </html>"
747
755
  `;
748
756
 
749
- exports[`Regression > internal 30`] = `
757
+ exports[`Regression > internal 31`] = `
750
758
  "<!DOCTYPE html>
751
759
  <html lang="ru" dir="ltr">
752
760
  <head>
@@ -772,7 +780,7 @@ exports[`Regression > internal 30`] = `
772
780
  </html>"
773
781
  `;
774
782
 
775
- exports[`Regression > internal 31`] = `
783
+ exports[`Regression > internal 32`] = `
776
784
  "<!DOCTYPE html>
777
785
  <html lang="ru" dir="ltr">
778
786
  <head>
@@ -809,7 +817,7 @@ exports[`Regression > internal 31`] = `
809
817
  </html>"
810
818
  `;
811
819
 
812
- exports[`Regression > internal 32`] = `
820
+ exports[`Regression > internal 33`] = `
813
821
  "<!DOCTYPE html>
814
822
  <html lang="ru" dir="ltr">
815
823
  <head>
@@ -846,7 +854,7 @@ exports[`Regression > internal 32`] = `
846
854
  </html>"
847
855
  `;
848
856
 
849
- exports[`Regression > internal 33`] = `
857
+ exports[`Regression > internal 34`] = `
850
858
  "<!DOCTYPE html>
851
859
  <html lang="ru" dir="ltr">
852
860
  <head>
@@ -883,7 +891,7 @@ exports[`Regression > internal 33`] = `
883
891
  </html>"
884
892
  `;
885
893
 
886
- exports[`Regression > internal 34`] = `
894
+ exports[`Regression > internal 35`] = `
887
895
  "<!DOCTYPE html>
888
896
  <html lang="ru" dir="ltr">
889
897
  <head>
@@ -920,7 +928,7 @@ exports[`Regression > internal 34`] = `
920
928
  </html>"
921
929
  `;
922
930
 
923
- exports[`Regression > internal 35`] = `
931
+ exports[`Regression > internal 36`] = `
924
932
  "<!DOCTYPE html>
925
933
  <html lang="ru" dir="ltr">
926
934
  <head>
@@ -957,7 +965,7 @@ exports[`Regression > internal 35`] = `
957
965
  </html>"
958
966
  `;
959
967
 
960
- exports[`Regression > internal 36`] = `
968
+ exports[`Regression > internal 37`] = `
961
969
  "<!DOCTYPE html>
962
970
  <html lang="ru" dir="ltr">
963
971
  <head>
@@ -994,7 +1002,7 @@ exports[`Regression > internal 36`] = `
994
1002
  </html>"
995
1003
  `;
996
1004
 
997
- exports[`Regression > internal 37`] = `
1005
+ exports[`Regression > internal 38`] = `
998
1006
  "<!DOCTYPE html>
999
1007
  <html lang="ru" dir="ltr">
1000
1008
  <head>
@@ -1031,7 +1039,7 @@ exports[`Regression > internal 37`] = `
1031
1039
  </html>"
1032
1040
  `;
1033
1041
 
1034
- exports[`Regression > internal 38`] = `
1042
+ exports[`Regression > internal 39`] = `
1035
1043
  "<!DOCTYPE html>
1036
1044
  <html lang="ru" dir="ltr">
1037
1045
  <head>
@@ -1068,7 +1076,7 @@ exports[`Regression > internal 38`] = `
1068
1076
  </html>"
1069
1077
  `;
1070
1078
 
1071
- exports[`Regression > internal 39`] = `
1079
+ exports[`Regression > internal 40`] = `
1072
1080
  "<!DOCTYPE html>
1073
1081
  <html lang="ru" dir="ltr">
1074
1082
  <head>
@@ -1105,7 +1113,7 @@ exports[`Regression > internal 39`] = `
1105
1113
  </html>"
1106
1114
  `;
1107
1115
 
1108
- exports[`Regression > internal 40`] = `
1116
+ exports[`Regression > internal 41`] = `
1109
1117
  "<!DOCTYPE html>
1110
1118
  <html lang="ru" dir="ltr">
1111
1119
  <head>
@@ -1144,7 +1152,7 @@ exports[`Regression > internal 40`] = `
1144
1152
  </html>"
1145
1153
  `;
1146
1154
 
1147
- exports[`Regression > internal 41`] = `
1155
+ exports[`Regression > internal 42`] = `
1148
1156
  "<!DOCTYPE html>
1149
1157
  <html lang="ru" dir="ltr">
1150
1158
  <head>
@@ -1163,7 +1171,7 @@ exports[`Regression > internal 41`] = `
1163
1171
  <body class="g-root g-root_theme_light">
1164
1172
  <div id="root"></div>
1165
1173
  <script type="application/json" id="diplodoc-state">
1166
- {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"merge/merged.html\\"&gt;merged&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Should use merged item"},"router":{"pathname":"merge/merge","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1174
+ {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"merge/merged.html\\"&gt;merged&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Tool: Hammer and Laser&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Should use merged item"},"router":{"pathname":"merge/merge","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1167
1175
  </script>
1168
1176
  <script type="application/javascript">
1169
1177
  const data = document.querySelector('script#diplodoc-state');
@@ -1181,7 +1189,7 @@ exports[`Regression > internal 41`] = `
1181
1189
  </html>"
1182
1190
  `;
1183
1191
 
1184
- exports[`Regression > internal 42`] = `
1192
+ exports[`Regression > internal 43`] = `
1185
1193
  "<!DOCTYPE html>
1186
1194
  <html lang="ru" dir="ltr">
1187
1195
  <head>
@@ -1219,9 +1227,9 @@ exports[`Regression > internal 42`] = `
1219
1227
  </html>"
1220
1228
  `;
1221
1229
 
1222
- exports[`Regression > internal 43`] = `"window.__DATA__.data.toc = {"items":[{"name":"Use merged","href":"merge/merge.html","id":"UUID"},{"name":"Multitoc item","href":"1.html","id":"UUID"},{"name":"Merged item","href":"merge/merged.html","id":"UUID"}],"path":"merge/toc.yaml","id":"UUID"};"`;
1230
+ exports[`Regression > internal 44`] = `"window.__DATA__.data.toc = {"items":[{"name":"Use merged","href":"merge/merge.html","id":"UUID"},{"name":"Multitoc item","href":"1.html","id":"UUID"},{"name":"Merged item","href":"merge/merged.html","id":"UUID"}],"path":"merge/toc.yaml","id":"UUID"};"`;
1223
1231
 
1224
- exports[`Regression > internal 44`] = `
1232
+ exports[`Regression > internal 45`] = `
1225
1233
  "<!DOCTYPE html>
1226
1234
  <html lang="ru" dir="ltr">
1227
1235
  <head>
@@ -1259,7 +1267,7 @@ exports[`Regression > internal 44`] = `
1259
1267
  </html>"
1260
1268
  `;
1261
1269
 
1262
- exports[`Regression > internal 45`] = `
1270
+ exports[`Regression > internal 46`] = `
1263
1271
  "<!DOCTYPE html>
1264
1272
  <html lang="ru" dir="ltr">
1265
1273
  <head>
@@ -1298,7 +1306,7 @@ exports[`Regression > internal 45`] = `
1298
1306
  </html>"
1299
1307
  `;
1300
1308
 
1301
- exports[`Regression > internal 46`] = `
1309
+ exports[`Regression > internal 47`] = `
1302
1310
  "<!DOCTYPE html>
1303
1311
  <html lang="ru" dir="ltr">
1304
1312
  <head>
@@ -1337,7 +1345,7 @@ exports[`Regression > internal 46`] = `
1337
1345
  </html>"
1338
1346
  `;
1339
1347
 
1340
- exports[`Regression > internal 47`] = `
1348
+ exports[`Regression > internal 48`] = `
1341
1349
  "<!DOCTYPE html>
1342
1350
  <html lang="ru" dir="ltr">
1343
1351
  <head>
@@ -1374,7 +1382,7 @@ exports[`Regression > internal 47`] = `
1374
1382
  </html>"
1375
1383
  `;
1376
1384
 
1377
- exports[`Regression > internal 48`] = `
1385
+ exports[`Regression > internal 49`] = `
1378
1386
  "<!DOCTYPE html>
1379
1387
  <html lang="ru" dir="ltr">
1380
1388
  <head>
@@ -1411,4 +1419,4 @@ exports[`Regression > internal 48`] = `
1411
1419
  </html>"
1412
1420
  `;
1413
1421
 
1414
- exports[`Regression > internal 49`] = `"window.__DATA__.data.toc = {"items":[{"name":"Verbose root (index.yaml) will be transformed to index.html","href":"index.html","id":"UUID"},{"name":"Root will be transformed to index.html","href":"index.html","id":"UUID"},{"name":"Md item with not_var syntax","href":"1.html","id":"UUID"},{"name":"Md item named without extension","href":"1.html","id":"UUID"},{"name":"Item with empty href","id":"UUID"},{"name":"Multitoc item","href":"merge/merged.html","id":"UUID"},{"name":"Included Item","href":"included-item.html","id":"UUID"},{"name":"Named include (items is Object here - this is not an error)","items":[{"name":"Item 1","href":"sub/folder/item-1.html","id":"UUID"}],"id":"UUID"},{"href":"mermaid.html","name":"Mermaid usage","id":"UUID"},{"name":"Latex usage","href":"latex.html","id":"UUID"},{"name":"Images","href":"images.html","id":"UUID"},{"name":"Autotitle","href":"autotitle.html","id":"UUID"},{"name":"includes","href":"includes.html","id":"UUID"},{"name":"generic","items":[{"name":"Note 1","href":"generic/1.html","id":"UUID"},{"name":"Note 1","href":"generic/2.html","id":"UUID"},{"name":"3","href":"generic/3.html","id":"UUID"},{"name":"Sub notes","items":[{"name":"Sub note 1","href":"generic/Sub notes/1.html","id":"UUID"},{"name":"Sub note 2","href":"generic/Sub notes/2.html","id":"UUID"}],"id":"UUID"}],"id":"UUID"},{"name":"openapi","items":[{"name":"Overview","href":"openapi/index.html","id":"UUID"},{"name":"test-controller","items":[{"name":"Overview","href":"openapi/test-controller/index.html","id":"UUID"},{"href":"openapi/test-controller/getWithPayloadResponse.html","name":"Simple get operation. тест новой верстки 3","id":"UUID"}],"id":"UUID"}],"id":"UUID"}],"path":"toc.yaml","id":"UUID"};"`;
1422
+ exports[`Regression > internal 50`] = `"window.__DATA__.data.toc = {"items":[{"name":"Verbose root (index.yaml) will be transformed to index.html","href":"index.html","id":"UUID"},{"name":"Root will be transformed to index.html","href":"index.html","id":"UUID"},{"name":"Md item with not_var syntax","href":"1.html","id":"UUID"},{"name":"Md item named without extension","href":"1.html","id":"UUID"},{"name":"Item with empty href","id":"UUID"},{"name":"Multitoc item","href":"merge/merged.html","id":"UUID"},{"name":"Included Item","href":"included-item.html","id":"UUID"},{"name":"Named include (items is Object here - this is not an error)","items":[{"name":"Item 1","href":"sub/folder/item-1.html","id":"UUID"}],"id":"UUID"},{"href":"mermaid.html","name":"Mermaid usage","id":"UUID"},{"name":"Latex usage","href":"latex.html","id":"UUID"},{"name":"Images","href":"images.html","id":"UUID"},{"name":"Autotitle","href":"autotitle.html","id":"UUID"},{"name":"includes","href":"includes.html","id":"UUID"},{"name":"generic","items":[{"name":"Note 1","href":"generic/1.html","id":"UUID"},{"name":"Note 1","href":"generic/2.html","id":"UUID"},{"name":"3","href":"generic/3.html","id":"UUID"},{"name":"Sub notes","items":[{"name":"Sub note 1","href":"generic/Sub notes/1.html","id":"UUID"},{"name":"Sub note 2","href":"generic/Sub notes/2.html","id":"UUID"}],"id":"UUID"}],"id":"UUID"},{"name":"openapi","items":[{"name":"Overview","href":"openapi/index.html","id":"UUID"},{"name":"test-controller","items":[{"name":"Overview","href":"openapi/test-controller/index.html","id":"UUID"},{"href":"openapi/test-controller/getWithPayloadResponse.html","name":"Simple get operation. тест новой верстки 3","id":"UUID"}],"id":"UUID"}],"id":"UUID"}],"path":"toc.yaml","id":"UUID"};"`;
@@ -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)
@@ -0,0 +1 @@
1
+ Tool: {{tools}}
@@ -1,3 +1,5 @@
1
1
  # Should use merged item
2
2
 
3
3
  [merged](./merged.md)
4
+
5
+ {% include [tools](../includes/tools.md) %}
@@ -1,2 +1,3 @@
1
1
  default:
2
2
  product: merge
3
+ tools: Hammer and Laser
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.8.1",
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