@diplodoc/cli-tests 5.4.0 → 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__/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/fixtures/runners/types.ts +1 -2
- package/fixtures/utils/test.ts +4 -1
- 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",
|
|
@@ -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/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
|
|