@diplodoc/cli-tests 5.14.0 → 5.15.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.
Files changed (30) hide show
  1. package/e2e/__snapshots__/assets.spec.ts.snap +0 -0
  2. package/e2e/__snapshots__/neuro-expert.test.ts.snap +568 -0
  3. package/e2e/__snapshots__/translation.spec.ts.snap +154 -0
  4. package/e2e/assets.spec.ts +16 -0
  5. package/e2e/neuro-expert.test.ts +16 -0
  6. package/e2e/translation.spec.ts +24 -0
  7. package/mocks/assets/input/.yfm +1 -0
  8. package/mocks/assets/input/_images/camera.svg +1 -0
  9. package/mocks/assets/input/_images/icons/bulb.svg +1 -0
  10. package/mocks/assets/input/_images/mountain.jpg +0 -0
  11. package/mocks/assets/input/_images/versions.png +0 -0
  12. package/mocks/assets/input/index.md +19 -0
  13. package/mocks/assets/input/page.yaml +7 -0
  14. package/mocks/assets/input/toc.yaml +7 -0
  15. package/mocks/neuro-expert/input/.yfm +10 -0
  16. package/mocks/neuro-expert/input/en/folder/index.md +1 -0
  17. package/mocks/neuro-expert/input/en/index-test-html/index.md +4 -0
  18. package/mocks/neuro-expert/input/en/index.md +11 -0
  19. package/mocks/neuro-expert/input/en/page1.md +8 -0
  20. package/mocks/neuro-expert/input/en/page2.md +6 -0
  21. package/mocks/neuro-expert/input/en/toc.yaml +13 -0
  22. package/mocks/neuro-expert/input/ru/folder/index.md +1 -0
  23. package/mocks/neuro-expert/input/ru/index-test-html/index.md +4 -0
  24. package/mocks/neuro-expert/input/ru/index.md +5 -0
  25. package/mocks/neuro-expert/input/ru/page1.md +3 -0
  26. package/mocks/neuro-expert/input/ru/page2.md +6 -0
  27. package/mocks/neuro-expert/input/ru/toc.yaml +12 -0
  28. package/mocks/translation/conditions/input/index.md +11 -0
  29. package/mocks/translation/conditions/input/toc.yaml +5 -0
  30. package/package.json +1 -1
