@diplodoc/cli-tests 0.0.0-rc-disable-resolve-codeblock-17941220955 → 0.0.0-rc-fix-manifest-18002055289
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__/alternates.test.ts.snap +40 -43
- package/e2e/__snapshots__/bundles.spec.ts.snap +3 -3
- package/e2e/__snapshots__/include-toc.test.ts.snap +28 -20
- package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +10 -10
- package/e2e/__snapshots__/metadata.spec.ts.snap +7 -7
- package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
- package/e2e/__snapshots__/preprocess.test.ts.snap +291 -48
- package/e2e/__snapshots__/regression.test.ts.snap +49 -61
- package/e2e/__snapshots__/restricted-access.test.ts.snap +12 -13
- package/e2e/__snapshots__/rtl.spec.ts.snap +6 -6
- package/e2e/__snapshots__/search.test.ts.snap +1 -1
- package/e2e/__snapshots__/single-page.spec.ts.snap +3 -3
- package/e2e/__snapshots__/skip-html-extension.spec.ts.snap +4 -4
- package/e2e/__snapshots__/translation.spec.ts.snap +8 -12
- package/e2e/alternates.test.ts +1 -0
- package/e2e/bundles.spec.ts +1 -0
- package/e2e/errors.spec.ts +18 -8
- package/e2e/generate-map.spec.ts +6 -2
- package/e2e/include-toc.test.ts +1 -0
- package/e2e/load-custom-resources.spec.ts +1 -0
- package/e2e/metadata.spec.ts +1 -0
- package/e2e/plugin-corner-cases.spec.ts +1 -0
- package/e2e/preprocess.test.ts +8 -5
- package/e2e/redirects-validation.spec.ts +5 -4
- package/e2e/regression.test.ts +1 -0
- package/e2e/restricted-access.test.ts +3 -5
- package/e2e/rtl.spec.ts +1 -0
- package/e2e/search.test.ts +1 -0
- package/e2e/single-page.spec.ts +1 -0
- package/e2e/skip-html-extension.spec.ts +1 -0
- package/e2e/translation.spec.ts +17 -6
- package/fixtures/cliAdapter.ts +7 -3
- package/fixtures/globals.d.ts +1 -1
- package/fixtures/runners/binary.ts +5 -2
- package/fixtures/runners/index.ts +2 -1
- package/fixtures/runners/source.ts +1 -1
- package/fixtures/utils/file.ts +20 -16
- package/fixtures/utils/test.ts +19 -19
- package/mocks/preprocess/input/autotitle.md +3 -0
- package/mocks/preprocess/input/includes/level1.md +9 -0
- package/mocks/preprocess/input/includes/level11.md +1 -0
- package/mocks/preprocess/input/includes/sub/level2.md +7 -0
- package/mocks/preprocess/input/level0.md +7 -0
- package/mocks/preprocess/input/level1/level1.md +7 -0
- package/mocks/preprocess/input/level1/level2/level2.md +6 -0
- package/mocks/preprocess/input/level1/toc.yaml +5 -0
- package/mocks/preprocess/input/toc.yaml +8 -0
- package/package.json +1 -1
|
@@ -4,7 +4,8 @@ exports[`Restricted access > Nested restricted access > filelist 1`] = `
|
|
|
4
4
|
"[
|
|
5
5
|
"plugins/index.md",
|
|
6
6
|
"project/index.md",
|
|
7
|
-
"toc.yaml"
|
|
7
|
+
"toc.yaml",
|
|
8
|
+
"yfm-build-manifest.json"
|
|
8
9
|
]"
|
|
9
10
|
`;
|
|
10
11
|
|
|
@@ -19,7 +20,6 @@ restricted-access:
|
|
|
19
20
|
- - userA
|
|
20
21
|
- userB
|
|
21
22
|
vcsPath: plugins/index.md
|
|
22
|
-
sourcePath: plugins/index.md
|
|
23
23
|
---
|
|
24
24
|
"
|
|
25
25
|
`;
|
|
@@ -33,7 +33,6 @@ restricted-access:
|
|
|
33
33
|
- - userA
|
|
34
34
|
- userB
|
|
35
35
|
vcsPath: project/index.md
|
|
36
|
-
sourcePath: project/index.md
|
|
37
36
|
---
|
|
38
37
|
"
|
|
39
38
|
`;
|
|
@@ -62,12 +61,15 @@ path: toc.yaml
|
|
|
62
61
|
"
|
|
63
62
|
`;
|
|
64
63
|
|
|
64
|
+
exports[`Restricted access > Nested restricted access 4`] = `"{"redirects":{},"fileTrie":{"trie":{"plugins":{"children":{"index":{"file":{"ext":".md","toc":"t0"}}}},"project":{"children":{"index":{"file":{"ext":".md","toc":"t0"}}}}},"tocMapping":{"t0":"toc.yaml"}},"yfmConfig":{}}"`;
|
|
65
|
+
|
|
65
66
|
exports[`Restricted access > Nested toc restricted access > filelist 1`] = `
|
|
66
67
|
"[
|
|
67
68
|
"a1.md",
|
|
68
69
|
"folder1/a1.md",
|
|
69
70
|
"folder1/folder2/a1.md",
|
|
70
|
-
"toc.yaml"
|
|
71
|
+
"toc.yaml",
|
|
72
|
+
"yfm-build-manifest.json"
|
|
71
73
|
]"
|
|
72
74
|
`;
|
|
73
75
|
|
|
@@ -77,7 +79,6 @@ metadata:
|
|
|
77
79
|
- name: generator
|
|
78
80
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
79
81
|
vcsPath: a1.md
|
|
80
|
-
sourcePath: a1.md
|
|
81
82
|
---
|
|
82
83
|
This is the /a1.md file content.
|
|
83
84
|
"
|
|
@@ -94,7 +95,6 @@ restricted-access:
|
|
|
94
95
|
- - userAtoc2
|
|
95
96
|
- userBtoc2
|
|
96
97
|
vcsPath: folder1/a1.md
|
|
97
|
-
sourcePath: folder1/a1.md
|
|
98
98
|
---
|
|
99
99
|
This is the /folder1/a1.md file content.
|
|
100
100
|
"
|
|
@@ -111,7 +111,6 @@ restricted-access:
|
|
|
111
111
|
- - userAtoc3
|
|
112
112
|
- userBtoc3
|
|
113
113
|
vcsPath: folder1/folder2/a1.md
|
|
114
|
-
sourcePath: folder1/folder2/a1.md
|
|
115
114
|
---
|
|
116
115
|
This is the /folder1/folder1/a1.md file content.
|
|
117
116
|
"
|
|
@@ -142,6 +141,8 @@ path: toc.yaml
|
|
|
142
141
|
"
|
|
143
142
|
`;
|
|
144
143
|
|
|
144
|
+
exports[`Restricted access > Nested toc restricted access 5`] = `"{"redirects":{},"fileTrie":{"trie":{"a1":{"file":{"ext":".md","toc":"t0"}},"folder1":{"children":{"a1":{"file":{"ext":".md","toc":"t0"}},"folder2":{"children":{"a1":{"file":{"ext":".md","toc":"t0"}}}}}}},"tocMapping":{"t0":"toc.yaml"}},"yfmConfig":{}}"`;
|
|
145
|
+
|
|
145
146
|
exports[`Restricted access > Simple restricted access > filelist 1`] = `
|
|
146
147
|
"[
|
|
147
148
|
"index.md",
|
|
@@ -149,7 +150,8 @@ exports[`Restricted access > Simple restricted access > filelist 1`] = `
|
|
|
149
150
|
"plugins/index2.md",
|
|
150
151
|
"plugins/index3.md",
|
|
151
152
|
"plugins/index4.md",
|
|
152
|
-
"toc.yaml"
|
|
153
|
+
"toc.yaml",
|
|
154
|
+
"yfm-build-manifest.json"
|
|
153
155
|
]"
|
|
154
156
|
`;
|
|
155
157
|
|
|
@@ -161,7 +163,6 @@ metadata:
|
|
|
161
163
|
restricted-access:
|
|
162
164
|
- - admin
|
|
163
165
|
vcsPath: index.md
|
|
164
|
-
sourcePath: index.md
|
|
165
166
|
---
|
|
166
167
|
"
|
|
167
168
|
`;
|
|
@@ -174,7 +175,6 @@ metadata:
|
|
|
174
175
|
restricted-access:
|
|
175
176
|
- - admin
|
|
176
177
|
vcsPath: plugins/index.md
|
|
177
|
-
sourcePath: plugins/index.md
|
|
178
178
|
---
|
|
179
179
|
"
|
|
180
180
|
`;
|
|
@@ -189,7 +189,6 @@ restricted-access:
|
|
|
189
189
|
- - admin
|
|
190
190
|
- user
|
|
191
191
|
vcsPath: plugins/index2.md
|
|
192
|
-
sourcePath: plugins/index2.md
|
|
193
192
|
---
|
|
194
193
|
"
|
|
195
194
|
`;
|
|
@@ -202,7 +201,6 @@ metadata:
|
|
|
202
201
|
restricted-access:
|
|
203
202
|
- - admin
|
|
204
203
|
vcsPath: plugins/index3.md
|
|
205
|
-
sourcePath: plugins/index3.md
|
|
206
204
|
---
|
|
207
205
|
"
|
|
208
206
|
`;
|
|
@@ -216,7 +214,6 @@ restricted-access:
|
|
|
216
214
|
- - admin
|
|
217
215
|
- - customInFile
|
|
218
216
|
vcsPath: plugins/index4.md
|
|
219
|
-
sourcePath: plugins/index4.md
|
|
220
217
|
---
|
|
221
218
|
"
|
|
222
219
|
`;
|
|
@@ -252,3 +249,5 @@ items:
|
|
|
252
249
|
path: toc.yaml
|
|
253
250
|
"
|
|
254
251
|
`;
|
|
252
|
+
|
|
253
|
+
exports[`Restricted access > Simple restricted access 7`] = `"{"redirects":{},"fileTrie":{"trie":{"index":{"file":{"ext":".md","toc":"t0"}},"plugins":{"children":{"index":{"file":{"ext":".md","toc":"t0"}},"index2":{"file":{"ext":".md","toc":"t0"}},"index3":{"file":{"ext":".md","toc":"t0"}},"index4":{"file":{"ext":".md","toc":"t0"}}}}},"tocMapping":{"t0":"toc.yaml"}},"yfmConfig":{}}"`;
|
|
@@ -25,7 +25,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
25
25
|
<body class="g-root g-root_theme_light">
|
|
26
26
|
<div id="root"></div>
|
|
27
27
|
<script type="application/json" id="diplodoc-state">
|
|
28
|
-
{"data":{"leading":true,"data":{"title":"Documentation","links":[{"title":"Documentation","href":"page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.yaml"
|
|
28
|
+
{"data":{"leading":true,"data":{"title":"Documentation","links":[{"title":"Documentation","href":"page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.yaml"},"title":"Documentation"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"he","langs":["he"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
29
29
|
</script>
|
|
30
30
|
<script type="application/javascript">
|
|
31
31
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -53,7 +53,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
53
53
|
<body class="g-root g-root_theme_light">
|
|
54
54
|
<div id="root"></div>
|
|
55
55
|
<script type="application/json" id="diplodoc-state">
|
|
56
|
-
{"data":{"leading":false,"html":"<p>תיעוד</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page.md"
|
|
56
|
+
{"data":{"leading":false,"html":"<p>תיעוד</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page.md"},"headings":[],"title":""},"router":{"pathname":"page","depth":1,"base":"./"},"lang":"he","langs":["he"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
57
57
|
</script>
|
|
58
58
|
<script type="application/javascript">
|
|
59
59
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -101,7 +101,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
101
101
|
<body class="g-root g-root_theme_light">
|
|
102
102
|
<div id="root"></div>
|
|
103
103
|
<script type="application/json" id="diplodoc-state">
|
|
104
|
-
{"data":{"leading":true,"data":{"title":"Documentation","links":[{"title":"Documentation","href":"ar/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ar/index.html","hreflang":"ar"}],"canonical":"ar/index.html","vcsPath":"ar/index.yaml"
|
|
104
|
+
{"data":{"leading":true,"data":{"title":"Documentation","links":[{"title":"Documentation","href":"ar/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ar/index.html","hreflang":"ar"}],"canonical":"ar/index.html","vcsPath":"ar/index.yaml"},"title":"Documentation"},"router":{"pathname":"ar/index","depth":2,"base":"../"},"lang":"ar","langs":["ar","en"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
105
105
|
</script>
|
|
106
106
|
<script type="application/javascript">
|
|
107
107
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -132,7 +132,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
132
132
|
<body class="g-root g-root_theme_light">
|
|
133
133
|
<div id="root"></div>
|
|
134
134
|
<script type="application/json" id="diplodoc-state">
|
|
135
|
-
{"data":{"leading":false,"html":"<p>توثيق</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page.html","hreflang":"en"},{"href":"ar/page.html","hreflang":"ar"}],"canonical":"ar/page.html","vcsPath":"ar/page.md"
|
|
135
|
+
{"data":{"leading":false,"html":"<p>توثيق</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page.html","hreflang":"en"},{"href":"ar/page.html","hreflang":"ar"}],"canonical":"ar/page.html","vcsPath":"ar/page.md"},"headings":[],"title":""},"router":{"pathname":"ar/page","depth":2,"base":"../"},"lang":"ar","langs":["ar","en"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
136
136
|
</script>
|
|
137
137
|
<script type="application/javascript">
|
|
138
138
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -165,7 +165,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
165
165
|
<body class="g-root g-root_theme_light">
|
|
166
166
|
<div id="root"></div>
|
|
167
167
|
<script type="application/json" id="diplodoc-state">
|
|
168
|
-
{"data":{"leading":true,"data":{"title":"Documentation","description":"","links":[{"title":"Getting started with Documentation","description":"This guide will show you the basics of working with Documentation","href":"en/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ar/index.html","hreflang":"ar"}],"canonical":"en/index.html","title":"Documentation","noIndex":true,"vcsPath":"en/index.yaml"
|
|
168
|
+
{"data":{"leading":true,"data":{"title":"Documentation","description":"","links":[{"title":"Getting started with Documentation","description":"This guide will show you the basics of working with Documentation","href":"en/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ar/index.html","hreflang":"ar"}],"canonical":"en/index.html","title":"Documentation","noIndex":true,"vcsPath":"en/index.yaml"},"title":"Documentation"},"router":{"pathname":"en/index","depth":2,"base":"../"},"lang":"en","langs":["ar","en"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
169
169
|
</script>
|
|
170
170
|
<script type="application/javascript">
|
|
171
171
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -197,7 +197,7 @@ exports[`Generate html document with correct lang and dir attributes. Load corre
|
|
|
197
197
|
<body class="g-root g-root_theme_light">
|
|
198
198
|
<div id="root"></div>
|
|
199
199
|
<script type="application/json" id="diplodoc-state">
|
|
200
|
-
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"},{"name":"yfm","content":"builder"}],"alternate":[{"href":"en/page.html","hreflang":"en"},{"href":"ar/page.html","hreflang":"ar"}],"canonical":"en/page.html","vcsPath":"en/page.md"
|
|
200
|
+
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"},{"name":"yfm","content":"builder"}],"alternate":[{"href":"en/page.html","hreflang":"en"},{"href":"ar/page.html","hreflang":"ar"}],"canonical":"en/page.html","vcsPath":"en/page.md"},"headings":[],"title":""},"router":{"pathname":"en/page","depth":2,"base":"../"},"lang":"en","langs":["ar","en"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
201
201
|
</script>
|
|
202
202
|
<script type="application/javascript">
|
|
203
203
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -39,7 +39,7 @@ exports[`Local search > internal 2`] = `
|
|
|
39
39
|
<body class="g-root g-root_theme_light">
|
|
40
40
|
<div id="root"></div>
|
|
41
41
|
<script type="application/json" id="diplodoc-state">
|
|
42
|
-
{"data":{"leading":false,"html":"<p>Content</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"
|
|
42
|
+
{"data":{"leading":false,"html":"<p>Content</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"},"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","toc":false,"search":true,"feedback":true},"search":{"provider":"local","tolerance":2,"confidense":"phrased","enabled":true,"api":"_search/api.js","link":"_search/en/index.html"}}
|
|
43
43
|
</script>
|
|
44
44
|
<script type="application/javascript">
|
|
45
45
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -49,7 +49,7 @@ exports[`Single page mode > simple md2html single page with lang dirs 2`] = `
|
|
|
49
49
|
<body class="g-root g-root_theme_light">
|
|
50
50
|
<div id="root"></div>
|
|
51
51
|
<script type="application/json" id="diplodoc-state">
|
|
52
|
-
{"data":{"leading":true,"data":{"title":"Documentation","description":"","links":[{"title":"Getting started with Documentation","description":"This guide will show you the basics of working with Documentation","href":"ru/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"ru/index.html","hreflang":"ru"}],"canonical":"ru/index.html","title":"Documentation","noIndex":true,"vcsPath":"ru/index.yaml"
|
|
52
|
+
{"data":{"leading":true,"data":{"title":"Documentation","description":"","links":[{"title":"Getting started with Documentation","description":"This guide will show you the basics of working with Documentation","href":"ru/page.html"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"ru/index.html","hreflang":"ru"}],"canonical":"ru/index.html","title":"Documentation","noIndex":true,"vcsPath":"ru/index.yaml"},"title":"Documentation"},"router":{"pathname":"ru/index","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
53
53
|
</script>
|
|
54
54
|
<script type="application/javascript">
|
|
55
55
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -82,7 +82,7 @@ exports[`Single page mode > simple md2html single page with lang dirs 3`] = `
|
|
|
82
82
|
<body class="g-root g-root_theme_light">
|
|
83
83
|
<div id="root"></div>
|
|
84
84
|
<script type="application/json" id="diplodoc-state">
|
|
85
|
-
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"},{"name":"yfm","content":"builder in page"},{"name":"description","content":"Some test description"}],"alternate":[{"href":"ru/page.html","hreflang":"ru"}],"canonical":"ru/page.html","title":"Page Title","description":"Some test description","interface":{"toc":false,"favicon-src":"/favicon.ico"},"vcsPath":"ru/page.md"
|
|
85
|
+
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"},{"name":"yfm","content":"builder in page"},{"name":"description","content":"Some test description"}],"alternate":[{"href":"ru/page.html","hreflang":"ru"}],"canonical":"ru/page.html","title":"Page Title","description":"Some test description","interface":{"toc":false,"favicon-src":"/favicon.ico"},"vcsPath":"ru/page.md"},"headings":[],"title":"Page Title"},"router":{"pathname":"ru/page","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":false,"search":true,"feedback":true,"favicon-src":"/favicon.ico"}}
|
|
86
86
|
</script>
|
|
87
87
|
<script type="application/javascript">
|
|
88
88
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -112,7 +112,7 @@ exports[`Single page mode > simple md2html single page with lang dirs 4`] = `
|
|
|
112
112
|
<body class="g-root g-root_theme_light">
|
|
113
113
|
<div id="root"></div>
|
|
114
114
|
<script type="application/json" id="diplodoc-state">
|
|
115
|
-
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"ru/project/config.html","hreflang":"ru"}],"canonical":"ru/project/config.html","vcsPath":"ru/project/config.md"
|
|
115
|
+
{"data":{"leading":false,"html":"<p>Lorem</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"ru/project/config.html","hreflang":"ru"}],"canonical":"ru/project/config.html","vcsPath":"ru/project/config.md"},"headings":[],"title":""},"router":{"pathname":"ru/project/config","depth":3,"base":"../../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
116
116
|
</script>
|
|
117
117
|
<script type="application/javascript">
|
|
118
118
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -31,7 +31,7 @@ exports[`Skip html extension > transforms links correctly 2`] = `
|
|
|
31
31
|
<body class="g-root g-root_theme_light">
|
|
32
32
|
<div id="root"></div>
|
|
33
33
|
<script type="application/json" id="diplodoc-state">
|
|
34
|
-
{"data":{"leading":false,"html":"","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"folder/index.md"
|
|
34
|
+
{"data":{"leading":false,"html":"","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"folder/index.md"},"headings":[],"title":"Page 3"},"router":{"pathname":"folder/index","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
35
35
|
</script>
|
|
36
36
|
<script type="application/javascript">
|
|
37
37
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -59,7 +59,7 @@ exports[`Skip html extension > transforms links correctly 3`] = `
|
|
|
59
59
|
<body class="g-root g-root_theme_light">
|
|
60
60
|
<div id="root"></div>
|
|
61
61
|
<script type="application/json" id="diplodoc-state">
|
|
62
|
-
{"data":{"leading":false,"html":"<p><a href=\\"page1\\">Link 1</a><br />/n<a href=\\"page2\\">Link 2</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index-test-html/index.md"
|
|
62
|
+
{"data":{"leading":false,"html":"<p><a href=\\"page1\\">Link 1</a><br />/n<a href=\\"page2\\">Link 2</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index-test-html/index.md"},"headings":[],"title":"Folder"},"router":{"pathname":"index-test-html/index","depth":2,"base":"../"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
63
63
|
</script>
|
|
64
64
|
<script type="application/javascript">
|
|
65
65
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -107,7 +107,7 @@ exports[`Skip html extension > transforms links correctly 5`] = `
|
|
|
107
107
|
<body class="g-root g-root_theme_light">
|
|
108
108
|
<div id="root"></div>
|
|
109
109
|
<script type="application/json" id="diplodoc-state">
|
|
110
|
-
{"data":{"leading":false,"html":"<p><a href=\\"page2#hash\\">Link</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page1.md"
|
|
110
|
+
{"data":{"leading":false,"html":"<p><a href=\\"page2#hash\\">Link</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page1.md"},"headings":[],"title":"Page 1"},"router":{"pathname":"page1","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
111
111
|
</script>
|
|
112
112
|
<script type="application/javascript">
|
|
113
113
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -135,7 +135,7 @@ exports[`Skip html extension > transforms links correctly 6`] = `
|
|
|
135
135
|
<body class="g-root g-root_theme_light">
|
|
136
136
|
<div id="root"></div>
|
|
137
137
|
<script type="application/json" id="diplodoc-state">
|
|
138
|
-
{"data":{"leading":false,"html":"<h2 id=\\"hash\\"><a href=\\"page2#hash\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">hash</span></a>hash</h2>/n<p><a href=\\"folder/\\">Link</a><br />/n<a href=\\"https://example.com\\" target=\\"_blank\\" rel=\\"noreferrer noopener\\">External link</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page2.md"
|
|
138
|
+
{"data":{"leading":false,"html":"<h2 id=\\"hash\\"><a href=\\"page2#hash\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">hash</span></a>hash</h2>/n<p><a href=\\"folder/\\">Link</a><br />/n<a href=\\"https://example.com\\" target=\\"_blank\\" rel=\\"noreferrer noopener\\">External link</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"page2.md"},"headings":[{"title":"hash","href":"page2#hash","level":2}],"title":"Page 2"},"router":{"pathname":"page2","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
139
139
|
</script>
|
|
140
140
|
<script type="application/javascript">
|
|
141
141
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -7,7 +7,8 @@ exports[`Translate command > build translated md files and remove no-translate d
|
|
|
7
7
|
"openapi/index.md",
|
|
8
8
|
"openapi/test-controller/getWithPayloadResponse.md",
|
|
9
9
|
"openapi/test-controller/index.md",
|
|
10
|
-
"toc.yaml"
|
|
10
|
+
"toc.yaml",
|
|
11
|
+
"yfm-build-manifest.json"
|
|
11
12
|
]"
|
|
12
13
|
`;
|
|
13
14
|
|
|
@@ -17,7 +18,6 @@ metadata:
|
|
|
17
18
|
- name: generator
|
|
18
19
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
19
20
|
vcsPath: index.md
|
|
20
|
-
sourcePath: index.md
|
|
21
21
|
---
|
|
22
22
|
## Index header
|
|
23
23
|
|
|
@@ -34,7 +34,6 @@ metadata:
|
|
|
34
34
|
- name: generator
|
|
35
35
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
36
36
|
vcsPath: no-translate.md
|
|
37
|
-
sourcePath: no-translate.md
|
|
38
37
|
---
|
|
39
38
|
# No-translate directive
|
|
40
39
|
|
|
@@ -98,7 +97,6 @@ metadata:
|
|
|
98
97
|
- name: generator
|
|
99
98
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
100
99
|
vcsPath: openapi/index.md
|
|
101
|
-
sourcePath: openapi/index.md
|
|
102
100
|
---
|
|
103
101
|
# OpenAPI definition
|
|
104
102
|
|
|
@@ -199,7 +197,6 @@ metadata:
|
|
|
199
197
|
- name: generator
|
|
200
198
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
201
199
|
vcsPath: openapi/test-controller/getWithPayloadResponse.md
|
|
202
|
-
sourcePath: openapi/test-controller/getWithPayloadResponse.md
|
|
203
200
|
---
|
|
204
201
|
<div class="openapi">
|
|
205
202
|
|
|
@@ -285,7 +282,6 @@ metadata:
|
|
|
285
282
|
- name: generator
|
|
286
283
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
287
284
|
vcsPath: openapi/test-controller/index.md
|
|
288
|
-
sourcePath: openapi/test-controller/index.md
|
|
289
285
|
---
|
|
290
286
|
# test-controller
|
|
291
287
|
|
|
@@ -316,6 +312,8 @@ path: toc.yaml
|
|
|
316
312
|
"
|
|
317
313
|
`;
|
|
318
314
|
|
|
315
|
+
exports[`Translate command > build translated md files and remove no-translate directives 7`] = `"{"redirects":{},"fileTrie":{"trie":{"openapi":{"children":{"index":{"file":{"ext":".md","toc":"t0"}},"test-controller":{"children":{"index":{"file":{"ext":".md","toc":"t0"}},"getWithPayloadResponse":{"file":{"ext":".md","toc":"t0"}}}}}},"index":{"file":{"ext":".md","toc":"t0"}},"no-translate":{"file":{"ext":".md","toc":"t0"}}},"tocMapping":{"t0":"toc.yaml"}},"yfmConfig":{}}"`;
|
|
316
|
+
|
|
319
317
|
exports[`Translate command > build translated static files and remove no-translate directives > filelist 1`] = `
|
|
320
318
|
"[
|
|
321
319
|
"index.md",
|
|
@@ -323,7 +321,8 @@ exports[`Translate command > build translated static files and remove no-transla
|
|
|
323
321
|
"openapi/index.md",
|
|
324
322
|
"openapi/test-controller/getWithPayloadResponse.md",
|
|
325
323
|
"openapi/test-controller/index.md",
|
|
326
|
-
"toc.yaml"
|
|
324
|
+
"toc.yaml",
|
|
325
|
+
"yfm-build-manifest.json"
|
|
327
326
|
]"
|
|
328
327
|
`;
|
|
329
328
|
|
|
@@ -333,7 +332,6 @@ metadata:
|
|
|
333
332
|
- name: generator
|
|
334
333
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
335
334
|
vcsPath: index.md
|
|
336
|
-
sourcePath: index.md
|
|
337
335
|
---
|
|
338
336
|
## Index header
|
|
339
337
|
|
|
@@ -350,7 +348,6 @@ metadata:
|
|
|
350
348
|
- name: generator
|
|
351
349
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
352
350
|
vcsPath: no-translate.md
|
|
353
|
-
sourcePath: no-translate.md
|
|
354
351
|
---
|
|
355
352
|
# No-translate directive
|
|
356
353
|
|
|
@@ -414,7 +411,6 @@ metadata:
|
|
|
414
411
|
- name: generator
|
|
415
412
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
416
413
|
vcsPath: openapi/index.md
|
|
417
|
-
sourcePath: openapi/index.md
|
|
418
414
|
---
|
|
419
415
|
# OpenAPI definition
|
|
420
416
|
|
|
@@ -515,7 +511,6 @@ metadata:
|
|
|
515
511
|
- name: generator
|
|
516
512
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
517
513
|
vcsPath: openapi/test-controller/getWithPayloadResponse.md
|
|
518
|
-
sourcePath: openapi/test-controller/getWithPayloadResponse.md
|
|
519
514
|
---
|
|
520
515
|
<div class="openapi">
|
|
521
516
|
|
|
@@ -601,7 +596,6 @@ metadata:
|
|
|
601
596
|
- name: generator
|
|
602
597
|
content: Diplodoc Platform vDIPLODOC-VERSION
|
|
603
598
|
vcsPath: openapi/test-controller/index.md
|
|
604
|
-
sourcePath: openapi/test-controller/index.md
|
|
605
599
|
---
|
|
606
600
|
# test-controller
|
|
607
601
|
|
|
@@ -632,6 +626,8 @@ path: toc.yaml
|
|
|
632
626
|
"
|
|
633
627
|
`;
|
|
634
628
|
|
|
629
|
+
exports[`Translate command > build translated static files and remove no-translate directives 7`] = `"{"redirects":{},"fileTrie":{"trie":{"openapi":{"children":{"index":{"file":{"ext":".md","toc":"t0"}},"test-controller":{"children":{"index":{"file":{"ext":".md","toc":"t0"}},"getWithPayloadResponse":{"file":{"ext":".md","toc":"t0"}}}}}},"index":{"file":{"ext":".md","toc":"t0"}},"no-translate":{"file":{"ext":".md","toc":"t0"}}},"tocMapping":{"t0":"toc.yaml"}},"yfmConfig":{}}"`;
|
|
630
|
+
|
|
635
631
|
exports[`Translate command > do not filter files on extract > filelist 1`] = `
|
|
636
632
|
"[
|
|
637
633
|
"es/_includes/test.md.skl",
|
package/e2e/alternates.test.ts
CHANGED
package/e2e/bundles.spec.ts
CHANGED
package/e2e/errors.spec.ts
CHANGED
|
@@ -1,45 +1,55 @@
|
|
|
1
1
|
import type {Report} from '../fixtures/runners/types';
|
|
2
2
|
|
|
3
3
|
import {describe, expect, it} from 'vitest';
|
|
4
|
+
|
|
4
5
|
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
5
6
|
|
|
6
7
|
type TestResult = {
|
|
7
8
|
md: Report;
|
|
8
9
|
html: Report;
|
|
9
|
-
}
|
|
10
|
+
};
|
|
10
11
|
|
|
11
12
|
function test(path: string, expect: Function) {
|
|
12
13
|
it(path, async () => {
|
|
13
14
|
const {inputPath, outputPath} = getTestPaths(path);
|
|
14
15
|
|
|
15
16
|
const md = await TestAdapter.build.run(inputPath, outputPath, ['-j2', '-f', 'md']);
|
|
16
|
-
const html = await TestAdapter.build.run(inputPath, outputPath + '-html', [
|
|
17
|
+
const html = await TestAdapter.build.run(inputPath, outputPath + '-html', [
|
|
18
|
+
'-j2',
|
|
19
|
+
'-f',
|
|
20
|
+
'html',
|
|
21
|
+
]);
|
|
17
22
|
return expect({md, html});
|
|
18
23
|
});
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
|
|
22
26
|
describe('Errors', () => {
|
|
23
27
|
test('mocks/errors/unreachable-link', ({html}: TestResult) => {
|
|
24
28
|
expectErrors(html, [
|
|
25
29
|
'ERR index.md: 1: YFM003 / unreachable-link Link is unreachable [Context: "[Unreachable link: "exists.html"][existing file](./exists.md)"]',
|
|
26
|
-
'ERR index.md: 2: YFM003 / unreachable-link Link is unreachable [Context: "[Unreachable link: "missed.html"][missed file](./missed.md)"]'
|
|
30
|
+
'ERR index.md: 2: YFM003 / unreachable-link Link is unreachable [Context: "[Unreachable link: "missed.html"][missed file](./missed.md)"]',
|
|
27
31
|
]);
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
it('translate extract with filtered links', async () => {
|
|
31
35
|
const {inputPath, outputPath} = getTestPaths('mocks/errors/extract-filtered-link');
|
|
32
36
|
|
|
33
|
-
const result = await TestAdapter.extract.run(inputPath, outputPath, [
|
|
34
|
-
|
|
37
|
+
const result = await TestAdapter.extract.run(inputPath, outputPath, [
|
|
38
|
+
'--source',
|
|
39
|
+
'ru-RU',
|
|
40
|
+
'--target',
|
|
41
|
+
'es-ES',
|
|
42
|
+
'--filter',
|
|
43
|
+
]);
|
|
44
|
+
|
|
35
45
|
expect(result.code).toEqual(1);
|
|
36
|
-
|
|
46
|
+
|
|
37
47
|
expect(result.errors).toEqual([
|
|
38
48
|
"ERR File index.md contains link to filtered.md, which was filtered from toc.yaml or it's not been included initially",
|
|
39
49
|
"ERR File index.md contains link to filtered2.md, which was filtered from toc.yaml or it's not been included initially",
|
|
40
50
|
"ERR File index.md contains link to filtered2.md, which was filtered from toc.yaml or it's not been included initially",
|
|
41
51
|
"ERR File index.md contains link to filtered3.md, which was filtered from toc.yaml or it's not been included initially",
|
|
42
|
-
])
|
|
52
|
+
]);
|
|
43
53
|
});
|
|
44
54
|
});
|
|
45
55
|
|
package/e2e/generate-map.spec.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {describe, expect, test} from 'vitest';
|
|
2
|
-
import {TestAdapter, bundleless, getFileContent, getTestPaths} from '../fixtures';
|
|
3
2
|
import {join} from 'node:path';
|
|
4
3
|
import {readFile} from 'node:fs/promises';
|
|
5
4
|
|
|
5
|
+
import {TestAdapter, bundleless, getFileContent, getTestPaths} from '../fixtures';
|
|
6
|
+
|
|
6
7
|
const generateMapTestTemplate = (
|
|
7
8
|
testTitle: string,
|
|
8
9
|
testRootPath: string,
|
|
@@ -19,7 +20,10 @@ const generateMapTestTemplate = (
|
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
const content = getFileContent(join(outputPath, 'files.json'));
|
|
22
|
-
const manifestContent = await readFile(
|
|
23
|
+
const manifestContent = await readFile(
|
|
24
|
+
join(outputPath, 'yfm-build-manifest.json'),
|
|
25
|
+
'utf-8',
|
|
26
|
+
);
|
|
23
27
|
|
|
24
28
|
expect(bundleless(content)).toMatchSnapshot();
|
|
25
29
|
expect(JSON.parse(manifestContent)).toMatchSnapshot();
|
package/e2e/include-toc.test.ts
CHANGED
package/e2e/metadata.spec.ts
CHANGED
package/e2e/preprocess.test.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
2
3
|
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
3
4
|
|
|
4
5
|
const generateFilesYamlTestTemplate = (
|
|
@@ -9,7 +10,7 @@ const generateFilesYamlTestTemplate = (
|
|
|
9
10
|
test(testTitle, async () => {
|
|
10
11
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
11
12
|
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
12
|
-
md2md:true,
|
|
13
|
+
md2md: true,
|
|
13
14
|
md2html: false,
|
|
14
15
|
args: args.join(' '),
|
|
15
16
|
});
|
|
@@ -24,14 +25,16 @@ const generateFilesYamlTestTemplate = (
|
|
|
24
25
|
|
|
25
26
|
describe('Preprocess', () => {
|
|
26
27
|
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=false', 'mocks/preprocess', [
|
|
27
|
-
'--no-merge-autotitles'
|
|
28
|
+
'--no-merge-autotitles',
|
|
28
29
|
]);
|
|
29
30
|
|
|
30
31
|
generateFilesYamlTestTemplate('HashIncludes=true,Autotitles=true', 'mocks/preprocess');
|
|
31
32
|
|
|
32
|
-
generateFilesYamlTestTemplate(
|
|
33
|
-
'
|
|
34
|
-
|
|
33
|
+
generateFilesYamlTestTemplate(
|
|
34
|
+
'HashIncludes=true,Autotitles=true,Svg=true',
|
|
35
|
+
'mocks/preprocess',
|
|
36
|
+
['--merge-svg'],
|
|
37
|
+
);
|
|
35
38
|
|
|
36
39
|
// generateFilesYamlTestTemplate('Nested toc restricted access', 'mocks/preprocess/test3');
|
|
37
40
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {describe, expect, it} from 'vitest';
|
|
2
|
+
|
|
2
3
|
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
3
4
|
|
|
4
5
|
describe('Redirects validation', () => {
|
|
@@ -38,7 +39,9 @@ describe('Redirects validation', () => {
|
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
it('should emit an error when a redirect is malformed', async () => {
|
|
41
|
-
const {inputPath, outputPath} = getTestPaths(
|
|
42
|
+
const {inputPath, outputPath} = getTestPaths(
|
|
43
|
+
'mocks/redirects-validation/malformed-redirect',
|
|
44
|
+
);
|
|
42
45
|
|
|
43
46
|
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
44
47
|
|
|
@@ -54,8 +57,6 @@ describe('Redirects validation', () => {
|
|
|
54
57
|
const report = await TestAdapter.build.run(inputPath, outputPath, ['-f', 'md']);
|
|
55
58
|
|
|
56
59
|
expect(report.code).toBe(1);
|
|
57
|
-
expect(report.errors).toContainEqual(
|
|
58
|
-
expect.stringMatching(/Parameters must be different/),
|
|
59
|
-
);
|
|
60
|
+
expect(report.errors).toContainEqual(expect.stringMatching(/Parameters must be different/));
|
|
60
61
|
});
|
|
61
62
|
});
|
package/e2e/regression.test.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {describe, test} from 'vitest';
|
|
2
|
+
|
|
2
3
|
import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
|
|
3
4
|
|
|
4
|
-
const generateFilesYamlTestTemplate = (
|
|
5
|
-
testTitle: string,
|
|
6
|
-
testRootPath: string
|
|
7
|
-
) => {
|
|
5
|
+
const generateFilesYamlTestTemplate = (testTitle: string, testRootPath: string) => {
|
|
8
6
|
test(testTitle, async () => {
|
|
9
7
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
10
|
-
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md:true});
|
|
8
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true});
|
|
11
9
|
await compareDirectories(outputPath);
|
|
12
10
|
});
|
|
13
11
|
};
|