@diplodoc/cli-tests 5.0.11 → 5.0.12

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.
@@ -0,0 +1,70 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Local search > internal > filelist 1`] = `
4
+ "[
5
+ "_bundle/search-async-1",
6
+ "_bundle/search-async-0",
7
+ "_bundle/app-css-1",
8
+ "_bundle/app-js-1",
9
+ "_bundle/app-css-3",
10
+ "_bundle/latex-extension.css",
11
+ "_bundle/latex-extension.js",
12
+ "_bundle/mermaid-extension.js",
13
+ "_bundle/page-constructor-extension.css",
14
+ "_bundle/page-constructor-extension.js",
15
+ "_bundle/search-js-0",
16
+ "_bundle/search-css-0",
17
+ "_bundle/search-js-1",
18
+ "_bundle/search-css-3",
19
+ "_bundle/search-css-1",
20
+ "_bundle/search-js-2",
21
+ "_bundle/search-css-2",
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",
28
+ "index.html",
29
+ "toc.js"
30
+ ]"
31
+ `;
32
+
33
+ exports[`Local search > internal 1`] = `
34
+ "<!DOCTYPE html>
35
+ <html lang="ru" dir="ltr">
36
+ <head>
37
+ <meta charset="utf-8">
38
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
39
+ <base href="./" />
40
+ <title>Header</title>
41
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
42
+
43
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
44
+
45
+ <link type="text/css" rel="stylesheet" href="_bundle/search-css-1"/>
46
+ <link type="text/css" rel="stylesheet" href="_bundle/app-css-1"/>
47
+ </head>
48
+ <body class="g-root g-root_theme_light">
49
+ <div id="root"></div>
50
+ <script type="application/json" id="diplodoc-state">
51
+ {"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"],"search":{"enabled":true,"provider":"local","api":"_search/api.js","link":"_search/ru/index.html"}}
52
+ </script>
53
+ <script type="application/javascript">
54
+ const data = document.querySelector('script#diplodoc-state');
55
+ window.__DATA__ = JSON.parse((function unescape(string) {
56
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
57
+ })(data.innerText));
58
+ window.STATIC_CONTENT = false;
59
+ </script>
60
+ <script type="application/javascript" defer src="toc.js"></script>
61
+ <script type="application/javascript" defer src="_search/ru/hash-resources.js"></script>
62
+ <script type="application/javascript" defer src="_bundle/search-js-0"></script>
63
+ <script type="application/javascript" defer src="_bundle/app-js-1"></script>
64
+ <script type="application/javascript" defer src="_bundle/search-js-2"></script>
65
+
66
+ </body>
67
+ </html>"
68
+ `;
69
+
70
+ exports[`Local search > internal 2`] = `"window.__DATA__.data.toc = {"href":"index.html","path":"toc.yaml","id":"UUID"};"`;
@@ -0,0 +1,15 @@
1
+ import {describe, it} from 'vitest';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
3
+
4
+ describe('Local search', () => {
5
+ it('internal', async () => {
6
+ const {inputPath, outputPath} = getTestPaths('mocks/search');
7
+
8
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
9
+ md2md: false,
10
+ md2html: true,
11
+ args: '-j2 --search',
12
+ });
13
+ await compareDirectories(outputPath);
14
+ });
15
+ });
@@ -11,6 +11,7 @@ export function platformless(text: string): string {
11
11
  export function hashless(text: string): string {
12
12
  return text
13
13
  .replace(/-[a-z0-9]{12}\./g, '-hash.')
14
+ .replace(/(\/|\\)[a-z0-9]{12,13}-(index|registry|resources)\./g, '/hash-$2.');
14
15
  }
15
16
 
16
17
  export function bundleless(text: string): string {
@@ -0,0 +1,3 @@
1
+ # Header
2
+
3
+ Content
@@ -0,0 +1 @@
1
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.0.11",
3
+ "version": "5.0.12",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },