@diplodoc/cli-tests 5.4.1 → 5.5.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__/load-custom-resources.spec.ts.snap +0 -2
- package/e2e/__snapshots__/metadata.spec.ts.snap +0 -1
- package/e2e/__snapshots__/preprocess.test.ts.snap +29 -6
- package/e2e/__snapshots__/regression.test.ts.snap +6 -5
- package/e2e/__snapshots__/rtl.spec.ts.snap +0 -2
- package/e2e/__snapshots__/search.test.ts.snap +25 -11
- package/e2e/errors.spec.ts +1 -1
- package/fixtures/runners/types.ts +1 -2
- package/fixtures/utils/test.ts +4 -1
- package/mocks/preprocess/test2/input/includes/deepWithIndent.md +6 -0
- package/mocks/preprocess/test2/input/includes/sub/userWithIndent.md +5 -0
- package/mocks/preprocess/test2/input/includes.md +4 -0
- package/mocks/regression/input/images.md +2 -0
- package/mocks/regression/input/includes/deep.md +2 -0
- package/mocks/regression/input/includes/presets.yaml +1 -0
- package/mocks/regression/input/presets.yaml +1 -0
- package/mocks/search/input/.yfm +12 -0
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ exports[`Allow load custom resources > md2html single page with custom resources
|
|
|
5
5
|
".yfm",
|
|
6
6
|
"_assets/script/test1.js",
|
|
7
7
|
"_assets/style/test.css",
|
|
8
|
-
"_bundle/search-async-1",
|
|
9
8
|
"_bundle/search-async-0",
|
|
10
9
|
"_bundle/app-css-1",
|
|
11
10
|
"_bundle/app-js-1",
|
|
@@ -213,7 +212,6 @@ exports[`Allow load custom resources > md2html with custom resources > filelist
|
|
|
213
212
|
".yfm",
|
|
214
213
|
"_assets/script/test1.js",
|
|
215
214
|
"_assets/style/test.css",
|
|
216
|
-
"_bundle/search-async-1",
|
|
217
215
|
"_bundle/search-async-0",
|
|
218
216
|
"_bundle/app-css-1",
|
|
219
217
|
"_bundle/app-js-1",
|
|
@@ -258,7 +258,9 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true > filelist 1`] = `
|
|
|
258
258
|
"included-item.md",
|
|
259
259
|
"includes.md",
|
|
260
260
|
"includes/deep-hash.md",
|
|
261
|
+
"includes/deepWithIndent-hash.md",
|
|
261
262
|
"includes/sub/user-hash.md",
|
|
263
|
+
"includes/sub/userWithIndent-hash.md",
|
|
262
264
|
"includes/test-hash.md",
|
|
263
265
|
"includes/user-hash.md",
|
|
264
266
|
"latex.md",
|
|
@@ -397,6 +399,10 @@ Link after include
|
|
|
397
399
|
<!--{% include [For includes/deep.md](includes/deep.md) %}-->
|
|
398
400
|
{% include [For includes/deep-hash.md](includes/deep-hash.md) %}
|
|
399
401
|
|
|
402
|
+
Include with big indent
|
|
403
|
+
|
|
404
|
+
{% include [For includes/deep.md](includes/deepWithIndent-hash.md) %}
|
|
405
|
+
|
|
400
406
|
Link after include
|
|
401
407
|
[Subtitle](./1.md#subtitle)
|
|
402
408
|
"
|
|
@@ -408,21 +414,38 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true 7`] = `
|
|
|
408
414
|
`;
|
|
409
415
|
|
|
410
416
|
exports[`Preprocess > HashIncludes=true,Autotitles=true 8`] = `
|
|
417
|
+
"- list item
|
|
418
|
+
|
|
419
|
+
{% include [user](./sub/userWithIndent-hash.md) %}
|
|
420
|
+
|
|
421
|
+
Link to mermaid diagram from 1 level
|
|
422
|
+
[Mermaid usage](../mermaid.md)"
|
|
423
|
+
`;
|
|
424
|
+
|
|
425
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 9`] = `
|
|
411
426
|
"Bob
|
|
412
427
|
"
|
|
413
428
|
`;
|
|
414
429
|
|
|
415
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
430
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 10`] = `
|
|
431
|
+
"Link to mermaid diagram from 2 level
|
|
432
|
+
[Mermaid usage](../../mermaid.md)
|
|
433
|
+
|
|
434
|
+
- User
|
|
435
|
+
Bob"
|
|
436
|
+
`;
|
|
437
|
+
|
|
438
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 11`] = `
|
|
416
439
|
"Test
|
|
417
440
|
"
|
|
418
441
|
`;
|
|
419
442
|
|
|
420
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
443
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 12`] = `
|
|
421
444
|
"Bob
|
|
422
445
|
"
|
|
423
446
|
`;
|
|
424
447
|
|
|
425
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
448
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 13`] = `
|
|
426
449
|
"---
|
|
427
450
|
metadata:
|
|
428
451
|
- name: generator
|
|
@@ -434,7 +457,7 @@ $/sqrt{3x-1}+(1+x)^2$
|
|
|
434
457
|
"
|
|
435
458
|
`;
|
|
436
459
|
|
|
437
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
460
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 14`] = `
|
|
438
461
|
"---
|
|
439
462
|
metadata:
|
|
440
463
|
- name: generator
|
|
@@ -456,7 +479,7 @@ Some mermaid info
|
|
|
456
479
|
"
|
|
457
480
|
`;
|
|
458
481
|
|
|
459
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
482
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 15`] = `
|
|
460
483
|
"---
|
|
461
484
|
metadata:
|
|
462
485
|
- name: generator
|
|
@@ -470,7 +493,7 @@ Item 1 text
|
|
|
470
493
|
"
|
|
471
494
|
`;
|
|
472
495
|
|
|
473
|
-
exports[`Preprocess > HashIncludes=true,Autotitles=true
|
|
496
|
+
exports[`Preprocess > HashIncludes=true,Autotitles=true 16`] = `
|
|
474
497
|
"items:
|
|
475
498
|
- name: Md item with not_var syntax
|
|
476
499
|
href: 1.md
|
|
@@ -45,7 +45,6 @@ exports[`Regression > internal > filelist 2`] = `
|
|
|
45
45
|
"_assets/3.png",
|
|
46
46
|
"_assets/5_1.png",
|
|
47
47
|
"_assets/empty.pdf",
|
|
48
|
-
"_bundle/search-async-1",
|
|
49
48
|
"_bundle/search-async-0",
|
|
50
49
|
"_bundle/app-css-1",
|
|
51
50
|
"_bundle/app-js-1",
|
|
@@ -237,7 +236,8 @@ metadata:
|
|
|
237
236
|
<!--  -->
|
|
238
237
|
|
|
239
238
|

|
|
240
|
-
|
|
239
|
+
|
|
240
|
+
[](latex.md)"
|
|
241
241
|
`;
|
|
242
242
|
|
|
243
243
|
exports[`Regression > internal 10`] = `
|
|
@@ -286,7 +286,8 @@ Link after include
|
|
|
286
286
|
|
|
287
287
|
exports[`Regression > internal 12`] = `
|
|
288
288
|
"{% include [user](./user-hash.md) %}
|
|
289
|
-
|
|
289
|
+
|
|
290
|
+
[](../latex.md)"
|
|
290
291
|
`;
|
|
291
292
|
|
|
292
293
|
exports[`Regression > internal 13`] = `
|
|
@@ -969,7 +970,7 @@ exports[`Regression > internal 36`] = `
|
|
|
969
970
|
<body class="g-root g-root_theme_light">
|
|
970
971
|
<div id="root"></div>
|
|
971
972
|
<script type="application/json" id="diplodoc-state">
|
|
972
|
-
{"data":{"leading":false,"html":"<p><img src=\\"_assets/1.png\\" alt=\\"simple image\\" /></p>/n/n<p><img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /></p>/n/n<p><img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Images"},"router":{"pathname":"images","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{}}
|
|
973
|
+
{"data":{"leading":false,"html":"<p><img src=\\"_assets/1.png\\" alt=\\"simple image\\" /></p>/n/n<p><img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /></p>/n/n<p><img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /></p>/n<p><a href=\\"latex.html\\"><img src=\\"_assets/3.png\\" alt=\\"img 3\\" /></a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Images"},"router":{"pathname":"images","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{}}
|
|
973
974
|
</script>
|
|
974
975
|
<script type="application/javascript">
|
|
975
976
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -1043,7 +1044,7 @@ exports[`Regression > internal 38`] = `
|
|
|
1043
1044
|
<body class="g-root g-root_theme_light">
|
|
1044
1045
|
<div id="root"></div>
|
|
1045
1046
|
<script type="application/json" id="diplodoc-state">
|
|
1046
|
-
{"data":{"leading":false,"html":"<p>Text</p>/n<p>Bob</p>/n<p>Test</p>/n/n<p>Bob</p>/n<p>Link after include<br />/n<a href=\\"1.html#subtitle\\">Subtitle</a></p>/n<p>Link after include</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":""},"router":{"pathname":"includes","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{}}
|
|
1047
|
+
{"data":{"leading":false,"html":"<p>Text</p>/n<p>Bob</p>/n<p>Test</p>/n/n<p>Bob</p>/n<p><a href=\\"../latex.html\\"><img src=\\"_assets/3.png\\" alt=\\"img 3\\" /></a></p>/n<p>Link after include<br />/n<a href=\\"1.html#subtitle\\">Subtitle</a></p>/n<p>Link after include</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":""},"router":{"pathname":"includes","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{}}
|
|
1047
1048
|
</script>
|
|
1048
1049
|
<script type="application/javascript">
|
|
1049
1050
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
exports[`Generate html document with correct lang and dir attributes. Load correct bundles. > documentation with only one rtl lang > filelist 1`] = `
|
|
4
4
|
"[
|
|
5
5
|
".yfm",
|
|
6
|
-
"_bundle/search-async-1",
|
|
7
6
|
"_bundle/search-async-0",
|
|
8
7
|
"_bundle/app-css-1",
|
|
9
8
|
"_bundle/app-js-1",
|
|
@@ -107,7 +106,6 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
107
106
|
exports[`Generate html document with correct lang and dir attributes. Load correct bundles. > documentation with rtl and ltr langs > filelist 1`] = `
|
|
108
107
|
"[
|
|
109
108
|
".yfm",
|
|
110
|
-
"_bundle/search-async-1",
|
|
111
109
|
"_bundle/search-async-0",
|
|
112
110
|
"_bundle/app-css-1",
|
|
113
111
|
"_bundle/app-js-1",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Local search > internal > filelist 1`] = `
|
|
4
4
|
"[
|
|
5
|
-
"
|
|
5
|
+
".yfm",
|
|
6
6
|
"_bundle/search-async-0",
|
|
7
7
|
"_bundle/app-css-1",
|
|
8
8
|
"_bundle/app-js-1",
|
|
@@ -20,19 +20,33 @@ exports[`Local search > internal > filelist 1`] = `
|
|
|
20
20
|
"_bundle/search-js-2",
|
|
21
21
|
"_bundle/search-css-2",
|
|
22
22
|
"_search/api.js",
|
|
23
|
-
"_search/
|
|
24
|
-
"_search/
|
|
25
|
-
"_search/
|
|
26
|
-
"_search/
|
|
27
|
-
"_search/ru/language.js",
|
|
23
|
+
"_search/en/hash-resources.js",
|
|
24
|
+
"_search/en/hash-index.js",
|
|
25
|
+
"_search/en/hash-registry.js",
|
|
26
|
+
"_search/en/index.html",
|
|
28
27
|
"index.html",
|
|
29
28
|
"toc.js"
|
|
30
29
|
]"
|
|
31
30
|
`;
|
|
32
31
|
|
|
33
32
|
exports[`Local search > internal 1`] = `
|
|
33
|
+
"allowHTML: true
|
|
34
|
+
langs: ['en','ru']
|
|
35
|
+
|
|
36
|
+
interface:
|
|
37
|
+
toc-header: false
|
|
38
|
+
favicon-src: https://storage.yandexcloud.net/diplodoc-www-assets/favicon/favicon.ico
|
|
39
|
+
|
|
40
|
+
search:
|
|
41
|
+
provider: local
|
|
42
|
+
tolerance: 2
|
|
43
|
+
confidense: phrased
|
|
44
|
+
"
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`Local search > internal 2`] = `
|
|
34
48
|
"<!DOCTYPE html>
|
|
35
|
-
<html lang="
|
|
49
|
+
<html lang="en" dir="ltr">
|
|
36
50
|
<head>
|
|
37
51
|
<meta charset="utf-8">
|
|
38
52
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -41,7 +55,7 @@ exports[`Local search > internal 1`] = `
|
|
|
41
55
|
<meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
|
|
42
56
|
|
|
43
57
|
<style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
|
|
44
|
-
|
|
58
|
+
<link rel="icon" type="image/x-icon" href="https://storage.yandexcloud.net/diplodoc-www-assets/favicon/favicon.ico">
|
|
45
59
|
|
|
46
60
|
<link type="text/css" rel="stylesheet" href="_bundle/search-css-1"/>
|
|
47
61
|
<link type="text/css" rel="stylesheet" href="_bundle/app-css-1"/>
|
|
@@ -49,7 +63,7 @@ exports[`Local search > internal 1`] = `
|
|
|
49
63
|
<body class="g-root g-root_theme_light">
|
|
50
64
|
<div id="root"></div>
|
|
51
65
|
<script type="application/json" id="diplodoc-state">
|
|
52
|
-
{"data":{"leading":false,"html":"<p>Content</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Header"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"
|
|
66
|
+
{"data":{"leading":false,"html":"<p>Content</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Header"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc-header":false,"favicon-src":"https://storage.yandexcloud.net/diplodoc-www-assets/favicon/favicon.ico"},"search":{"provider":"local","tolerance":2,"confidense":"phrased","enabled":true,"api":"_search/api.js","link":"_search/en/index.html"}}
|
|
53
67
|
</script>
|
|
54
68
|
<script type="application/javascript">
|
|
55
69
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -59,7 +73,7 @@ exports[`Local search > internal 1`] = `
|
|
|
59
73
|
window.STATIC_CONTENT = false;
|
|
60
74
|
</script>
|
|
61
75
|
<script type="application/javascript" defer src="toc.js"></script>
|
|
62
|
-
<script type="application/javascript" defer src="_search/
|
|
76
|
+
<script type="application/javascript" defer src="_search/en/hash-resources.js"></script>
|
|
63
77
|
<script type="application/javascript" defer src="_bundle/search-js-0"></script>
|
|
64
78
|
<script type="application/javascript" defer src="_bundle/app-js-1"></script>
|
|
65
79
|
<script type="application/javascript" defer src="_bundle/search-js-2"></script>
|
|
@@ -68,4 +82,4 @@ exports[`Local search > internal 1`] = `
|
|
|
68
82
|
</html>"
|
|
69
83
|
`;
|
|
70
84
|
|
|
71
|
-
exports[`Local search > internal
|
|
85
|
+
exports[`Local search > internal 3`] = `"window.__DATA__.data.toc = {"href":"index.html","path":"toc.yaml","id":"UUID"};"`;
|
package/e2e/errors.spec.ts
CHANGED
|
@@ -13,7 +13,7 @@ function test(path: string, expect: Function) {
|
|
|
13
13
|
const {inputPath, outputPath} = getTestPaths(path);
|
|
14
14
|
|
|
15
15
|
const md = await TestAdapter.build.run(inputPath, outputPath, ['-j2', '-f', 'md']);
|
|
16
|
-
const html = await TestAdapter.build.run(
|
|
16
|
+
const html = await TestAdapter.build.run(inputPath, outputPath + '-html', ['-j2', '-f', 'html']);
|
|
17
17
|
|
|
18
18
|
return expect({md, html});
|
|
19
19
|
});
|
package/fixtures/utils/test.ts
CHANGED
|
@@ -4,7 +4,10 @@ export function platformless(text: string): string {
|
|
|
4
4
|
return hashless(text)
|
|
5
5
|
.replace(/\r\n/g, '\n')
|
|
6
6
|
.replace(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/g, 'UUID')
|
|
7
|
-
.replace(
|
|
7
|
+
.replace(
|
|
8
|
+
/(content"?[:=]{1}[" ]{1}Diplodoc.*? )v\d+\.\d+\.\d+(?:-[\w-]+)?/g,
|
|
9
|
+
`$1vDIPLODOC-VERSION`,
|
|
10
|
+
)
|
|
8
11
|
.replace(/(\\(?![/"'])){1,2}/g, '/');
|
|
9
12
|
}
|
|
10
13
|
|
|
@@ -10,5 +10,9 @@ Link after include
|
|
|
10
10
|
<!--{% include [For includes/deep.md](includes/deep.md) %}-->
|
|
11
11
|
{% include [For includes/deep.md](includes/deep.md) %}
|
|
12
12
|
|
|
13
|
+
Include with big indent
|
|
14
|
+
|
|
15
|
+
{% include [For includes/deep.md](includes/deepWithIndent.md) %}
|
|
16
|
+
|
|
13
17
|
Link after include
|
|
14
18
|
[{#T}](./1.md#subtitle)
|