@diplodoc/cli-tests 5.4.1 → 5.5.1

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.
@@ -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",
@@ -2,7 +2,6 @@
2
2
 
3
3
  exports[`Allow load custom resources > md2html with metadata > filelist 1`] = `
4
4
  "[
5
- "_bundle/search-async-1",
6
5
  "_bundle/search-async-0",
7
6
  "_bundle/app-css-1",
8
7
  "_bundle/app-js-1",
@@ -258,7 +258,9 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true > filelist 1`] = `
258
258
  "included-item.md",
259
259
  "includes.md",
260
260
  "includes/deep-hash.md",
261
+ "includes/deepWithIndent-hash.md",
261
262
  "includes/sub/user-hash.md",
263
+ "includes/sub/userWithIndent-hash.md",
262
264
  "includes/test-hash.md",
263
265
  "includes/user-hash.md",
264
266
  "latex.md",
@@ -397,6 +399,10 @@ Link after include
397
399
  <!--{% include [For includes/deep.md](includes/deep.md) %}-->
398
400
  {% include [For includes/deep-hash.md](includes/deep-hash.md) %}
399
401
 
402
+ Include with big indent
403
+
404
+ {% include [For includes/deep.md](includes/deepWithIndent-hash.md) %}
405
+
400
406
  Link after include
401
407
  [Subtitle](./1.md#subtitle)
402
408
  "
@@ -408,21 +414,38 @@ exports[`Preprocess > HashIncludes=true,Autotitles=true 7`] = `
408
414
  `;
409
415
 
410
416
  exports[`Preprocess > HashIncludes=true,Autotitles=true 8`] = `
417
+ "- list item
418
+
419
+ {% include [user](./sub/userWithIndent-hash.md) %}
420
+
421
+ Link to mermaid diagram from 1 level
422
+ [Mermaid usage](../mermaid.md)"
423
+ `;
424
+
425
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 9`] = `
411
426
  "Bob
412
427
  "
413
428
  `;
414
429
 
415
- exports[`Preprocess > HashIncludes=true,Autotitles=true 9`] = `
430
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 10`] = `
431
+ "Link to mermaid diagram from 2 level
432
+ [Mermaid usage](../../mermaid.md)
433
+
434
+ - User
435
+ Bob"
436
+ `;
437
+
438
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 11`] = `
416
439
  "Test
417
440
  "
418
441
  `;
419
442
 
420
- exports[`Preprocess > HashIncludes=true,Autotitles=true 10`] = `
443
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 12`] = `
421
444
  "Bob
422
445
  "
423
446
  `;
424
447
 
425
- exports[`Preprocess > HashIncludes=true,Autotitles=true 11`] = `
448
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 13`] = `
426
449
  "---
427
450
  metadata:
428
451
  - name: generator
@@ -434,7 +457,7 @@ $/sqrt{3x-1}+(1+x)^2$
434
457
  "
435
458
  `;
436
459
 
437
- exports[`Preprocess > HashIncludes=true,Autotitles=true 12`] = `
460
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 14`] = `
438
461
  "---
439
462
  metadata:
440
463
  - name: generator
@@ -456,7 +479,7 @@ Some mermaid info
456
479
  "
457
480
  `;
458
481
 
459
- exports[`Preprocess > HashIncludes=true,Autotitles=true 13`] = `
482
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 15`] = `
460
483
  "---
461
484
  metadata:
462
485
  - name: generator
@@ -470,7 +493,7 @@ Item 1 text
470
493
  "
471
494
  `;
472
495
 
473
- exports[`Preprocess > HashIncludes=true,Autotitles=true 14`] = `
496
+ exports[`Preprocess > HashIncludes=true,Autotitles=true 16`] = `
474
497
  "items:
475
498
  - name: Md item with not_var syntax
476
499
  href: 1.md
@@ -45,7 +45,6 @@ exports[`Regression > internal > filelist 2`] = `
45
45
  "_assets/3.png",
46
46
  "_assets/5_1.png",
47
47
  "_assets/empty.pdf",
48
- "_bundle/search-async-1",
49
48
  "_bundle/search-async-0",
50
49
  "_bundle/app-css-1",
51
50
  "_bundle/app-js-1",
@@ -237,7 +236,8 @@ metadata:
237
236
  <!-- ![commented](_assets/4.png) -->
238
237
 
239
238
  ![with backslash](_assets/5/_1.png)
