@diplodoc/cli-tests 5.2.2 → 5.3.1

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
@@ -13,6 +13,76 @@ exports[`Generate map for > project with external links in toc 1`] = `
13
13
  }"
14
14
  `;
15
15
 
16
+ exports[`Generate map for > project with external links in toc 2`] = `
17
+ {
18
+ "fileTrie": {
19
+ "tocMapping": {
20
+ "t0": "ru/toc.yaml",
21
+ },
22
+ "trie": {
23
+ "ru": {
24
+ "children": {
25
+ "folder1": {
26
+ "children": {
27
+ "a1": {
28
+ "file": {
29
+ "ext": ".md",
30
+ "toc": "t0",
31
+ },
32
+ },
33
+ "folder2": {
34
+ "children": {
35
+ "a1": {
36
+ "file": {
37
+ "ext": ".md",
38
+ "toc": "t0",
39
+ },
40
+ },
41
+ },
42
+ },
43
+ },
44
+ },
45
+ "index": {
46
+ "file": {
47
+ "ext": ".md",
48
+ "toc": "t0",
49
+ },
50
+ },
51
+ "plugins": {
52
+ "children": {
53
+ "index": {
54
+ "file": {
55
+ "ext": ".md",
56
+ "toc": "t0",
57
+ },
58
+ },
59
+ },
60
+ },
61
+ "project": {
62
+ "children": {
63
+ "index": {
64
+ "file": {
65
+ "ext": ".md",
66
+ "toc": "t0",
67
+ },
68
+ },
69
+ },
70
+ },
71
+ "settings": {
72
+ "file": {
73
+ "ext": ".md",
74
+ "toc": "t0",
75
+ },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ },
81
+ "redirects": {},
82
+ "yfmConfig": {},
83
+ }
84
+ `;
85
+
16
86
  exports[`Generate map for > project with multiple language 1`] = `
17
87
  "{
18
88
  "files": [
@@ -32,6 +102,117 @@ exports[`Generate map for > project with multiple language 1`] = `
32
102
  }"
33
103
  `;
34
104
 
105
+ exports[`Generate map for > project with multiple language 2`] = `
106
+ {
107
+ "fileTrie": {
108
+ "tocMapping": {
109
+ "t0": "en/toc.yaml",
110
+ "t1": "ru/toc.yaml",
111
+ },
112
+ "trie": {
113
+ "en": {
114
+ "children": {
115
+ "index": {
116
+ "file": {
117
+ "ext": ".md",
118
+ "toc": "t0",
119
+ },
120
+ },
121
+ "plugins": {
122
+ "children": {
123
+ "import": {
124
+ "file": {
125
+ "ext": ".md",
126
+ "toc": "t0",
127
+ },
128
+ },
129
+ "index": {
130
+ "file": {
131
+ "ext": ".md",
132
+ "toc": "t0",
133
+ },
134
+ },
135
+ },
136
+ },
137
+ "project": {
138
+ "children": {
139
+ "config": {
140
+ "file": {
141
+ "ext": ".md",
142
+ "toc": "t0",
143
+ },
144
+ },
145
+ "index": {
146
+ "file": {
147
+ "ext": ".md",
148
+ "toc": "t0",
149
+ },
150
+ },
151
+ },
152
+ },
153
+ "settings": {
154
+ "file": {
155
+ "ext": ".md",
156
+ "toc": "t0",
157
+ },
158
+ },
159
+ },
160
+ },
161
+ "ru": {
162
+ "children": {
163
+ "index": {
164
+ "file": {
165
+ "ext": ".md",
166
+ "toc": "t1",
167
+ },
168
+ },
169
+ "plugins": {
170
+ "children": {
171
+ "import": {
172
+ "file": {
173
+ "ext": ".md",
174
+ "toc": "t1",
175
+ },
176
+ },
177
+ "index": {
178
+ "file": {
179
+ "ext": ".md",
180
+ "toc": "t1",
181
+ },
182
+ },
183
+ },
184
+ },
185
+ "project": {
186
+ "children": {
187
+ "config": {
188
+ "file": {
189
+ "ext": ".md",
190
+ "toc": "t1",
191
+ },
192
+ },
193
+ "index": {
194
+ "file": {
195
+ "ext": ".md",
196
+ "toc": "t1",
197
+ },
198
+ },
199
+ },
200
+ },
201
+ "settings": {
202
+ "file": {
203
+ "ext": ".md",
204
+ "toc": "t1",
205
+ },
206
+ },
207
+ },
208
+ },
209
+ },
210
+ },
211
+ "redirects": {},
212
+ "yfmConfig": {},
213
+ }
214
+ `;
215
+
35
216
  exports[`Generate map for > project with single language and toc include - only md2html 1`] = `
