@diplodoc/cli-tests 5.36.5 → 5.37.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 +108 -1
- package/e2e/__snapshots__/neuro-expert.test.ts.snap +152 -0
- package/e2e/include-toc.test.ts +6 -0
- package/mocks/include-toc/test10/input/test/index.md +4 -0
- package/mocks/include-toc/test10/input/test/sub/index.md +1 -0
- package/mocks/include-toc/test10/input/test/sub/sub/sub-3.md +1 -0
- package/mocks/include-toc/test10/input/test/sub/sub-1.md +5 -0
- package/mocks/include-toc/test10/input/test/sub/sub-2.md +1 -0
- package/mocks/include-toc/test10/input/test/test.md +1 -0
- package/mocks/include-toc/test10/input/toc.yaml +9 -0
- package/package.json +1 -1
|
@@ -598,6 +598,7 @@ items:
|
|
|
598
598
|
- name: index
|
|
599
599
|
href: test/index.md
|
|
600
600
|
- name: sub
|
|
601
|
+
href: test/sub/index.md
|
|
601
602
|
items:
|
|
602
603
|
- name: sub-2
|
|
603
604
|
href: test/sub/sub-2.md
|
|
@@ -607,7 +608,6 @@ items:
|
|
|
607
608
|
items:
|
|
608
609
|
- name: sub-3
|
|
609
610
|
href: test/sub/sub/sub-3.md
|
|
610
|
-
href: test/sub/index.md
|
|
611
611
|
path: toc.yaml
|
|
612
612
|
"
|
|
613
613
|
`;
|
|
@@ -715,3 +715,110 @@ items:
|
|
|
715
715
|
path: toc.yaml
|
|
716
716
|
"
|
|
717
717
|
`;
|
|
718
|
+
|
|
719
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory > filelist 1`] = `
|
|
720
|
+
"[
|
|
721
|
+
"test/index.md",
|
|
722
|
+
"test/sub/index.md",
|
|
723
|
+
"test/sub/sub-1.md",
|
|
724
|
+
"test/sub/sub-2.md",
|
|
725
|
+
"test/sub/sub/sub-3.md",
|
|
726
|
+
"test/test.md",
|
|
727
|
+
"toc.yaml"
|
|
728
|
+
]"
|
|
729
|
+
`;
|
|
730
|
+
|
|
731
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 1`] = `
|
|
732
|
+
"---
|
|
733
|
+
metadata:
|
|
734
|
+
- name: generator
|
|
735
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
736
|
+
vcsPath: test/index.md
|
|
737
|
+
---
|
|
738
|
+
# Root index
|
|
739
|
+
|
|
740
|
+
[same level link](./test.md)
|
|
741
|
+
[inner link](./sub/sub-1.md)
|
|
742
|
+
"
|
|
743
|
+
`;
|
|
744
|
+
|
|
745
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 2`] = `
|
|
746
|
+
"---
|
|
747
|
+
metadata:
|
|
748
|
+
- name: generator
|
|
749
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
750
|
+
vcsPath: test/sub/index.md
|
|
751
|
+
---
|
|
752
|
+
# Sub section
|
|
753
|
+
"
|
|
754
|
+
`;
|
|
755
|
+
|
|
756
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 3`] = `
|
|
757
|
+
"---
|
|
758
|
+
metadata:
|
|
759
|
+
- name: generator
|
|
760
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
761
|
+
vcsPath: test/sub/sub-1.md
|
|
762
|
+
---
|
|
763
|
+
# Sub one
|
|
764
|
+
|
|
765
|
+
[same level link](./sub-2.md)
|
|
766
|
+
[outer link](../test.md)
|
|
767
|
+
[inner link](./sub/sub-3.md)
|
|
768
|
+
"
|
|
769
|
+
`;
|
|
770
|
+
|
|
771
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 4`] = `
|
|
772
|
+
"---
|
|
773
|
+
metadata:
|
|
774
|
+
- name: generator
|
|
775
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
776
|
+
vcsPath: test/sub/sub-2.md
|
|
777
|
+
---
|
|
778
|
+
# Sub two
|
|
779
|
+
"
|
|
780
|
+
`;
|
|
781
|
+
|
|
782
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 5`] = `
|
|
783
|
+
"---
|
|
784
|
+
metadata:
|
|
785
|
+
- name: generator
|
|
786
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
787
|
+
vcsPath: test/sub/sub/sub-3.md
|
|
788
|
+
---
|
|
789
|
+
# Sub three
|
|
790
|
+
"
|
|
791
|
+
`;
|
|
792
|
+
|
|
793
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 6`] = `
|
|
794
|
+
"---
|
|
795
|
+
metadata:
|
|
796
|
+
- name: generator
|
|
797
|
+
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
798
|
+
vcsPath: test/test.md
|
|
799
|
+
---
|
|
800
|
+
# Test page
|
|
801
|
+
"
|
|
802
|
+
`;
|
|
803
|
+
|
|
804
|
+
exports[`Include toc > Toc with generic includer linkIndexAutotitle uses index.md heading for directory 7`] = `
|
|
805
|
+
"title: main
|
|
806
|
+
items:
|
|
807
|
+
- name: Test page
|
|
808
|
+
href: test/test.md
|
|
809
|
+
- name: Root index
|
|
810
|
+
href: test/index.md
|
|
811
|
+
- href: test/sub/index.md
|
|
812
|
+
items:
|
|
813
|
+
- name: Sub two
|
|
814
|
+
href: test/sub/sub-2.md
|
|
815
|
+
- name: Sub one
|
|
816
|
+
href: test/sub/sub-1.md
|
|
817
|
+
- name: sub
|
|
818
|
+
items:
|
|
819
|
+
- name: Sub three
|
|
820
|
+
href: test/sub/sub/sub-3.md
|
|
821
|
+
name: Sub section
|
|
822
|
+
path: toc.yaml
|
|
823
|
+
"
|
|
824
|
+
`;
|
|
@@ -262,6 +262,44 @@ exports[`Neuro-expert > Neuro-expert 9`] = `
|
|
|
262
262
|
tryAppend();
|
|
263
263
|
};
|
|
264
264
|
document.body.appendChild(neuroExpertScript);
|
|
265
|
+
(function() {
|
|
266
|
+
var neuroExpertMetrikaIds = [];
|
|
267
|
+
var neuroExpertInitType = "widget";
|
|
268
|
+
var iframeActionMap = {
|
|
269
|
+
"message-sent": "message"
|
|
270
|
+
};
|
|
271
|
+
function sendNeuroExpertGoal(action) {
|
|
272
|
+
if (typeof ym === "undefined" || !neuroExpertMetrikaIds.length) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
var params = {
|
|
276
|
+
action: action,
|
|
277
|
+
initType: neuroExpertInitType
|
|
278
|
+
};
|
|
279
|
+
for (var i = 0; i < neuroExpertMetrikaIds.length; i++) {
|
|
280
|
+
ym(neuroExpertMetrikaIds[i], "reachGoal", "DOCS_NEUROEXPERT_ACTION", params);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
neuroExpertDiv.addEventListener("click", function(e) {
|
|
284
|
+
if (e.target.closest(".toggle-button")) {
|
|
285
|
+
requestAnimationFrame(function() {
|
|
286
|
+
var widgetPanel = neuroExpertDiv.querySelector(".widget");
|
|
287
|
+
if (widgetPanel && widgetPanel.classList.contains("visible")) {
|
|
288
|
+
sendNeuroExpertGoal("open");
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
window.addEventListener("message", function(event) {
|
|
294
|
+
if (event.origin !== "https://expert.yandex.ru") {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
var action = iframeActionMap[event.data && event.data.type];
|
|
298
|
+
if (action) {
|
|
299
|
+
sendNeuroExpertGoal(action);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
})();
|
|
265
303
|
</script>
|
|
266
304
|
</body>
|
|
267
305
|
</html>"
|
|
@@ -315,6 +353,44 @@ exports[`Neuro-expert > Neuro-expert 10`] = `
|
|
|
315
353
|
tryAppend();
|
|
316
354
|
};
|
|
317
355
|
document.body.appendChild(neuroExpertScript);
|
|
356
|
+
(function() {
|
|
357
|
+
var neuroExpertMetrikaIds = [];
|
|
358
|
+
var neuroExpertInitType = "widget";
|
|
359
|
+
var iframeActionMap = {
|
|
360
|
+
"message-sent": "message"
|
|
361
|
+
};
|
|
362
|
+
function sendNeuroExpertGoal(action) {
|
|
363
|
+
if (typeof ym === "undefined" || !neuroExpertMetrikaIds.length) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
var params = {
|
|
367
|
+
action: action,
|
|
368
|
+
initType: neuroExpertInitType
|
|
369
|
+
};
|
|
370
|
+
for (var i = 0; i < neuroExpertMetrikaIds.length; i++) {
|
|
371
|
+
ym(neuroExpertMetrikaIds[i], "reachGoal", "DOCS_NEUROEXPERT_ACTION", params);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
neuroExpertDiv.addEventListener("click", function(e) {
|
|
375
|
+
if (e.target.closest(".toggle-button")) {
|
|
376
|
+
requestAnimationFrame(function() {
|
|
377
|
+
var widgetPanel = neuroExpertDiv.querySelector(".widget");
|
|
378
|
+
if (widgetPanel && widgetPanel.classList.contains("visible")) {
|
|
379
|
+
sendNeuroExpertGoal("open");
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
window.addEventListener("message", function(event) {
|
|
385
|
+
if (event.origin !== "https://expert.yandex.ru") {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
var action = iframeActionMap[event.data && event.data.type];
|
|
389
|
+
if (action) {
|
|
390
|
+
sendNeuroExpertGoal(action);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
})();
|
|
318
394
|
</script>
|
|
319
395
|
</body>
|
|
320
396
|
</html>"
|
|
@@ -368,6 +444,44 @@ exports[`Neuro-expert > Neuro-expert 11`] = `
|
|
|
368
444
|
tryAppend();
|
|
369
445
|
};
|
|
370
446
|
document.body.appendChild(neuroExpertScript);
|
|
447
|
+
(function() {
|
|
448
|
+
var neuroExpertMetrikaIds = [];
|
|
449
|
+
var neuroExpertInitType = "widget";
|
|
450
|
+
var iframeActionMap = {
|
|
451
|
+
"message-sent": "message"
|
|
452
|
+
};
|
|
453
|
+
function sendNeuroExpertGoal(action) {
|
|
454
|
+
if (typeof ym === "undefined" || !neuroExpertMetrikaIds.length) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
var params = {
|
|
458
|
+
action: action,
|
|
459
|
+
initType: neuroExpertInitType
|
|
460
|
+
};
|
|
461
|
+
for (var i = 0; i < neuroExpertMetrikaIds.length; i++) {
|
|
462
|
+
ym(neuroExpertMetrikaIds[i], "reachGoal", "DOCS_NEUROEXPERT_ACTION", params);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
neuroExpertDiv.addEventListener("click", function(e) {
|
|
466
|
+
if (e.target.closest(".toggle-button")) {
|
|
467
|
+
requestAnimationFrame(function() {
|
|
468
|
+
var widgetPanel = neuroExpertDiv.querySelector(".widget");
|
|
469
|
+
if (widgetPanel && widgetPanel.classList.contains("visible")) {
|
|
470
|
+
sendNeuroExpertGoal("open");
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
window.addEventListener("message", function(event) {
|
|
476
|
+
if (event.origin !== "https://expert.yandex.ru") {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
var action = iframeActionMap[event.data && event.data.type];
|
|
480
|
+
if (action) {
|
|
481
|
+
sendNeuroExpertGoal(action);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
})();
|
|
371
485
|
</script>
|
|
372
486
|
</body>
|
|
373
487
|
</html>"
|
|
@@ -421,6 +535,44 @@ exports[`Neuro-expert > Neuro-expert 12`] = `
|
|
|
421
535
|
tryAppend();
|
|
422
536
|
};
|
|
423
537
|
document.body.appendChild(neuroExpertScript);
|
|
538
|
+
(function() {
|
|
539
|
+
var neuroExpertMetrikaIds = [];
|
|
540
|
+
var neuroExpertInitType = "widget";
|
|
541
|
+
var iframeActionMap = {
|
|
542
|
+
"message-sent": "message"
|
|
543
|
+
};
|
|
544
|
+
function sendNeuroExpertGoal(action) {
|
|
545
|
+
if (typeof ym === "undefined" || !neuroExpertMetrikaIds.length) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
var params = {
|
|
549
|
+
action: action,
|
|
550
|
+
initType: neuroExpertInitType
|
|
551
|
+
};
|
|
552
|
+
for (var i = 0; i < neuroExpertMetrikaIds.length; i++) {
|
|
553
|
+
ym(neuroExpertMetrikaIds[i], "reachGoal", "DOCS_NEUROEXPERT_ACTION", params);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
neuroExpertDiv.addEventListener("click", function(e) {
|
|
557
|
+
if (e.target.closest(".toggle-button")) {
|
|
558
|
+
requestAnimationFrame(function() {
|
|
559
|
+
var widgetPanel = neuroExpertDiv.querySelector(".widget");
|
|
560
|
+
if (widgetPanel && widgetPanel.classList.contains("visible")) {
|
|
561
|
+
sendNeuroExpertGoal("open");
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
window.addEventListener("message", function(event) {
|
|
567
|
+
if (event.origin !== "https://expert.yandex.ru") {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
var action = iframeActionMap[event.data && event.data.type];
|
|
571
|
+
if (action) {
|
|
572
|
+
sendNeuroExpertGoal(action);
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
})();
|
|
424
576
|
</script>
|
|
425
577
|
</body>
|
|
426
578
|
</html>"
|
package/e2e/include-toc.test.ts
CHANGED
|
@@ -64,4 +64,10 @@ describe('Include toc', () => {
|
|
|
64
64
|
await TestAdapter.testBuildPass(inputPath, outputPath);
|
|
65
65
|
await compareDirectories(outputPath);
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
test('Toc with generic includer linkIndexAutotitle uses index.md heading for directory', async () => {
|
|
69
|
+
const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test10');
|
|
70
|
+
await TestAdapter.testBuildPass(inputPath, outputPath);
|
|
71
|
+
await compareDirectories(outputPath);
|
|
72
|
+
});
|
|
67
73
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Sub section
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Sub three
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Sub two
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Test page
|