@@ -0,0 +1,568 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Skip html extension > Neuro-expert > filelist 1`] = `
4
+ "[
5
+ ".yfm",
6
+ "en/folder/index.html",
7
+ "en/index-test-html/index.html",
8
+ "en/index.html",
9
+ "en/page1.html",
10
+ "en/page2.html",
11
+ "en/toc.js",
12
+ "index.html",
13
+ "ru/folder/index.html",
14
+ "ru/index-test-html/index.html",
15
+ "ru/index.html",
16
+ "ru/page1.html",
17
+ "ru/page2.html",
18
+ "ru/toc.js"
19
+ ]"
20
+ `;
21
+
22
+ exports[`Skip html extension > Neuro-expert 1`] = `
23
+ "allowHTML: true
24
+ langs: ['en','ru']
25
+
26
+ neuroExpert:
27
+ projectId:
28
+ en: none
29
+ ru: 77fac9c9ad9811f0997f4641db830dfd
30
+ default: 77fac9c9ad9811f0997f4641db830dfd
31
+ parentId: null
32
+ disabled: false
33
+ "
34
+ `;
35
+
36
+ exports[`Skip html extension > Neuro-expert 2`] = `
37
+ "<!DOCTYPE html>
38
+ <html lang="en" dir="ltr">
39
+ <head>
40
+ <meta charset="utf-8">
41
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
42
+ <base href="../../" />
43
+ <title>Page 3 | Neuroexpert</title>
44
+ <link rel="canonical" href="en/folder/index.html">
45
+ <link rel="alternate" href="en/folder/index.html" hreflang="en" />
46
+ <link rel="alternate" href="ru/folder/index.html" hreflang="ru" />
47
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
48
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
49
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
50
+ </head>
51
+ <body class="g-root g-root_theme_light">
52
+ <div id="root"></div>
53
+ <script type="application/json" id="diplodoc-state">
54
+ {"data":{"leading":false,"html":"","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/folder/index.html","hreflang":"en"},{"href":"ru/folder/index.html","hreflang":"ru"}],"canonical":"en/folder/index.html","vcsPath":"en/folder/index.md"},"headings":[],"title":"Page 3"},"router":{"pathname":"en/folder/index","depth":3,"base":"../../"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
55
+ </script>
56
+ <script type="application/javascript">
57
+ const data = document.querySelector('script#diplodoc-state');
58
+ window.__DATA__ = JSON.parse((function unescape(string) {
59
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
60
+ })(data.innerText));
61
+ window.STATIC_CONTENT = false;
62
+ </script>
63
+ <script type="application/javascript" defer src="en/toc.js"></script>
64
+ <script type="application/javascript">
65
+ const neuroExpertScript = document.createElement('script');
66
+ neuroExpertScript.type = "module";
67
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
68
+ const neuroExpertDiv = document.createElement("div");
69
+ neuroExpertDiv.id = "neuro-expert-widget";
70
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
71
+ neuroExpertScript.onload = () => {
72
+ function tryAppend() {
73
+ const widgetsDiv = document.getElementById("dc-widgets");
74
+ if (widgetsDiv) {
75
+ widgetsDiv.appendChild(neuroExpertDiv);
76
+ window.initNeuroexpert({"projectId":"none","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
77
+ } else {
78
+ setTimeout(tryAppend, 50);
79
+ }
80
+ }
81
+ tryAppend();
82
+ };
83
+ document.body.appendChild(neuroExpertScript);
84
+ </script>
85
+ </body>
86
+ </html>"
87
+ `;
88
+
89
+ exports[`Skip html extension > Neuro-expert 3`] = `
90
+ "<!DOCTYPE html>
91
+ <html lang="en" dir="ltr">
92
+ <head>
93
+ <meta charset="utf-8">
94
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
95
+ <base href="../../" />
96
+ <title>Folder | Neuroexpert</title>
97
+ <link rel="canonical" href="en/index-test-html/index.html">
98
+ <link rel="alternate" href="en/index-test-html/index.html" hreflang="en" />
99
+ <link rel="alternate" href="ru/index-test-html/index.html" hreflang="ru" />
100
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
101
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
102
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
103
+ </head>
104
+ <body class="g-root g-root_theme_light">
105
+ <div id="root"></div>
106
+ <script type="application/json" id="diplodoc-state">
107
+ {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"en/page1.html\\"&gt;Link 1&lt;/a&gt;&lt;br /&gt;/n&lt;a href=\\"en/page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index-test-html/index.html","hreflang":"en"},{"href":"ru/index-test-html/index.html","hreflang":"ru"}],"canonical":"en/index-test-html/index.html","vcsPath":"en/index-test-html/index.md"},"headings":[],"title":"Folder"},"router":{"pathname":"en/index-test-html/index","depth":3,"base":"../../"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
108
+ </script>
109
+ <script type="application/javascript">
110
+ const data = document.querySelector('script#diplodoc-state');
111
+ window.__DATA__ = JSON.parse((function unescape(string) {
112
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
113
+ })(data.innerText));
114
+ window.STATIC_CONTENT = false;
115
+ </script>
116
+ <script type="application/javascript" defer src="en/toc.js"></script>
117
+ <script type="application/javascript">
118
+ const neuroExpertScript = document.createElement('script');
119
+ neuroExpertScript.type = "module";
120
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
121
+ const neuroExpertDiv = document.createElement("div");
122
+ neuroExpertDiv.id = "neuro-expert-widget";
123
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
124
+ neuroExpertScript.onload = () => {
125
+ function tryAppend() {
126
+ const widgetsDiv = document.getElementById("dc-widgets");
127
+ if (widgetsDiv) {
128
+ widgetsDiv.appendChild(neuroExpertDiv);
129
+ window.initNeuroexpert({"projectId":"none","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
130
+ } else {
131
+ setTimeout(tryAppend, 50);
132
+ }
133
+ }
134
+ tryAppend();
135
+ };
136
+ document.body.appendChild(neuroExpertScript);
137
+ </script>
138
+ </body>
139
+ </html>"
140
+ `;
141
+
142
+ exports[`Skip html extension > Neuro-expert 4`] = `
143
+ "<!DOCTYPE html>
144
+ <html lang="en" dir="ltr">
145
+ <head>
146
+ <meta charset="utf-8">
147
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
148
+ <base href="../" />
149
+ <title>Header | Neuroexpert</title>
150
+ <link rel="canonical" href="en/index.html">
151
+ <link rel="alternate" href="en/index.html" hreflang="en" />
152
+ <link rel="alternate" href="ru/index.html" hreflang="ru" />
153
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
154
+ <meta name="neuroExpert" content="[object Object]">
155
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
156
+ </head>
157
+ <body class="g-root g-root_theme_light">
158
+ <div id="root"></div>
159
+ <script type="application/json" id="diplodoc-state">
160
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"en/page1.html\\"&gt;Link 1&lt;/a&gt;&lt;br /&gt;/n&lt;a href=\\"en/page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ru/index.html","hreflang":"ru"}],"canonical":"en/index.html","neuroExpert":{"disabled":true},"vcsPath":"en/index.md"},"headings":[],"title":"Header"},"router":{"pathname":"en/index","depth":2,"base":"../"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
161
+ </script>
162
+ <script type="application/javascript">
163
+ const data = document.querySelector('script#diplodoc-state');
164
+ window.__DATA__ = JSON.parse((function unescape(string) {
165
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
166
+ })(data.innerText));
167
+ window.STATIC_CONTENT = false;
168
+ </script>
169
+ <script type="application/javascript" defer src="en/toc.js"></script>
170
+ </body>
171
+ </html>"
172
+ `;
173
+
174
+ exports[`Skip html extension > Neuro-expert 5`] = `
175
+ "<!DOCTYPE html>
176
+ <html lang="en" dir="ltr">
177
+ <head>
178
+ <meta charset="utf-8">
179
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
180
+ <base href="../" />
181
+ <title>Page 1 | Neuroexpert</title>
182
+ <link rel="canonical" href="en/page1.html">
183
+ <link rel="alternate" href="en/page1.html" hreflang="en" />
184
+ <link rel="alternate" href="ru/page1.html" hreflang="ru" />
185
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
186
+ <meta name="neuroExpert" content="[object Object]">
187
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
188
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
189
+ </head>
190
+ <body class="g-root g-root_theme_light">
191
+ <div id="root"></div>
192
+ <script type="application/json" id="diplodoc-state">
193
+ {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"en/page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page1.html","hreflang":"en"},{"href":"ru/page1.html","hreflang":"ru"}],"canonical":"en/page1.html","neuroExpert":{"parentId":"neuro-expert-div"},"vcsPath":"en/page1.md"},"headings":[],"title":"Page 1"},"router":{"pathname":"en/page1","depth":2,"base":"../"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
194
+ </script>
195
+ <script type="application/javascript">
196
+ const data = document.querySelector('script#diplodoc-state');
197
+ window.__DATA__ = JSON.parse((function unescape(string) {
198
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
199
+ })(data.innerText));
200
+ window.STATIC_CONTENT = false;
201
+ </script>
202
+ <script type="application/javascript" defer src="en/toc.js"></script>
203
+ <script type="application/javascript">
204
+ const neuroExpertScript = document.createElement('script');
205
+ neuroExpertScript.type = "module";
206
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
207
+ const neuroExpertDiv = document.createElement("div");
208
+ neuroExpertDiv.id = "neuro-expert-div";
209
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
210
+ neuroExpertScript.onload = () => {
211
+ function tryAppend() {
212
+ const widgetsDiv = document.getElementById("dc-widgets");
213
+ if (widgetsDiv) {
214
+ widgetsDiv.appendChild(neuroExpertDiv);
215
+ window.initNeuroexpert({"projectId":"none","hasOutsideClick":true,"parentId":"neuro-expert-div"});
216
+ } else {
217
+ setTimeout(tryAppend, 50);
218
+ }
219
+ }
220
+ tryAppend();
221
+ };
222
+ document.body.appendChild(neuroExpertScript);
223
+ </script>
224
+ </body>
225
+ </html>"
226
+ `;
227
+
228
+ exports[`Skip html extension > Neuro-expert 6`] = `
229
+ "<!DOCTYPE html>
230
+ <html lang="en" dir="ltr">
231
+ <head>
232
+ <meta charset="utf-8">
233
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
234
+ <base href="../" />
235
+ <title>Page 2 | Neuroexpert</title>
236
+ <link rel="canonical" href="en/page2.html">
237
+ <link rel="alternate" href="en/page2.html" hreflang="en" />
238
+ <link rel="alternate" href="ru/page2.html" hreflang="ru" />
239
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
240
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
241
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
242
+ </head>
243
+ <body class="g-root g-root_theme_light">
244
+ <div id="root"></div>
245
+ <script type="application/json" id="diplodoc-state">
246
+ {"data":{"leading":false,"html":"&lt;h2 id=\\"hash\\"&gt;&lt;a href=\\"en/page2.html#hash\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;hash&lt;/span&gt;&lt;/a&gt;hash&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"en/folder/index.html\\"&gt;Link&lt;/a&gt;&lt;br /&gt;/n&lt;a href=\\"https://example.com\\" target=\\"_blank\\" rel=\\"noreferrer noopener\\"&gt;External link&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page2.html","hreflang":"en"},{"href":"ru/page2.html","hreflang":"ru"}],"canonical":"en/page2.html","vcsPath":"en/page2.md"},"headings":[{"title":"hash","href":"en/page2.html#hash","level":2}],"title":"Page 2"},"router":{"pathname":"en/page2","depth":2,"base":"../"},"lang":"en","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
247
+ </script>
248
+ <script type="application/javascript">
249
+ const data = document.querySelector('script#diplodoc-state');
250
+ window.__DATA__ = JSON.parse((function unescape(string) {
251
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
252
+ })(data.innerText));
253
+ window.STATIC_CONTENT = false;
254
+ </script>
255
+ <script type="application/javascript" defer src="en/toc.js"></script>
256
+ <script type="application/javascript">
257
+ const neuroExpertScript = document.createElement('script');
258
+ neuroExpertScript.type = "module";
259
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
260
+ const neuroExpertDiv = document.createElement("div");
261
+ neuroExpertDiv.id = "neuro-expert-widget";
262
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
263
+ neuroExpertScript.onload = () => {
264
+ function tryAppend() {
265
+ const widgetsDiv = document.getElementById("dc-widgets");
266
+ if (widgetsDiv) {
267
+ widgetsDiv.appendChild(neuroExpertDiv);
268
+ window.initNeuroexpert({"projectId":"none","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
269
+ } else {
270
+ setTimeout(tryAppend, 50);
271
+ }
272
+ }
273
+ tryAppend();
274
+ };
275
+ document.body.appendChild(neuroExpertScript);
276
+ </script>
277
+ </body>
278
+ </html>"
279
+ `;
280
+
281
+ exports[`Skip html extension > Neuro-expert 7`] = `"window.__DATA__.data.toc = {"title":"Neuroexpert","href":"en/index.html","items":[{"name":"Title 1","href":"en/page1.html","id":"UUID"},{"name":"Title 2","href":"en/page2.html","id":"UUID"},{"name":"Title 3","href":"en/folder/index.html","id":"UUID"},{"name":"Title 4","href":"en/index-test-html/index.html","id":"UUID"}],"path":"en/toc.yaml","id":"UUID"};"`;
282
+
283
+ exports[`Skip html extension > Neuro-expert 8`] = `
284
+ "<!DOCTYPE html>
285
+ <html lang="en" dir="ltr">
286
+ <head>
287
+ <meta charset="utf-8">
288
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
289
+ <base href="./" />
290
+ <title>Redirect to ./en/index.html</title>
291
+ <meta http-equiv="refresh" content="0; url=./en/index.html">
292
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
293
+ <script type="application/javascript">
294
+ window.location.replace("./en/index.html");
295
+ </script>
296
+ </head>
297
+ <body class="g-root g-root_theme_light">
298
+ If you are not redirected automatically, follow this <a href="./en/index.html">link</a>.
299
+ </body>
300
+ </html>"
301
+ `;
302
+
303
+ exports[`Skip html extension > Neuro-expert 9`] = `
304
+ "<!DOCTYPE html>
305
+ <html lang="ru" dir="ltr">
306
+ <head>
307
+ <meta charset="utf-8">
308
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
309
+ <base href="../../" />
310
+ <title>Страница 3 | Нейроэксперт</title>
311
+ <link rel="canonical" href="ru/folder/index.html">
312
+ <link rel="alternate" href="en/folder/index.html" hreflang="en" />
313
+ <link rel="alternate" href="ru/folder/index.html" hreflang="ru" />
314
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
315
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
316
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
317
+ </head>
318
+ <body class="g-root g-root_theme_light">
319
+ <div id="root"></div>
320
+ <script type="application/json" id="diplodoc-state">
321
+ {"data":{"leading":false,"html":"","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/folder/index.html","hreflang":"en"},{"href":"ru/folder/index.html","hreflang":"ru"}],"canonical":"ru/folder/index.html","vcsPath":"ru/folder/index.md"},"headings":[],"title":"Страница 3"},"router":{"pathname":"ru/folder/index","depth":3,"base":"../../"},"lang":"ru","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
322
+ </script>
323
+ <script type="application/javascript">
324
+ const data = document.querySelector('script#diplodoc-state');
325
+ window.__DATA__ = JSON.parse((function unescape(string) {
326
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
327
+ })(data.innerText));
328
+ window.STATIC_CONTENT = false;
329
+ </script>
330
+ <script type="application/javascript" defer src="ru/toc.js"></script>
331
+ <script type="application/javascript">
332
+ const neuroExpertScript = document.createElement('script');
333
+ neuroExpertScript.type = "module";
334
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
335
+ const neuroExpertDiv = document.createElement("div");
336
+ neuroExpertDiv.id = "neuro-expert-widget";
337
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
338
+ neuroExpertScript.onload = () => {
339
+ function tryAppend() {
340
+ const widgetsDiv = document.getElementById("dc-widgets");
341
+ if (widgetsDiv) {
342
+ widgetsDiv.appendChild(neuroExpertDiv);
343
+ window.initNeuroexpert({"projectId":"77fac9c9ad9811f0997f4641db830dfd","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
344
+ } else {
345
+ setTimeout(tryAppend, 50);
346
+ }
347
+ }
348
+ tryAppend();
349
+ };
350
+ document.body.appendChild(neuroExpertScript);
351
+ </script>
352
+ </body>
353
+ </html>"
354
+ `;
355
+
356
+ exports[`Skip html extension > Neuro-expert 10`] = `
357
+ "<!DOCTYPE html>
358
+ <html lang="ru" dir="ltr">
359
+ <head>
360
+ <meta charset="utf-8">
361
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
362
+ <base href="../../" />
363
+ <title>Папка | Нейроэксперт</title>
364
+ <link rel="canonical" href="ru/index-test-html/index.html">
365
+ <link rel="alternate" href="en/index-test-html/index.html" hreflang="en" />
366
+ <link rel="alternate" href="ru/index-test-html/index.html" hreflang="ru" />
367
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
368
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
369
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
370
+ </head>
371
+ <body class="g-root g-root_theme_light">
372
+ <div id="root"></div>
373
+ <script type="application/json" id="diplodoc-state">
374
+ {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"ru/page1.html\\"&gt;Ссылка 1&lt;/a&gt;&lt;br /&gt;/n&lt;a href=\\"ru/page2.html\\"&gt;Ссылка 2&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index-test-html/index.html","hreflang":"en"},{"href":"ru/index-test-html/index.html","hreflang":"ru"}],"canonical":"ru/index-test-html/index.html","vcsPath":"ru/index-test-html/index.md"},"headings":[],"title":"Папка"},"router":{"pathname":"ru/index-test-html/index","depth":3,"base":"../../"},"lang":"ru","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
375
+ </script>
376
+ <script type="application/javascript">
377
+ const data = document.querySelector('script#diplodoc-state');
378
+ window.__DATA__ = JSON.parse((function unescape(string) {
379
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
380
+ })(data.innerText));
381
+ window.STATIC_CONTENT = false;
382
+ </script>
383
+ <script type="application/javascript" defer src="ru/toc.js"></script>
384
+ <script type="application/javascript">
385
+ const neuroExpertScript = document.createElement('script');
386
+ neuroExpertScript.type = "module";
387
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
388
+ const neuroExpertDiv = document.createElement("div");
389
+ neuroExpertDiv.id = "neuro-expert-widget";
390
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
391
+ neuroExpertScript.onload = () => {
392
+ function tryAppend() {
393
+ const widgetsDiv = document.getElementById("dc-widgets");
394
+ if (widgetsDiv) {
395
+ widgetsDiv.appendChild(neuroExpertDiv);
396
+ window.initNeuroexpert({"projectId":"77fac9c9ad9811f0997f4641db830dfd","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
397
+ } else {
398
+ setTimeout(tryAppend, 50);
399
+ }
400
+ }
401
+ tryAppend();
402
+ };
403
+ document.body.appendChild(neuroExpertScript);
404
+ </script>
405
+ </body>
406
+ </html>"
407
+ `;
408
+
409
+ exports[`Skip html extension > Neuro-expert 11`] = `
410
+ "<!DOCTYPE html>
411
+ <html lang="ru" dir="ltr">
412
+ <head>
413
+ <meta charset="utf-8">
414
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
415
+ <base href="../" />
416
+ <title>Хэдер | Нейроэксперт</title>
417
+ <link rel="canonical" href="ru/index.html">
418
+ <link rel="alternate" href="en/index.html" hreflang="en" />
419
+ <link rel="alternate" href="ru/index.html" hreflang="ru" />
420
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
421
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
422
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
423
+ </head>
424
+ <body class="g-root g-root_theme_light">
425
+ <div id="root"></div>
426
+ <script type="application/json" id="diplodoc-state">
427
+ {"data":{"leading":false,"html":"&lt;p&gt;Контент&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"ru/page1.html\\"&gt;Ссылка 1&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/index.html","hreflang":"en"},{"href":"ru/index.html","hreflang":"ru"}],"canonical":"ru/index.html","vcsPath":"ru/index.md"},"headings":[],"title":"Хэдер"},"router":{"pathname":"ru/index","depth":2,"base":"../"},"lang":"ru","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
428
+ </script>
429
+ <script type="application/javascript">
430
+ const data = document.querySelector('script#diplodoc-state');
431
+ window.__DATA__ = JSON.parse((function unescape(string) {
432
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
433
+ })(data.innerText));
434
+ window.STATIC_CONTENT = false;
435
+ </script>
436
+ <script type="application/javascript" defer src="ru/toc.js"></script>
437
+ <script type="application/javascript">
438
+ const neuroExpertScript = document.createElement('script');
439
+ neuroExpertScript.type = "module";
440
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
441
+ const neuroExpertDiv = document.createElement("div");
442
+ neuroExpertDiv.id = "neuro-expert-widget";
443
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
444
+ neuroExpertScript.onload = () => {
445
+ function tryAppend() {
446
+ const widgetsDiv = document.getElementById("dc-widgets");
447
+ if (widgetsDiv) {
448
+ widgetsDiv.appendChild(neuroExpertDiv);
449
+ window.initNeuroexpert({"projectId":"77fac9c9ad9811f0997f4641db830dfd","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
450
+ } else {
451
+ setTimeout(tryAppend, 50);
452
+ }
453
+ }
454
+ tryAppend();
455
+ };
456
+ document.body.appendChild(neuroExpertScript);
457
+ </script>
458
+ </body>
459
+ </html>"
460
+ `;
461
+
462
+ exports[`Skip html extension > Neuro-expert 12`] = `
463
+ "<!DOCTYPE html>
464
+ <html lang="ru" dir="ltr">
465
+ <head>
466
+ <meta charset="utf-8">
467
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
468
+ <base href="../" />
469
+ <title>Страница 1 | Нейроэксперт</title>
470
+ <link rel="canonical" href="ru/page1.html">
471
+ <link rel="alternate" href="en/page1.html" hreflang="en" />
472
+ <link rel="alternate" href="ru/page1.html" hreflang="ru" />
473
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
474
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
475
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
476
+ </head>
477
+ <body class="g-root g-root_theme_light">
478
+ <div id="root"></div>
479
+ <script type="application/json" id="diplodoc-state">
480
+ {"data":{"leading":false,"html":"&lt;p&gt;&lt;a href=\\"ru/page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page1.html","hreflang":"en"},{"href":"ru/page1.html","hreflang":"ru"}],"canonical":"ru/page1.html","vcsPath":"ru/page1.md"},"headings":[],"title":"Страница 1"},"router":{"pathname":"ru/page1","depth":2,"base":"../"},"lang":"ru","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
481
+ </script>
482
+ <script type="application/javascript">
483
+ const data = document.querySelector('script#diplodoc-state');
484
+ window.__DATA__ = JSON.parse((function unescape(string) {
485
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
486
+ })(data.innerText));
487
+ window.STATIC_CONTENT = false;
488
+ </script>
489
+ <script type="application/javascript" defer src="ru/toc.js"></script>
490
+ <script type="application/javascript">
491
+ const neuroExpertScript = document.createElement('script');
492
+ neuroExpertScript.type = "module";
493
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
494
+ const neuroExpertDiv = document.createElement("div");
495
+ neuroExpertDiv.id = "neuro-expert-widget";
496
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
497
+ neuroExpertScript.onload = () => {
498
+ function tryAppend() {
499
+ const widgetsDiv = document.getElementById("dc-widgets");
500
+ if (widgetsDiv) {
501
+ widgetsDiv.appendChild(neuroExpertDiv);
502
+ window.initNeuroexpert({"projectId":"77fac9c9ad9811f0997f4641db830dfd","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
503
+ } else {
504
+ setTimeout(tryAppend, 50);
505
+ }
506
+ }
507
+ tryAppend();
508
+ };
509
+ document.body.appendChild(neuroExpertScript);
510
+ </script>
511
+ </body>
512
+ </html>"
513
+ `;
514
+
515
+ exports[`Skip html extension > Neuro-expert 13`] = `
516
+ "<!DOCTYPE html>
517
+ <html lang="ru" dir="ltr">
518
+ <head>
519
+ <meta charset="utf-8">
520
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
521
+ <base href="../" />
522
+ <title>Страница 2 | Нейроэксперт</title>
523
+ <link rel="canonical" href="ru/page2.html">
524
+ <link rel="alternate" href="en/page2.html" hreflang="en" />
525
+ <link rel="alternate" href="ru/page2.html" hreflang="ru" />
526
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
527
+ <meta http-equiv="Content-Security-Policy" content="script-src https://yastatic.net; connect-src https://browserweb.s3.mdst.yandex.net; frame-src https://expert.yandex.ru; font-src https://yastatic.net;">
528
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
529
+ </head>
530
+ <body class="g-root g-root_theme_light">
531
+ <div id="root"></div>
532
+ <script type="application/json" id="diplodoc-state">
533
+ {"data":{"leading":false,"html":"&lt;h2 id=\\"hesh\\"&gt;&lt;a href=\\"ru/page2.html#hesh\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;хэш&lt;/span&gt;&lt;/a&gt;хэш&lt;/h2&gt;/n&lt;p&gt;&lt;a href=\\"ru/folder/index.html\\"&gt;Ссылка&lt;/a&gt;&lt;br /&gt;/n&lt;a href=\\"https://example.com\\" target=\\"_blank\\" rel=\\"noreferrer noopener\\"&gt;Внешняя ссылка&lt;/a&gt;&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"en/page2.html","hreflang":"en"},{"href":"ru/page2.html","hreflang":"ru"}],"canonical":"ru/page2.html","vcsPath":"ru/page2.md"},"headings":[{"title":"хэш","href":"ru/page2.html#hesh","level":2}],"title":"Страница 2"},"router":{"pathname":"ru/page2","depth":2,"base":"../"},"lang":"ru","langs":["en","ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
534
+ </script>
535
+ <script type="application/javascript">
536
+ const data = document.querySelector('script#diplodoc-state');
537
+ window.__DATA__ = JSON.parse((function unescape(string) {
538
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
539
+ })(data.innerText));
540
+ window.STATIC_CONTENT = false;
541
+ </script>
542
+ <script type="application/javascript" defer src="ru/toc.js"></script>
543
+ <script type="application/javascript">
544
+ const neuroExpertScript = document.createElement('script');
545
+ neuroExpertScript.type = "module";
546
+ neuroExpertScript.src = "https://yastatic.net/s3/distribution/stardust/neuroexpert-widget/production/neuroexpert-widget.js";
547
+ const neuroExpertDiv = document.createElement("div");
548
+ neuroExpertDiv.id = "neuro-expert-widget";
549
+ neuroExpertDiv.className = "dc-neuro-expert-widget";
550
+ neuroExpertScript.onload = () => {
551
+ function tryAppend() {
552
+ const widgetsDiv = document.getElementById("dc-widgets");
553
+ if (widgetsDiv) {
554
+ widgetsDiv.appendChild(neuroExpertDiv);
555
+ window.initNeuroexpert({"projectId":"77fac9c9ad9811f0997f4641db830dfd","hasOutsideClick":true,"parentId":"neuro-expert-widget"});
556
+ } else {
557
+ setTimeout(tryAppend, 50);
558
+ }
559
+ }
560
+ tryAppend();
561
+ };
562
+ document.body.appendChild(neuroExpertScript);
563
+ </script>
564
+ </body>
565
+ </html>"
566
+ `;
567
+
568
+ exports[`Skip html extension > Neuro-expert 14`] = `"window.__DATA__.data.toc = {"title":"Нейроэксперт","href":"ru/index.html","items":[{"name":"Заголовок 1","href":"ru/page1.html","id":"UUID"},{"name":"Заголовок 2","href":"ru/page2.html","id":"UUID"},{"name":"Заголовок 3","href":"ru/folder/index.html","id":"UUID"},{"name":"Заголовок 4","href":"ru/index-test-html/index.html","id":"UUID"}],"path":"ru/toc.yaml","id":"UUID"};"`;
@@ -665,6 +665,77 @@ exports[`Translate command > do not filter files on extract > filelist 1`] = `
665
665
  ]"
666
666
  `;
667
667
 
668
+ exports[`Translate command > do not resolve liquid conditions if vars not specified and send content as is for extract > filelist 1`] = `
669
+ "[
670
+ "index.md.skl",
671
+ "index.md.xliff",
672
+ "toc.yaml.skl",
673
+ "toc.yaml.xliff"
674
+ ]"
675
+ `;
676
+
677
+ exports[`Translate command > do not resolve liquid conditions if vars not specified and send content as is for extract 1`] = `
678
+ "#|
679
+ ||
680
+ %%%0%%%
681
+ ||
682
+ ||
683
+ %%%1%%%{% endif %}
684
+ ||
685
+ |#"
686
+ `;
687
+
688
+ exports[`Translate command > do not resolve liquid conditions if vars not specified and send content as is for extract 2`] = `
689
+ "<?xml version="1.0" encoding="UTF-8"?>
690
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
691
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
692
+ <header>
693
+ <skeleton>
694
+ <external-file href="file.skl"></external-file>
695
+ </skeleton>
696
+ </header>
697
+ <body>
698
+ <trans-unit id="0">
699
+ <source xml:space="preserve"><g ctype="bold" equiv-text="**{{text}}**" id="g-1" x-begin="**" x-end="**">Заголовок</g></source>
700
+ </trans-unit>
701
+ <trans-unit id="1">
702
+ <source xml:space="preserve">Доступны в любом отчете в виде <g ctype="link" equiv-text="[{{text}}](../general/goals.md)" id="g-2" x-begin="[" x-end="](../general/goals.md)">целей</g>, а также в отчетах:<x ctype="lb" equiv-text="&amp;#10;" id="x-1"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;ru&quot; or tld == &quot;es&quot; or tld == &quot;pt&quot; or tld == &quot;com&quot; or tld == &quot;tr&quot; %}" id="x-2"/>- <g ctype="link" equiv-text="[{{text}}](../reports/ecommerce.md)" id="g-3" x-begin="[" x-end="](../reports/ecommerce.md)">электронной коммерции</g><x ctype="liquid_Literal" equiv-text="{% endif %}" id="x-3"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;zh&quot; %}" id="x-4"/>- электронной коммерции<x ctype="liquid_Literal" equiv-text="{% endif %}" id="x-5"/>;<x ctype="lb" equiv-text="&amp;#10;" id="x-6"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;ru&quot;%}" id="x-7"/>- <g ctype="link" equiv-text="[{{text}}](../data/user-params-data.md)" id="g-4" x-begin="[" x-end="](../data/user-params-data.md)">по параметрам посетителей</g><x ctype="liquid_Literal" equiv-text="{% endif %}" id="x-8"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;es&quot; or tld == &quot;pt&quot; or tld == &quot;com&quot; or tld == &quot;zh&quot; or tld == &quot;tr&quot; %}" id="x-9"/>- по параметрам посетителей<x ctype="liquid_Literal" equiv-text="{% endif %}" id="x-10"/>;<x ctype="lb" equiv-text="&amp;#10;" id="x-11"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;ru&quot; or tld == &quot;es&quot; or tld == &quot;pt&quot; or tld == &quot;com&quot; or tld == &quot;tr&quot; %}" id="x-12"/>- <g ctype="link" equiv-text="[{{text}}](../data/visit-params-data.md)" id="g-5" x-begin="[" x-end="](../data/visit-params-data.md)">по параметрам визитов</g><x ctype="liquid_Literal" equiv-text="{% endif %}" id="x-13"/><x ctype="liquid_Literal" equiv-text="{% if tld == &quot;zh&quot; %}" id="x-14"/>- по параметрам визитов</source>
703
+ </trans-unit>
704
+ </body>
705
+ </file>
706
+ </xliff>"
707
+ `;
708
+
709
+ exports[`Translate command > do not resolve liquid conditions if vars not specified and send content as is for extract 3`] = `
710
+ "title: '%%%0%%%'
711
+ href: index.md
712
+ items:
713
+ - name: '%%%1%%%'
714
+ href: index.md
715
+ "
716
+ `;
717
+
718
+ exports[`Translate command > do not resolve liquid conditions if vars not specified and send content as is for extract 4`] = `
719
+ "<?xml version="1.0" encoding="UTF-8"?>
720
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
721
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
722
+ <header>
723
+ <skeleton>
724
+ <external-file href="file.skl"></external-file>
725
+ </skeleton>
726
+ </header>
727
+ <body>
728
+ <trans-unit id="0">
729
+ <source xml:space="preserve">Conditions</source>
730
+ </trans-unit>
731
+ <trans-unit id="1">
732
+ <source xml:space="preserve">Example</source>
733
+ </trans-unit>
734
+ </body>
735
+ </file>
736
+ </xliff>"
737
+ `;
738
+
668
739
  exports[`Translate command > extract openapi spec files > filelist 1`] = `
669
740
  "[
670
741
  "openapi-spec.yaml.skl",
@@ -1261,6 +1332,89 @@ exports[`Translate command > filter files on extract with extra vars option > fi
1261
1332
  ]"
1262
1333
  `;
1263
1334
 
1335
+ exports[`Translate command > resolve liquid conditions if vars specified, liquid syntax will be deleted > filelist 1`] = `
1336
+ "[
1337
+ "index.md.skl",
1338
+ "index.md.xliff",
1339
+ "toc.yaml.skl",
1340
+ "toc.yaml.xliff"
1341
+ ]"
1342
+ `;
1343
+
1344
+ exports[`Translate command > resolve liquid conditions if vars specified, liquid syntax will be deleted 1`] = `
1345
+ "#|
1346
+ ||
1347
+ %%%0%%%
1348
+ ||
1349
+ ||
1350
+ %%%1%%%
1351
+ - %%%2%%%
1352
+ - %%%3%%%
1353
+ - %%%4%%%
1354
+ ||
1355
+ |#"
1356
+ `;
1357
+
1358
+ exports[`Translate command > resolve liquid conditions if vars specified, liquid syntax will be deleted 2`] = `
1359
+ "<?xml version="1.0" encoding="UTF-8"?>
1360
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
1361
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
1362
+ <header>
1363
+ <skeleton>
1364
+ <external-file href="file.skl"></external-file>
1365
+ </skeleton>
1366
+ </header>
1367
+ <body>
1368
+ <trans-unit id="0">
1369
+ <source xml:space="preserve"><g ctype="bold" equiv-text="**{{text}}**" id="g-1" x-begin="**" x-end="**">Заголовок</g></source>
1370
+ </trans-unit>
1371
+ <trans-unit id="1">
1372
+ <source xml:space="preserve">Доступны в любом отчете в виде <g ctype="link" equiv-text="[{{text}}](../general/goals.md)" id="g-2" x-begin="[" x-end="](../general/goals.md)">целей</g>, а также в отчетах:</source>
1373
+ </trans-unit>
1374
+ <trans-unit id="2">
1375
+ <source xml:space="preserve"><g ctype="link" equiv-text="[{{text}}](../reports/ecommerce.md)" id="g-3" x-begin="[" x-end="](../reports/ecommerce.md)">электронной коммерции</g>;</source>
1376
+ </trans-unit>
1377
+ <trans-unit id="3">
1378
+ <source xml:space="preserve"><g ctype="link" equiv-text="[{{text}}](../data/user-params-data.md)" id="g-4" x-begin="[" x-end="](../data/user-params-data.md)">по параметрам посетителей</g>;</source>
1379
+ </trans-unit>
1380
+ <trans-unit id="4">
1381
+ <source xml:space="preserve"><g ctype="link" equiv-text="[{{text}}](../data/visit-params-data.md)" id="g-5" x-begin="[" x-end="](../data/visit-params-data.md)">по параметрам визитов</g></source>
1382
+ </trans-unit>
1383
+ </body>
1384
+ </file>
1385
+ </xliff>"
1386
+ `;
1387
+
1388
+ exports[`Translate command > resolve liquid conditions if vars specified, liquid syntax will be deleted 3`] = `
1389
+ "title: '%%%0%%%'
1390
+ href: index.md
1391
+ items:
1392
+ - name: '%%%1%%%'
1393
+ href: index.md
1394
+ "
1395
+ `;
1396
+
1397
+ exports[`Translate command > resolve liquid conditions if vars specified, liquid syntax will be deleted 4`] = `
1398
+ "<?xml version="1.0" encoding="UTF-8"?>
1399
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
1400
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
1401
+ <header>
1402
+ <skeleton>
1403
+ <external-file href="file.skl"></external-file>
1404
+ </skeleton>
1405
+ </header>
1406
+ <body>
1407
+ <trans-unit id="0">
1408
+ <source xml:space="preserve">Conditions</source>
1409
+ </trans-unit>
1410
+ <trans-unit id="1">
1411
+ <source xml:space="preserve">Example</source>
1412
+ </trans-unit>
1413
+ </body>
1414
+ </file>
1415
+ </xliff>"
1416
+ `;
1417
+
1264
1418
  exports[`Translate command > test no-translate directive > filelist 1`] = `
1265
1419
  "[
1266
1420
  "index.md.skl",
@@ -0,0 +1,16 @@
1
+ import {describe, it} from 'vitest';
2
+
3
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
+
5
+ describe('Assets', () => {
6
+ it('Assets', async () => {
7
+ const {inputPath, outputPath} = getTestPaths('mocks/assets');
8
+
9
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
10
+ md2md: true,
11
+ md2html: false,
12
+ args: '-j2',
13
+ });
14
+ await compareDirectories(outputPath);
15
+ });
16
+ });
@@ -0,0 +1,16 @@
1
+ import {describe, it} from 'vitest';
2
+
3
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
+
5
+ describe('Skip html extension', () => {
6
+ it('Neuro-expert', async () => {
7
+ const {inputPath, outputPath} = getTestPaths('mocks/neuro-expert');
8
+
9
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
10
+ md2md: false,
11
+ md2html: true,
12
+ args: '-j2',
13
+ });
14
+ await compareDirectories(outputPath);
15
+ });
16
+ });
@@ -103,6 +103,30 @@ describe('Translate command', () => {
103
103
  },
104
104
  );
105
105
 
106
+ const conditions = {tld: 'ru'};
107
+ generateMapTestTemplate(
108
+ 'resolve liquid conditions if vars specified, liquid syntax will be deleted',
109
+ 'mocks/translation/conditions',
110
+ {
111
+ subcommand: 'extract',
112
+ source: 'ru-RU',
113
+ target: 'es-ES',
114
+ additionalArgs: `--vars ${JSON.stringify(conditions)}`,
115
+ },
116
+ false,
117
+ );
118
+
119
+ generateMapTestTemplate(
120
+ 'do not resolve liquid conditions if vars not specified and send content as is for extract',
121
+ 'mocks/translation/conditions',
122
+ {
123
+ subcommand: 'extract',
124
+ source: 'ru-RU',
125
+ target: 'es-ES',
126
+ },
127
+ false,
128
+ );
129
+
106
130
  generateMapTestTemplate(
107
131
  'test no-translate directive',
108
132
  'mocks/translation/no-translate',
@@ -0,0 +1 @@
1
+ allowHTML: true
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="currentColor" fill-rule="evenodd" d="M4.273 5h1.05l.36-.987.248-.684A.5.5 0 0 1 6.401 3h3.198a.5.5 0 0 1 .47.33l.249.683.359.987H12a1.5 1.5 0 0 1 1.5 1.5V11a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 11V6.5A1.5 1.5 0 0 1 4 5zM6.4 1.5a2 2 0 0 0-1.88 1.317l-.248.683H4a3 3 0 0 0-3 3V11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V6.5a3 3 0 0 0-3-3h-.273l-.248-.683A2 2 0 0 0 9.599 1.5zm3.099 7a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m1.5 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0" clip-rule="evenodd"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#5E81F8" fill-rule="evenodd" d="M6.26 15.109a4 4 0 0 0 3.48 0l.13-.063a2 2 0 0 0 1.13-1.8v-.468c0-1.352.776-2.557 1.54-3.673a5.5 5.5 0 1 0-9.08 0C4.224 10.221 5 11.425 5 12.778v.467a2 2 0 0 0 1.13 1.801zm2.828-1.35.13-.064a.5.5 0 0 0 .282-.45v-.467q0-.255.025-.5a5.33 5.33 0 0 1-3.05 0q.024.245.025.5v.467a.5.5 0 0 0 .282.45l.13.063a2.5 2.5 0 0 0 2.176.001m-4.39-5.501c.394.576.891 1.302 1.263 2.148a3.79 3.79 0 0 0 4.078 0c.372-.846.869-1.572 1.264-2.148a4 4 0 1 0-6.605 0" clip-rule="evenodd"/><path fill="#5E81F8" d="M8 3.5A.75.75 0 0 0 8 5a1 1 0 0 1 1 1 .75.75 0 0 0 1.5 0A2.5 2.5 0 0 0 8 3.5"/></svg>
@@ -0,0 +1,19 @@
1
+ # Header
2
+
3
+ ![_images/versions.png]
4
+
5
+ ::: page-constructor
6
+ blocks:
7
+ - type: 'basic-card'
8
+ title: 'Заголовок 1'
9
+ text: 'Текст 1 :::'
10
+ border: 'shadow'
11
+ controlPosition: 'content'
12
+ - type: 'basic-card'
13
+ title: 'Заголовок 2'
14
+ text: '![_images/camera.svg]'
15
+ border: 'shadow'
16
+ controlPosition: 'content'
17
+ image:
18
+ icon: '_images/icons/bulb.svg'
19
+ :::
@@ -0,0 +1,7 @@
1
+ blocks:
2
+ - type: 'basic-card'
3
+ title: 'Заголовок'
4
+ text: 'Текст'
5
+ border: 'shadow'
6
+ controlPosition: 'content'
7
+ image: '_images/mountain.jpg'
@@ -0,0 +1,7 @@
1
+ title: Assets
2
+ href: index.md
3
+
4
+ items:
5
+ - name: Title
6
+ href: page.yaml
7
+
@@ -0,0 +1,10 @@
1
+ allowHTML: true
2
+ langs: ['en','ru']
3
+
4
+ neuroExpert:
5
+ projectId:
6
+ en: none
7
+ ru: 77fac9c9ad9811f0997f4641db830dfd
8
+ default: 77fac9c9ad9811f0997f4641db830dfd
9
+ parentId: null
10
+ disabled: false
@@ -0,0 +1 @@
1
+ # Page 3
@@ -0,0 +1,4 @@
1
+ # Folder
2
+
3
+ [Link 1](../page1.md)
4
+ [Link 2](../page2.md)
@@ -0,0 +1,11 @@
1
+ ---
2
+ neuroExpert:
3
+ disabled: true
4
+ ---
5
+
6
+ # Header
7
+
8
+ Content
9
+
10
+ [Link 1](page1.md)
11
+ [Link 2](page2.md)
@@ -0,0 +1,8 @@
1
+ ---
2
+ neuroExpert:
3
+ parentId: neuro-expert-div
4
+ ---
5
+
6
+ # Page 1
7
+
8
+ [Link](page2.md#hash)
@@ -0,0 +1,6 @@
1
+ # Page 2
2
+
3
+ ## hash
4
+
5
+ [Link](./folder/index.md)
6
+ [External link](https://example.com)
@@ -0,0 +1,13 @@
1
+ title: Neuroexpert
2
+ href: index.md
3
+
4
+ items:
5
+ - name: Title 1
6
+ href: page1.md
7
+ - name: Title 2
8
+ href: page2.md
9
+ - name: Title 3
10
+ href: ./folder/index.md
11
+ - name: Title 4
12
+ href: ./index-test-html/index.md
13
+
@@ -0,0 +1 @@
1
+ # Страница 3
@@ -0,0 +1,4 @@
1
+ # Папка
2
+
3
+ [Ссылка 1](../page1.md)
4
+ [Ссылка 2](../page2.md)
@@ -0,0 +1,5 @@
1
+ # Хэдер
2
+
3
+ Контент
4
+
5
+ [Ссылка 1](page1.md)
@@ -0,0 +1,3 @@
1
+ # Страница 1
2
+
3
+ [Link](page2.md#hash)
@@ -0,0 +1,6 @@
1
+ # Страница 2
2
+
3
+ ## хэш
4
+
5
+ [Ссылка](./folder/index.md)
6
+ [Внешняя ссылка](https://example.com)
@@ -0,0 +1,12 @@
1
+ title: Нейроэксперт
2
+ href: index.md
3
+
4
+ items:
5
+ - name: Заголовок 1
6
+ href: page1.md
7
+ - name: Заголовок 2
8
+ href: page2.md
9
+ - name: Заголовок 3
10
+ href: ./folder/index.md
11
+ - name: Заголовок 4
12
+ href: ./index-test-html/index.md
@@ -0,0 +1,11 @@
1
+ #|
2
+ ||
3
+ **Заголовок**
4
+ ||
5
+ ||
6
+ Доступны в любом отчете в виде [целей](../general/goals.md), а также в отчетах:
7
+ {% if tld == "ru" or tld == "es" or tld == "pt" or tld == "com" or tld == "tr" %}- [электронной коммерции](../reports/ecommerce.md){% endif %}{% if tld == "zh" %}- электронной коммерции{% endif %};
8
+ {% if tld == "ru"%}- [по параметрам посетителей](../data/user-params-data.md){% endif %}{% if tld == "es" or tld == "pt" or tld == "com" or tld == "zh" or tld == "tr" %}- по параметрам посетителей{% endif %};
9
+ {% if tld == "ru" or tld == "es" or tld == "pt" or tld == "com" or tld == "tr" %}- [по параметрам визитов](../data/visit-params-data.md){% endif %}{% if tld == "zh" %}- по параметрам визитов{% endif %}
10
+ ||
11
+ |#
@@ -0,0 +1,5 @@
1
+ title: Conditions
2
+ href: index.md
3
+ items:
4
+ - name: Example
5
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.14.0",
3
+ "version": "5.15.0",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },