@diplodoc/cli-tests 5.39.7 → 5.40.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.
- package/e2e/__snapshots__/include-toc.test.ts.snap +23 -50
- package/e2e/__snapshots__/includes-conditions.test.ts.snap +15 -29
- package/e2e/__snapshots__/includes.test.ts.snap +437 -147
- package/e2e/__snapshots__/merge-includes.spec.ts.snap +400 -1
- package/e2e/__snapshots__/pdf-page.spec.ts.snap +0 -1
- package/e2e/__snapshots__/preprocess.test.ts.snap +108 -171
- package/e2e/__snapshots__/regression.test.ts.snap +167 -208
- package/e2e/merge-includes.spec.ts +70 -0
- package/mocks/merge-includes/html-comment-blanks/input/_includes/examples.md +27 -0
- package/mocks/merge-includes/html-comment-blanks/input/index.md +3 -0
- package/mocks/merge-includes/html-comment-blanks/input/main.md +15 -0
- package/mocks/merge-includes/html-comment-blanks/input/toc.yaml +5 -0
- package/mocks/merge-includes/include-after-fence/input/_includes/chat-button.md +1 -0
- package/mocks/merge-includes/include-after-fence/input/_includes/footer.md +1 -0
- package/mocks/merge-includes/include-after-fence/input/index.md +3 -0
- package/mocks/merge-includes/include-after-fence/input/main.md +14 -0
- package/mocks/merge-includes/include-after-fence/input/toc.yaml +5 -0
- package/mocks/merge-includes/include-in-code-block/input/_includes/glossary.md +1 -0
- package/mocks/merge-includes/include-in-code-block/input/index.md +3 -0
- package/mocks/merge-includes/include-in-code-block/input/main.md +19 -0
- package/mocks/merge-includes/include-in-code-block/input/toc.yaml +5 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/_includes/requirements.md +9 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/index.md +3 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/main.md +12 -0
- package/mocks/merge-includes/indent-paragraph-in-include/input/toc.yaml +5 -0
- package/mocks/merge-includes/yfm-table-html-block/input/_includes/button.md +8 -0
- package/mocks/merge-includes/yfm-table-html-block/input/index.md +3 -0
- package/mocks/merge-includes/yfm-table-html-block/input/main.md +12 -0
- package/mocks/merge-includes/yfm-table-html-block/input/toc.yaml +5 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/_includes/example.md +1 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/index.md +3 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/main.md +22 -0
- package/mocks/merge-includes/yfm-table-pipe-in-content/input/toc.yaml +5 -0
- package/package.json +1 -1
|
@@ -166,6 +166,90 @@ path: toc.yaml
|
|
|
166
166
|
"
|
|
167
167
|
`;
|
|
168
168
|
|
|
169
|
+
exports[`Merge includes (md2md) > html-comment-blanks: blank lines inside HTML comments keep list/cut continuity > filelist 1`] = `
|
|
170
|
+
"[
|
|
171
|
+
"index.md",
|
|
172
|
+
"main.md",
|
|
173
|
+
"toc.yaml"
|
|
174
|
+
]"
|
|
175
|
+
`;
|
|
176
|
+
|
|
177
|
+
exports[`Merge includes (md2md) > html-comment-blanks: blank lines inside HTML comments keep list/cut continuity 1`] = `
|
|
178
|
+
"---
|
|
179
|
+
metadata:
|
|
180
|
+
- name: generator
|
|
181
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
182
|
+
vcsPath: index.md
|
|
183
|
+
---
|
|
184
|
+
# Index
|
|
185
|
+
|
|
186
|
+
Welcome page.
|
|
187
|
+
"
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
exports[`Merge includes (md2md) > html-comment-blanks: blank lines inside HTML comments keep list/cut continuity 2`] = `
|
|
191
|
+
"---
|
|
192
|
+
metadata:
|
|
193
|
+
- name: generator
|
|
194
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
195
|
+
vcsPath: main.md
|
|
196
|
+
---
|
|
197
|
+
# Main
|
|
198
|
+
|
|
199
|
+
Intro paragraph.
|
|
200
|
+
|
|
201
|
+
- Item one with cut
|
|
202
|
+
|
|
203
|
+
{% cut "Examples" %}
|
|
204
|
+
|
|
205
|
+
<!-- source: _includes/examples.md -->
|
|
206
|
+
- [Real link one](https://example.com/one)
|
|
207
|
+
|
|
208
|
+
- [Real link two](https://example.com/two)
|
|
209
|
+
|
|
210
|
+
<!--
|
|
211
|
+
#|
|
|
212
|
+
||
|
|
213
|
+
**Header A**
|
|
214
|
+
|
|
|
215
|
+
**Header B**
|
|
216
|
+
||
|
|
217
|
+
|
|
218
|
+
||
|
|
219
|
+
Body cell A1
|
|
220
|
+
|
|
221
|
+
with blank lines inside the comment
|
|
222
|
+
|
|
223
|
+
|
|
|
224
|
+
Body cell B1
|
|
225
|
+
||
|
|
226
|
+
|
|
227
|
+
||
|
|
228
|
+
Body cell A2
|
|
229
|
+
|
|
|
230
|
+
Body cell B2
|
|
231
|
+
||
|
|
232
|
+
|# -->
|
|
233
|
+
<!-- endsource: _includes/examples.md -->
|
|
234
|
+
|
|
235
|
+
{% endcut %}
|
|
236
|
+
|
|
237
|
+
- Item two
|
|
238
|
+
|
|
239
|
+
After list paragraph that must still render.
|
|
240
|
+
"
|
|
241
|
+
`;
|
|
242
|
+
|
|
243
|
+
exports[`Merge includes (md2md) > html-comment-blanks: blank lines inside HTML comments keep list/cut continuity 3`] = `
|
|
244
|
+
"title: Merge Includes HTML Comment Blanks
|
|
245
|
+
href: index.md
|
|
246
|
+
items:
|
|
247
|
+
- name: Main
|
|
248
|
+
href: main.md
|
|
249
|
+
path: toc.yaml
|
|
250
|
+
"
|
|
251
|
+
`;
|
|
252
|
+
|
|
169
253
|
exports[`Merge includes (md2md) > html-in-list: include with <style> in list (any indent) uses fallback > filelist 1`] = `
|
|
170
254
|
"[
|
|
171
255
|
"index.md",
|
|
@@ -228,6 +312,192 @@ path: toc.yaml
|
|
|
228
312
|
"
|
|
229
313
|
`;
|
|
230
314
|
|
|
315
|
+
exports[`Merge includes (md2md) > include-after-fence: include placed right after a closing \`\`\` fence is inlined > filelist 1`] = `
|
|
316
|
+
"[
|
|
317
|
+
"index.md",
|
|
318
|
+
"main.md",
|
|
319
|
+
"toc.yaml"
|
|
320
|
+
]"
|
|
321
|
+
`;
|
|
322
|
+
|
|
323
|
+
exports[`Merge includes (md2md) > include-after-fence: include placed right after a closing \`\`\` fence is inlined 1`] = `
|
|
324
|
+
"---
|
|
325
|
+
metadata:
|
|
326
|
+
- name: generator
|
|
327
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
328
|
+
vcsPath: index.md
|
|
329
|
+
---
|
|
330
|
+
# Index
|
|
331
|
+
|
|
332
|
+
Welcome page.
|
|
333
|
+
"
|
|
334
|
+
`;
|
|
335
|
+
|
|
336
|
+
exports[`Merge includes (md2md) > include-after-fence: include placed right after a closing \`\`\` fence is inlined 2`] = `
|
|
337
|
+
"---
|
|
338
|
+
metadata:
|
|
339
|
+
- name: generator
|
|
340
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
341
|
+
vcsPath: main.md
|
|
342
|
+
---
|
|
343
|
+
# Main
|
|
344
|
+
|
|
345
|
+
Some intro text.
|
|
346
|
+
|
|
347
|
+
\`\`\`javascript
|
|
348
|
+
<script type="text/javascript">
|
|
349
|
+
function setCookie(name, value){
|
|
350
|
+
document.cookie = name + "=" + value + ";path=/";
|
|
351
|
+
}
|
|
352
|
+
</script>
|
|
353
|
+
\`\`\`
|
|
354
|
+
<!-- source: _includes/chat-button.md -->
|
|
355
|
+
[Написать в чат](https://example.com/chat){.button}
|
|
356
|
+
<!-- endsource: _includes/chat-button.md -->
|
|
357
|
+
|
|
358
|
+
<!-- source: _includes/footer.md -->
|
|
359
|
+
Footer text.
|
|
360
|
+
<!-- endsource: _includes/footer.md -->
|
|
361
|
+
"
|
|
362
|
+
`;
|
|
363
|
+
|
|
364
|
+
exports[`Merge includes (md2md) > include-after-fence: include placed right after a closing \`\`\` fence is inlined 3`] = `
|
|
365
|
+
"title: Include After Fence
|
|
366
|
+
href: index.md
|
|
367
|
+
items:
|
|
368
|
+
- name: Main
|
|
369
|
+
href: main.md
|
|
370
|
+
path: toc.yaml
|
|
371
|
+
"
|
|
372
|
+
`;
|
|
373
|
+
|
|
374
|
+
exports[`Merge includes (md2md) > include-in-code-block: include shown as code example is NOT expanded > filelist 1`] = `
|
|
375
|
+
"[
|
|
376
|
+
"index.md",
|
|
377
|
+
"main.md",
|
|
378
|
+
"toc.yaml"
|
|
379
|
+
]"
|
|
380
|
+
`;
|
|
381
|
+
|
|
382
|
+
exports[`Merge includes (md2md) > include-in-code-block: include shown as code example is NOT expanded 1`] = `
|
|
383
|
+
"---
|
|
384
|
+
metadata:
|
|
385
|
+
- name: generator
|
|
386
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
387
|
+
vcsPath: index.md
|
|
388
|
+
---
|
|
389
|
+
# Index
|
|
390
|
+
|
|
391
|
+
Welcome page.
|
|
392
|
+
"
|
|
393
|
+
`;
|
|
394
|
+
|
|
395
|
+
exports[`Merge includes (md2md) > include-in-code-block: include shown as code example is NOT expanded 2`] = `
|
|
396
|
+
"---
|
|
397
|
+
metadata:
|
|
398
|
+
- name: generator
|
|
399
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
400
|
+
vcsPath: main.md
|
|
401
|
+
---
|
|
402
|
+
# Main
|
|
403
|
+
|
|
404
|
+
Real include below — should be inlined:
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
Steps:
|
|
409
|
+
|
|
410
|
+
1. Open the resource file.
|
|
411
|
+
1. Insert the include directive into the file:
|
|
412
|
+
|
|
413
|
+
\`\`\`plaintext
|
|
414
|
+
{% include notitle [glossary](_includes/glossary.md) %}
|
|
415
|
+
|
|
416
|
+
[*glossary]: Magic line
|
|
417
|
+
\`\`\`
|
|
418
|
+
|
|
419
|
+
1. Use the keys from glossary.
|
|
420
|
+
|
|
421
|
+
End of page.
|
|
422
|
+
|
|
423
|
+
[*glossary__glossary]: Glossary section"
|
|
424
|
+
`;
|
|
425
|
+
|
|
426
|
+
exports[`Merge includes (md2md) > include-in-code-block: include shown as code example is NOT expanded 3`] = `
|
|
427
|
+
"title: Include In Code Block
|
|
428
|
+
href: index.md
|
|
429
|
+
items:
|
|
430
|
+
- name: Main
|
|
431
|
+
href: main.md
|
|
432
|
+
path: toc.yaml
|
|
433
|
+
"
|
|
434
|
+
`;
|
|
435
|
+
|
|
436
|
+
exports[`Merge includes (md2md) > indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %} > filelist 1`] = `
|
|
437
|
+
"[
|
|
438
|
+
"index.md",
|
|
439
|
+
"main.md",
|
|
440
|
+
"toc.yaml"
|
|
441
|
+
]"
|
|
442
|
+
`;
|
|
443
|
+
|
|
444
|
+
exports[`Merge includes (md2md) > indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %} 1`] = `
|
|
445
|
+
"---
|
|
446
|
+
metadata:
|
|
447
|
+
- name: generator
|
|
448
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
449
|
+
vcsPath: index.md
|
|
450
|
+
---
|
|
451
|
+
# Index
|
|
452
|
+
|
|
453
|
+
Welcome page.
|
|
454
|
+
"
|
|
455
|
+
`;
|
|
456
|
+
|
|
457
|
+
exports[`Merge includes (md2md) > indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %} 2`] = `
|
|
458
|
+
"---
|
|
459
|
+
metadata:
|
|
460
|
+
- name: generator
|
|
461
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
462
|
+
vcsPath: main.md
|
|
463
|
+
---
|
|
464
|
+
# Main Document
|
|
465
|
+
|
|
466
|
+
{% list tabs %}
|
|
467
|
+
|
|
468
|
+
- Mobile banner
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
{% include [requirements](_includes/requirements.md) %}
|
|
472
|
+
|
|
473
|
+
For more details see the requirements page.
|
|
474
|
+
|
|
475
|
+
{% endlist %}
|
|
476
|
+
|
|
477
|
+
{% included (_includes/requirements.md) %}
|
|
478
|
+
1/. Format: HTML5.
|
|
479
|
+
|
|
480
|
+
2/. The banner stretches to fit the screen.
|
|
481
|
+
|
|
482
|
+
3/. The banner must stretch to 100% of the screen width.
|
|
483
|
+
|
|
484
|
+
Width is set as a percentage value: 100%.
|
|
485
|
+
|
|
486
|
+
4/. Maximum archive size is 75 KB.
|
|
487
|
+
|
|
488
|
+
{% endincluded %}"
|
|
489
|
+
`;
|
|
490
|
+
|
|
491
|
+
exports[`Merge includes (md2md) > indent-paragraph: include under indent with indented top-level paragraph falls back to {% included %} 3`] = `
|
|
492
|
+
"title: Merge Includes Indent Paragraph In Include
|
|
493
|
+
href: index.md
|
|
494
|
+
items:
|
|
495
|
+
- name: Main
|
|
496
|
+
href: main.md
|
|
497
|
+
path: toc.yaml
|
|
498
|
+
"
|
|
499
|
+
`;
|
|
500
|
+
|
|
231
501
|
exports[`Merge includes (md2md) > inline-context: non-standalone includes use fallback > filelist 1`] = `
|
|
232
502
|
"[
|
|
233
503
|
"index.md",
|
|
@@ -605,6 +875,67 @@ path: toc.yaml
|
|
|
605
875
|
"
|
|
606
876
|
`;
|
|
607
877
|
|
|
878
|
+
exports[`Merge includes (md2md) > yfm-table: include ending with HTML block places || on its own line > filelist 1`] = `
|
|
879
|
+
"[
|
|
880
|
+
"index.md",
|
|
881
|
+
"main.md",
|
|
882
|
+
"toc.yaml"
|
|
883
|
+
]"
|
|
884
|
+
`;
|
|
885
|
+
|
|
886
|
+
exports[`Merge includes (md2md) > yfm-table: include ending with HTML block places || on its own line 1`] = `
|
|
887
|
+
"---
|
|
888
|
+
metadata:
|
|
889
|
+
- name: generator
|
|
890
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
891
|
+
vcsPath: index.md
|
|
892
|
+
---
|
|
893
|
+
# Index
|
|
894
|
+
|
|
895
|
+
Welcome page.
|
|
896
|
+
"
|
|
897
|
+
`;
|
|
898
|
+
|
|
899
|
+
exports[`Merge includes (md2md) > yfm-table: include ending with HTML block places || on its own line 2`] = `
|
|
900
|
+
"---
|
|
901
|
+
metadata:
|
|
902
|
+
- name: generator
|
|
903
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
904
|
+
vcsPath: main.md
|
|
905
|
+
---
|
|
906
|
+
# Main Document
|
|
907
|
+
|
|
908
|
+
#|
|
|
909
|
+
|| **Option** | **Details** ||
|
|
910
|
+
|| Option A |
|
|
911
|
+
Some description of option A.
|
|
912
|
+
|
|
913
|
+
[Subscribe](https://example.com/subscribe){.button}
|
|
914
|
+
|
|
915
|
+
<style>
|
|
916
|
+
a.button {
|
|
917
|
+
color: black;
|
|
918
|
+
background: yellow;
|
|
919
|
+
}
|
|
920
|
+
</style>
|
|
921
|
+
||
|
|
922
|
+
|| Option B | Plain text cell. ||
|
|
923
|
+
|#
|
|
924
|
+
|
|
925
|
+
Content after table.
|
|
926
|
+
"
|
|
927
|
+
`;
|
|
928
|
+
|
|
929
|
+
exports[`Merge includes (md2md) > yfm-table: include ending with HTML block places || on its own line 3`] = `
|
|
930
|
+
"title: Merge Includes YFM Table HTML Block
|
|
931
|
+
href: index.md
|
|
932
|
+
items:
|
|
933
|
+
- name: Main
|
|
934
|
+
href: main.md
|
|
935
|
+
path: toc.yaml
|
|
936
|
+
"
|
|
937
|
+
`;
|
|
938
|
+
|
|
608
939
|
exports[`Merge includes (md2md) > yfm-table: include followed by || separator is inlined > filelist 1`] = `
|
|
609
940
|
"[
|
|
610
941
|
"index.md",
|
|
@@ -640,7 +971,8 @@ vcsPath: main.md
|
|
|
640
971
|
|| Option A |
|
|
641
972
|
Some description of option A.
|
|
642
973
|
|
|
643
|
-
Buy now at [our store](https://example.com/store)
|
|
974
|
+
Buy now at [our store](https://example.com/store).
|
|
975
|
+
||
|
|
644
976
|
|| Option B | Plain text cell. ||
|
|
645
977
|
|#
|
|
646
978
|
|
|
@@ -657,3 +989,70 @@ items:
|
|
|
657
989
|
path: toc.yaml
|
|
658
990
|
"
|
|
659
991
|
`;
|
|
992
|
+
|
|
993
|
+
exports[`Merge includes (md2md) > yfm-table: include with \`|\` in inline code falls back to {% included %} > filelist 1`] = `
|
|
994
|
+
"[
|
|
995
|
+
"index.md",
|
|
996
|
+
"main.md",
|
|
997
|
+
"toc.yaml"
|
|
998
|
+
]"
|
|
999
|
+
`;
|
|
1000
|
+
|
|
1001
|
+
exports[`Merge includes (md2md) > yfm-table: include with \`|\` in inline code falls back to {% included %} 1`] = `
|
|
1002
|
+
"---
|
|
1003
|
+
metadata:
|
|
1004
|
+
- name: generator
|
|
1005
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
1006
|
+
vcsPath: index.md
|
|
1007
|
+
---
|
|
1008
|
+
# Index
|
|
1009
|
+
|
|
1010
|
+
Welcome page.
|
|
1011
|
+
"
|
|
1012
|
+
`;
|
|
1013
|
+
|
|
1014
|
+
exports[`Merge includes (md2md) > yfm-table: include with \`|\` in inline code falls back to {% included %} 2`] = `
|
|
1015
|
+
"---
|
|
1016
|
+
metadata:
|
|
1017
|
+
- name: generator
|
|
1018
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
1019
|
+
vcsPath: main.md
|
|
1020
|
+
---
|
|
1021
|
+
# Main Document
|
|
1022
|
+
|
|
1023
|
+
#|
|
|
1024
|
+
||
|
|
1025
|
+
**Criterion**
|
|
1026
|
+
|
|
|
1027
|
+
**Description**
|
|
1028
|
+
||
|
|
1029
|
+
||
|
|
1030
|
+
**regular expression**
|
|
1031
|
+
|
|
|
1032
|
+
This is used for tracking goal identifiers that match a pattern.
|
|
1033
|
+
|
|
1034
|
+
{% cut "Example" %}
|
|
1035
|
+
|
|
1036
|
+
{% include [example](_includes/example.md) %}
|
|
1037
|
+
|
|
1038
|
+
{% endcut %}
|
|
1039
|
+
||
|
|
1040
|
+
|#
|
|
1041
|
+
|
|
1042
|
+
Content after table.
|
|
1043
|
+
|
|
1044
|
+
{% included (_includes/example.md) %}
|
|
1045
|
+
If you want to track clicking a particular button with the ID that contains \`button\` or \`buy\`, you can specify the following condition: \`button|buy\`.
|
|
1046
|
+
|
|
1047
|
+
{% endincluded %}"
|
|
1048
|
+
`;
|
|
1049
|
+
|
|
1050
|
+
exports[`Merge includes (md2md) > yfm-table: include with \`|\` in inline code falls back to {% included %} 3`] = `
|
|
1051
|
+
"title: Merge Includes YFM Table Pipe In Content
|
|
1052
|
+
href: index.md
|
|
1053
|
+
items:
|
|
1054
|
+
- name: Main
|
|
1055
|
+
href: main.md
|
|
1056
|
+
path: toc.yaml
|
|
1057
|
+
"
|
|
1058
|
+
`;
|