@diplodoc/cli-tests 5.2.2 → 5.3.0

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__/generate-map.spec.ts.snap +345 -0
  2. package/e2e/__snapshots__/preprocess.test.ts.snap +497 -0
  3. package/e2e/__snapshots__/regression.test.ts.snap +76 -57
  4. package/e2e/generate-map.spec.ts +9 -3
  5. package/e2e/preprocess.test.ts +21 -0
  6. package/mocks/preprocess/test1/input/.yfm +2 -0
  7. package/mocks/preprocess/test1/input/1.md +29 -0
  8. package/mocks/preprocess/test1/input/_assets/1.png +0 -0
  9. package/mocks/preprocess/test1/input/autotitle.md +23 -0
  10. package/mocks/preprocess/test1/input/commented-include.md +3 -0
  11. package/mocks/preprocess/test1/input/images.md +5 -0
  12. package/mocks/preprocess/test1/input/included-item.md +12 -0
  13. package/mocks/preprocess/test1/input/includes/deep.md +1 -0
  14. package/mocks/preprocess/test1/input/includes/presets.yaml +2 -0
  15. package/mocks/preprocess/test1/input/includes/sub/user.md +1 -0
  16. package/mocks/preprocess/test1/input/includes/test.md +1 -0
  17. package/mocks/preprocess/test1/input/includes/user.md +1 -0
  18. package/mocks/preprocess/test1/input/includes.md +14 -0
  19. package/mocks/preprocess/test1/input/latex.md +3 -0
  20. package/mocks/preprocess/test1/input/mermaid.md +13 -0
  21. package/mocks/preprocess/test1/input/presets.yaml +8 -0
  22. package/mocks/preprocess/test1/input/sub/folder/item-1.md +5 -0
  23. package/mocks/preprocess/test1/input/sub/toc.yaml +5 -0
  24. package/mocks/preprocess/test1/input/toc-i.yaml +3 -0
  25. package/mocks/preprocess/test1/input/toc.yaml +16 -0
  26. package/mocks/preprocess/test2/input/.yfm +2 -0
  27. package/mocks/preprocess/test2/input/1.md +29 -0
  28. package/mocks/preprocess/test2/input/_assets/1.png +0 -0
  29. package/mocks/preprocess/test2/input/autotitle.md +23 -0
  30. package/mocks/preprocess/test2/input/commented-include.md +3 -0
  31. package/mocks/preprocess/test2/input/images.md +5 -0
  32. package/mocks/preprocess/test2/input/included-item.md +12 -0
  33. package/mocks/preprocess/test2/input/includes/deep.md +1 -0
  34. package/mocks/preprocess/test2/input/includes/presets.yaml +2 -0
  35. package/mocks/preprocess/test2/input/includes/sub/user.md +1 -0
  36. package/mocks/preprocess/test2/input/includes/test.md +1 -0
  37. package/mocks/preprocess/test2/input/includes/user.md +1 -0
  38. package/mocks/preprocess/test2/input/includes.md +14 -0
  39. package/mocks/preprocess/test2/input/latex.md +3 -0
  40. package/mocks/preprocess/test2/input/mermaid.md +13 -0
  41. package/mocks/preprocess/test2/input/presets.yaml +8 -0
  42. package/mocks/preprocess/test2/input/sub/folder/item-1.md +5 -0
  43. package/mocks/preprocess/test2/input/sub/toc.yaml +5 -0
  44. package/mocks/preprocess/test2/input/toc-i.yaml +3 -0
  45. package/mocks/preprocess/test2/input/toc.yaml +16 -0
  46. package/mocks/regression/input/.yfm +2 -0
  47. package/mocks/regression/input/includes.md +5 -0
  48. package/package.json +1 -1