36
217
  "{
37
218
  "files": [
@@ -47,6 +228,88 @@ exports[`Generate map for > project with single language and toc include - only
47
228
  }"
48
229
  `;
49
230
 
231
+ exports[`Generate map for > project with single language and toc include - only md2html 2`] = `
232
+ {
233
+ "fileTrie": {
234
+ "tocMapping": {
235
+ "t0": "ru/toc.yaml",
236
+ },
237
+ "trie": {
238
+ "ru": {
239
+ "children": {
240
+ "folder1": {
241
+ "children": {
242
+ "a1": {
243
+ "file": {
244
+ "ext": ".md",
245
+ "toc": "t0",
246
+ },
247
+ },
248
+ "folder2": {
249
+ "children": {
250
+ "a1": {
251
+ "file": {
252
+ "ext": ".md",
253
+ "toc": "t0",
254
+ },
255
+ },
256
+ },
257
+ },
258
+ },
259
+ },
260
+ "index": {
261
+ "file": {
262
+ "ext": ".md",
263
+ "toc": "t0",
264
+ },
265
+ },
266
+ "plugins": {
267
+ "children": {
268
+ "import": {
269
+ "file": {
270
+ "ext": ".md",
271
+ "toc": "t0",
272
+ },
273
+ },
274
+ "index": {
275
+ "file": {
276
+ "ext": ".md",
277
+ "toc": "t0",
278
+ },
279
+ },
280
+ },
281
+ },
282
+ "project": {
283
+ "children": {
284
+ "config": {
285
+ "file": {
286
+ "ext": ".md",
287
+ "toc": "t0",
288
+ },
289
+ },
290
+ "index": {
291
+ "file": {
292
+ "ext": ".md",
293
+ "toc": "t0",
294
+ },
295
+ },
296
+ },
297
+ },
298
+ "settings": {
299
+ "file": {
300
+ "ext": ".md",
301
+ "toc": "t0",
302
+ },
303
+ },
304
+ },
305
+ },
306
+ },
307
+ },
308
+ "redirects": {},
309
+ "yfmConfig": {},
310
+ }
311
+ `;
312
+
50
313
  exports[`Generate map for > project with single language and toc include 1`] = `
51
314
  "{
52
315
  "files": [
@@ -61,3 +324,85 @@ exports[`Generate map for > project with single language and toc include 1`] = `
61
324
  ]
62
325
  }"
63
326
  `;
327
+
328
+ exports[`Generate map for > project with single language and toc include 2`] = `
329
+ {
330
+ "fileTrie": {
331
+ "tocMapping": {
332
+ "t0": "ru/toc.yaml",
333
+ },
334
+ "trie": {
335
+ "ru": {
336
+ "children": {
337
+ "folder1": {
338
+ "children": {
339
+ "a1": {
340
+ "file": {
341
+ "ext": ".md",
342
+ "toc": "t0",
343
+ },
344
+ },
345
+ "folder2": {
346
+ "children": {
347
+ "a1": {
348
+ "file": {
349
+ "ext": ".md",
350
+ "toc": "t0",
351
+ },
352
+ },
353
+ },
354
+ },
355
+ },
356
+ },
357
+ "index": {
358
+ "file": {
359
+ "ext": ".md",
360
+ "toc": "t0",
361
+ },
362
+ },
363
+ "plugins": {
364
+ "children": {
365
+ "import": {
366
+ "file": {
367
+ "ext": ".md",
368
+ "toc": "t0",
369
+ },
370
+ },
371
+ "index": {
372
+ "file": {
373
+ "ext": ".md",
374
+ "toc": "t0",
375
+ },
376
+ },
377
+ },
378
+ },
379
+ "project": {
380
+ "children": {
381
+ "config": {
382
+ "file": {
383
+ "ext": ".md",
384
+ "toc": "t0",
385
+ },
386
+ },
387
+ "index": {
388
+ "file": {
389
+ "ext": ".md",
390
+ "toc": "t0",
391
+ },
392
+ },
393
+ },
394
+ },
395
+ "settings": {
396
+ "file": {
397
+ "ext": ".md",
398
+ "toc": "t0",
399
+ },
400
+ },
401
+ },
402
+ },
403
+ },
404
+ },
405
+ "redirects": {},
406
+ "yfmConfig": {},
407
+ }
408
+ `;