240
- "
239
+
240
+ [![img 3](_assets/3.png)](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
+ [![img 3](../_assets/3.png)](../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":"&lt;p&gt;&lt;img src=\\"_assets/1.png\\" alt=\\"simple image\\" /&gt;&lt;/p&gt;/n![with leading comment](_assets/2.png)/n&lt;p&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /&gt;&lt;/p&gt;/n/n&lt;p&gt;&lt;img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /&gt;&lt;/p&gt;/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":"&lt;p&gt;&lt;img src=\\"_assets/1.png\\" alt=\\"simple image\\" /&gt;&lt;/p&gt;/n![with leading comment](_assets/2.png)/n&lt;p&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /&gt;&lt;/p&gt;/n/n&lt;p&gt;&lt;img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /&gt;&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"latex.html\\"&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"img 3\\" /&gt;&lt;/a&gt;&lt;/p&gt;/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":"&lt;p&gt;Text&lt;/p&gt;/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;Test&lt;/p&gt;/n/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;Link after include&lt;br /&gt;/n&lt;a href=\\"1.html#subtitle\\"&gt;Subtitle&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Link after include&lt;/p&gt;/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":"&lt;p&gt;Text&lt;/p&gt;/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;Test&lt;/p&gt;/n/n&lt;p&gt;Bob&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"../latex.html\\"&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"img 3\\" /&gt;&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Link after include&lt;br /&gt;/n&lt;a href=\\"1.html#subtitle\\"&gt;Subtitle&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Link after include&lt;/p&gt;/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
- "_bundle/search-async-1",
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/ru/hash-index.js",
24
- "_search/ru/hash-resources.js",
25
- "_search/ru/hash-registry.js",
26
- "_search/ru/index.html",
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="ru" dir="ltr">
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":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Header"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{},"search":{"enabled":true,"provider":"local","api":"_search/api.js","link":"_search/ru/index.html"}}
66
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/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/ru/hash-resources.js"></script>
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 2`] = `"window.__DATA__.data.toc = {"href":"index.html","path":"toc.yaml","id":"UUID"};"`;
85
+ exports[`Local search > internal 3`] = `"window.__DATA__.data.toc = {"href":"index.html","path":"toc.yaml","id":"UUID"};"`;
@@ -13,7 +13,7 @@ function test(path: string, expect: Function) {
13
13
  const {inputPath, outputPath} = getTestPaths(path);
14
14
 
15
15
  const md = await TestAdapter.build.run(inputPath, outputPath, ['-j2', '-f', 'md']);
16
- const html = await TestAdapter.build.run(outputPath, outputPath + '-html', ['-j2', '-f', 'html']);
16
+ const html = await TestAdapter.build.run(inputPath, outputPath + '-html', ['-j2', '-f', 'html']);
17
17
 
18
18
  return expect({md, html});
19
19
  });
@@ -2,9 +2,8 @@ export type Report = {
2
2
  code: number;
3
3
  warns: string[];
4
4
  errors: string[];
5
- }
5
+ };
6
6
 
7
7
  export interface Runner {
8
8
  runYfmDocs(argv: string[]): Promise<Report>;
9
9
  }
10
-
@@ -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(/(content"?[:=]{1}[" ]{1}Diplodoc.*? )v\d+\.\d+\.\d+(?:-[\w-]+)?/g, `$1vDIPLODOC-VERSION`)
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
 
@@ -0,0 +1,6 @@
1
+ - list item
2
+
3
+ {% include [user](./sub/userWithIndent.md) %}
4
+
5
+ Link to mermaid diagram from 1 level
6
+ [](../mermaid.md)
@@ -0,0 +1,5 @@
1
+ Link to mermaid diagram from 2 level
2
+ [](../../mermaid.md)
3
+
4
+ - User
5
+ {{user}}
@@ -10,5 +10,9 @@ Link after include
10
10
  <!--{% include [For includes/deep.md](includes/deep.md) %}-->
11
11
  {% include [For includes/deep.md](includes/deep.md) %}
12
12
 
13
+ Include with big indent
14
+
15
+ {% include [For includes/deep.md](includes/deepWithIndent.md) %}
16
+
13
17
  Link after include
14
18
  [{#T}](./1.md#subtitle)
@@ -9,3 +9,5 @@
9
9
  <!-- ![commented](_assets/4.png) -->
10
10
 
11
11
  ![with backslash](_assets/5\_1.png)
12
+
13
+ [![img 3](_assets/{{img_3}})](latex.md)
@@ -1 +1,3 @@
1
1
  {% include [user](./user.md) %}
2
+
3
+ [![img 3](../_assets/{{img_3}})](../latex.md)
@@ -1,2 +1,3 @@
1
1
  default:
2
2
  user: Alice
3
+ img_3: 4.png
@@ -3,6 +3,7 @@ default:
3
3
  not-var: not-var-value
4
4
  product: root
5
5
  user: Bob
6
+ img_3: 3.png
6
7
 
7
8
  internal:
8
9
  default-var: default-var-internal-value
@@ -0,0 +1,12 @@
1
+ allowHTML: true
2
+ langs: ['en','ru']
3
+
4
+ interface:
5
+ toc-header: false
6
+ favicon-src: https://storage.yandexcloud.net/diplodoc-www-assets/favicon/favicon.ico
7
+
8
+ search:
9
+ provider: local
10
+ tolerance: 2
11
+ confidense: phrased
12
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.4.1",
3
+ "version": "5.5.1",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
@@ -27,7 +27,7 @@
27
27
  "@diplodoc/cli": "file:.."
28
28
  },
29
29
  "dependencies": {
30
- "@diplodoc/client": "^3.6.3",
30
+ "@diplodoc/client": "^3.9.0",
31
31
  "@types/node": "18.x",
32
32
  "@vitest/coverage-istanbul": "^3.1.1",
33
33
  "@vitest/coverage-v8": "^3.1.1",