@@ -0,0 +1,497 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Preprocess > HashIncludes=true,Autotitles=false > filelist 1`] = `
4
+ "[
5
+ ".yfm",
6
+ "1.md",
7
+ "_assets/1.png",
8
+ "autotitle.md",
9
+ "images.md",
10
+ "included-item.md",
11
+ "includes.md",
12
+ "includes/deep-hash.md",
13
+ "includes/sub/user-hash.md",
14
+ "includes/test-hash.md",
15
+ "includes/user-hash.md",
16
+ "latex.md",
17
+ "mermaid.md",
18
+ "sub/folder/item-1.md",
19
+ "toc.yaml"
20
+ ]"
21
+ `;
22
+
23
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 1`] = `
24
+ "preprocess:
25
+ mergeAutotitles: false
26
+ "
27
+ `;
28
+
29
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 2`] = `
30
+ "---
31
+ metadata:
32
+ - name: generator
33
+ content: Diplodoc Platform vDIPLODOC-VERSION
34
+ ---
35
+ # Title
36
+
37
+ Text not_var{{not-var}} not_var{{skip()}} default-var-value
38
+
39
+ Text \`not_var{{not-var}}\` \`not_var{{skip()}}\` \`default-var-value\`
40
+
41
+ Text
42
+ \`\`\`
43
+ not_var{{not-var}}
44
+
45
+ not_var{{skip()}}
46
+
47
+ default-var-value
48
+ \`\`\`
49
+
50
+
51
+ \`[not a link](./path/to/relative/file.md)\`
52
+
53
+ ## Subtitle {#subtitle}
54
+
55
+ [{#T}](./mermaid.md)
56
+
57
+ [{#T}](./mermaid.md#info)
58
+
59
+ [](./latex.md)
60
+
61
+ [noext-link](./includes)
62
+
63
+ {% include [user](includes/user-hash.md) %}
64
+ "
65
+ `;
66
+
67
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 3`] = `
68
+ "---
69
+ metadata:
70
+ - name: generator
71
+ content: Diplodoc Platform vDIPLODOC-VERSION
72
+ ---
73
+ # Autotitles
74
+
75
+ Empty title
76
+ [](./1.md)
77
+
78
+ Empty subtitle
79
+ [](./1.md#subtitle)
80
+
81
+ Special title
82
+ [{#T}](./1.md)
83
+
84
+ Special subtitle
85
+ [{#T}](./1.md#subtitle)
86
+
87
+ Empty local title
88
+ [](#header)
89
+
90
+ Special local title
91
+ [{#T}](#header)
92
+
93
+ ## Header {#header}
94
+
95
+ Content
96
+ "
97
+ `;
98
+
99
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 4`] = `
100
+ "---
101
+ metadata:
102
+ - name: generator
103
+ content: Diplodoc Platform vDIPLODOC-VERSION
104
+ ---
105
+ # Images
106
+
107
+ ![simple image](_assets/1.png)
108
+
109
+
110
+ "
111
+ `;
112
+
113
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 5`] = `
114
+ "---
115
+ metadata:
116
+ - name: generator
117
+ content: Diplodoc Platform vDIPLODOC-VERSION
118
+ ---
119
+ # Included item
120
+
121
+ Included item text
122
+
123
+ <!-- : {% include [rec-off](./commented-include.md) %} -->
124
+
125
+ {% note alert "Alert!" %}
126
+
127
+ <!-- content -->
128
+
129
+ {% endnote %}
130
+
131
+ "
132
+ `;
133
+
134
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 6`] = `
135
+ "---
136
+ metadata:
137
+ - name: generator
138
+ content: Diplodoc Platform vDIPLODOC-VERSION
139
+ ---
140
+ Text
141
+
142
+ {% include [user](includes/user-hash.md) %}
143
+
144
+ {% include [test](includes/test-hash.md) %}
145
+
146
+ Link after include
147
+ [{#T}](./1.md)
148
+
149
+ <!--{% include [For includes/deep.md](includes/deep.md) %}-->
150
+ {% include [For includes/deep-hash.md](includes/deep-hash.md) %}
151
+
152
+ Link after include
153
+ [{#T}](./1.md#subtitle)
154
+ "
155
+ `;
156
+
157
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 7`] = `
158
+ "{% include [user](./sub/user-hash.md) %}
159
+ "
160
+ `;
161
+
162
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 8`] = `
163
+ "Bob
164
+ "
165
+ `;
166
+
167
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 9`] = `
168
+ "Test
169
+ "
170
+ `;
171
+
172
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 10`] = `
173
+ "Bob
174
+ "
175
+ `;
176
+
177
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 11`] = `
178
+ "---
179
+ metadata:
180
+ - name: generator
181
+ content: Diplodoc Platform vDIPLODOC-VERSION
182
+ ---
183
+ # Latex usage
184
+
185
+ $/sqrt{3x-1}+(1+x)^2$
186
+ "
187
+ `;
188
+
189
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 12`] = `
190
+ "---
191
+ metadata:
192
+ - name: generator
193
+ content: Diplodoc Platform vDIPLODOC-VERSION
194
+ ---
195
+ # Mermaid usage
196
+
197
+ \`\`\`mermaid
198
+
199
+ sequenceDiagram
200
+ rect rgba(251, 243, 232, 0.2)
201
+ Alice ->> Bob:
202
+ end
203
+ \`\`\`
204
+
205
+ ## Mermaid info {#info}
206
+
207
+ Some mermaid info
208
+ "
209
+ `;
210
+
211
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 13`] = `
212
+ "---
213
+ metadata:
214
+ - name: generator
215
+ content: Diplodoc Platform vDIPLODOC-VERSION
216
+ ---
217
+ # Item 1
218
+
219
+ Item 1 text
220
+
221
+ [{#T}](../../images.md)
222
+ "
223
+ `;
224
+
225
+ exports[`Preprocess > HashIncludes=true,Autotitles=false 14`] = `
226
+ "items:
227
+ - name: Md item with not_var syntax
228
+ href: 1.md
229
+ - name: Md item named without extension
230
+ href: 1.md
231
+ - name: Included Item
232
+ href: included-item.md
233
+ - name: Named include (items is Object here - this is not an error)
234
+ items:
235
+ - name: Item 1
236
+ href: sub/folder/item-1.md
237
+ - href: mermaid.md
238
+ name: Mermaid usage
239
+ - name: Latex usage
240
+ href: latex.md
241
+ - name: Images
242
+ href: images.md
243
+ - name: Autotitle
244
+ href: autotitle.md
245
+ - name: includes
246
+ href: includes.md
247
+ path: toc.yaml
248
+ "
249
+ `;
250
+
251
+ exports[`Preprocess > HashIncludes=true,Autotitles=true > filelist 1`] = `
252
+ "[
253
+ ".yfm",
254
+ "1.md",
255
+ "_assets/1.png",
256
+ "autotitle.md",
257
+ "images.md",
258
+ "included-item.md",
259
+ "includes.md",
260
+ "includes/deep-hash.md",
261
+ "includes/sub/user-hash.md",
262
+ "includes/test-hash.md",
263
+ "includes/user-hash.md",
264
+ "latex.md",
265
+ "mermaid.md",
266
+ "sub/folder/item-1.md",
267
+ "toc.yaml"
268
+ ]"
269
+ `;
270
+
271
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 1`] = `
272
+ "preprocess:
273
+ mergeAutotitles: true
274
+ "
275
+ `;
276
+
277
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 2`] = `
278
+ "---
279
+ metadata:
280
+ - name: generator
281
+ content: Diplodoc Platform vDIPLODOC-VERSION
282
+ ---
283
+ # Title
284
+
285
+ Text not_var{{not-var}} not_var{{skip()}} default-var-value
286
+
287
+ Text \`not_var{{not-var}}\` \`not_var{{skip()}}\` \`default-var-value\`
288
+
289
+ Text
290
+ \`\`\`
291
+ not_var{{not-var}}
292
+
293
+ not_var{{skip()}}
294
+
295
+ default-var-value
296
+ \`\`\`
297
+
298
+
299
+ \`[not a link](./path/to/relative/file.md)\`
300
+
301
+ ## Subtitle {#subtitle}
302
+
303
+ [Mermaid usage](./mermaid.md)
304
+
305
+ [Mermaid info](./mermaid.md#info)
306
+
307
+ [Latex usage](./latex.md)
308
+
309
+ [noext-link](./includes)
310
+
311
+ {% include [user](includes/user-hash.md) %}
312
+ "
313
+ `;
314
+
315
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 3`] = `
316
+ "---
317
+ metadata:
318
+ - name: generator
319
+ content: Diplodoc Platform vDIPLODOC-VERSION
320
+ ---
321
+ # Autotitles
322
+
323
+ Empty title
324
+ [Title](./1.md)
325
+
326
+ Empty subtitle
327
+ [Subtitle](./1.md#subtitle)
328
+
329
+ Special title
330
+ [Title](./1.md)
331
+
332
+ Special subtitle
333
+ [Subtitle](./1.md#subtitle)
334
+
335
+ Empty local title
336
+ [Header](#header)
337
+
338
+ Special local title
339
+ [Header](#header)
340
+
341
+ ## Header {#header}
342
+
343
+ Content
344
+ "
345
+ `;
346
+
347
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 4`] = `
348
+ "---
349
+ metadata:
350
+ - name: generator
351
+ content: Diplodoc Platform vDIPLODOC-VERSION
352
+ ---
353
+ # Images
354
+
355
+ ![simple image](_assets/1.png)
356
+
357
+
358
+ "
359
+ `;
360
+
361
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 5`] = `
362
+ "---
363
+ metadata:
364
+ - name: generator
365
+ content: Diplodoc Platform vDIPLODOC-VERSION
366
+ ---
367
+ # Included item
368
+
369
+ Included item text
370
+
371
+ <!-- : {% include [rec-off](./commented-include.md) %} -->
372
+
373
+ {% note alert "Alert!" %}
374
+
375
+ <!-- content -->
376
+
377
+ {% endnote %}
378
+
379
+ "
380
+ `;
381
+
382
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 6`] = `
383
+ "---
384
+ metadata:
385
+ - name: generator
386
+ content: Diplodoc Platform vDIPLODOC-VERSION
387
+ ---
388
+ Text
389
+
390
+ {% include [user](includes/user-hash.md) %}
391
+
392
+ {% include [test](includes/test-hash.md) %}
393
+
394
+ Link after include
395
+ [Title](./1.md)
396
+
397
+ <!--{% include [For includes/deep.md](includes/deep.md) %}-->
398
+ {% include [For includes/deep-hash.md](includes/deep-hash.md) %}
399
+
400
+ Link after include
401
+ [Subtitle](./1.md#subtitle)
402
+ "
403
+ `;
404
+
405
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 7`] = `
406
+ "{% include [user](./sub/user-hash.md) %}
407
+ "
408
+ `;
409
+
410
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 8`] = `
411
+ "Bob
412
+ "
413
+ `;
414
+
415
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 9`] = `
416
+ "Test
417
+ "
418
+ `;
419
+
420
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 10`] = `
421
+ "Bob
422
+ "
423
+ `;
424
+
425
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 11`] = `
426
+ "---
427
+ metadata:
428
+ - name: generator
429
+ content: Diplodoc Platform vDIPLODOC-VERSION
430
+ ---
431
+ # Latex usage
432
+
433
+ $/sqrt{3x-1}+(1+x)^2$
434
+ "
435
+ `;
436
+
437
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 12`] = `
438
+ "---
439
+ metadata:
440
+ - name: generator
441
+ content: Diplodoc Platform vDIPLODOC-VERSION
442
+ ---
443
+ # Mermaid usage
444
+
445
+ \`\`\`mermaid
446
+
447
+ sequenceDiagram
448
+ rect rgba(251, 243, 232, 0.2)
449
+ Alice ->> Bob:
450
+ end
451
+ \`\`\`
452
+
453
+ ## Mermaid info {#info}
454
+
455
+ Some mermaid info
456
+ "
457
+ `;
458
+
459
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 13`] = `
460
+ "---
461
+ metadata:
462
+ - name: generator
463
+ content: Diplodoc Platform vDIPLODOC-VERSION
464
+ ---
465
+ # Item 1
466
+
467
+ Item 1 text
468
+
469
+ [Images](../../images.md)
470
+ "
471
+ `;
472
+
473
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 14`] = `
474
+ "items:
475
+ - name: Md item with not_var syntax
476
+ href: 1.md
477
+ - name: Md item named without extension
478
+ href: 1.md
479
+ - name: Included Item
480
+ href: included-item.md
481
+ - name: Named include (items is Object here - this is not an error)
482
+ items:
483
+ - name: Item 1
484
+ href: sub/folder/item-1.md
485
+ - href: mermaid.md
486
+ name: Mermaid usage
487
+ - name: Latex usage
488
+ href: latex.md
489
+ - name: Images
490
+ href: images.md
491
+ - name: Autotitle
492
+ href: autotitle.md
493
+ - name: includes
494
+ href: includes.md
495
+ path: toc.yaml
496
+ "
497
+ `;