@diplodoc/cli-tests 5.15.0 → 5.15.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.
@@ -24,7 +24,7 @@ exports[`Pdf page mode > creates a pdf folder when the .yfm option is specified
24
24
  <body class="g-root g-root_theme_light">
25
25
  <div id="root"></div>
26
26
  <script type="application/json" id="diplodoc-state">
27
- {"data":{"leading":false,"html":"&lt;h2 data-original-article=\\"index.html\\"&gt;Header&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Content&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"#page1\\"&gt;Link 1&lt;/a&gt;&lt;br&gt;/n&lt;a href=\\"page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 data-original-article=\\"page1.html\\"&gt;Page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href=\\"page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension"},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
27
+ {"data":{"leading":false,"pdfTitlePages":{"content":"","pageCount":0},"html":"&lt;h2 data-original-article=\\"index.html\\"&gt;Header&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Content&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"#page1\\"&gt;Link 1&lt;/a&gt;&lt;br&gt;/n&lt;a href=\\"page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 data-original-article=\\"page1.html\\"&gt;Page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href=\\"page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension"},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
28
28
  </script>
29
29
  <script type="application/javascript">
30
30
  const data = document.querySelector('script#diplodoc-state');
@@ -38,7 +38,7 @@ exports[`Pdf page mode > creates a pdf folder when the .yfm option is specified
38
38
  </html>"
39
39
  `;
40
40
 
41
- exports[`Pdf page mode > creates a pdf folder when the .yfm option is specified 3`] = `"{"data":{"leading":false,"html":"<h2 data-original-article=\\"index.html\\">Header<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"></a></h2><p>Content</p>/n<p><a href=\\"#page1\\">Link 1</a><br>/n<a href=\\"page2.html\\">Link 2</a></p>/n<hr class=\\"yfm-page__delimeter\\"><h2 data-original-article=\\"page1.html\\">Page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"></a></h2><p><a href=\\"page2.html#hash\\">Link</a></p>/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension","toc":{"title":"Skip html extension","href":"index.html","items":[{"name":"Title 1","href":"page1.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"}},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}"`;
41
+ exports[`Pdf page mode > creates a pdf folder when the .yfm option is specified 3`] = `"{"data":{"leading":false,"pdfTitlePages":{"content":"","pageCount":0},"html":"<h2 data-original-article=\\"index.html\\">Header<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"></a></h2><p>Content</p>/n<p><a href=\\"#page1\\">Link 1</a><br>/n<a href=\\"page2.html\\">Link 2</a></p>/n<hr class=\\"yfm-page__delimeter\\"><h2 data-original-article=\\"page1.html\\">Page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"></a></h2><p><a href=\\"page2.html#hash\\">Link</a></p>/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension","toc":{"title":"Skip html extension","href":"index.html","items":[{"name":"Title 1","href":"page1.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"}},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}"`;
42
42
 
43
43
  exports[`Pdf page mode > creates a pdf folder when the --pdf flag is specified > filelist 1`] = `
44
44
  "[
@@ -64,7 +64,7 @@ exports[`Pdf page mode > creates a pdf folder when the --pdf flag is specified 2
64
64
  <body class="g-root g-root_theme_light">
65
65
  <div id="root"></div>
66
66
  <script type="application/json" id="diplodoc-state">
67
- {"data":{"leading":false,"html":"&lt;h2 data-original-article=\\"index.html\\"&gt;Header&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Content&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"#page1\\"&gt;Link 1&lt;/a&gt;&lt;br&gt;/n&lt;a href=\\"page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 id=\\"syntax_test_syntax-page\\" data-original-article=\\"syntax/test.html\\"&gt;&lt;a href=\\"#syntax_test_syntax-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Syntax page&lt;/span&gt;&lt;/a&gt;Syntax page&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#syntax_test\\" id=\\"syntax_test\\"&gt;&lt;/a&gt;&lt;/h2&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 data-original-article=\\"page1.html\\"&gt;Page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href=\\"page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n&lt;h4 id=\\"page1_include-link-page\\"&gt;&lt;a href=\\"#page1_include-link-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include link page&lt;/span&gt;&lt;/a&gt;Include link page&lt;/h4&gt;/n&lt;p&gt;&lt;a href=\\"#syntax_test\\"&gt;link&lt;/a&gt;&lt;/p&gt;/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension"},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
67
+ {"data":{"leading":false,"pdfTitlePages":{"content":"","pageCount":0},"html":"&lt;h2 data-original-article=\\"index.html\\"&gt;Header&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Content&lt;/p&gt;/n&lt;p&gt;&lt;a href=\\"#page1\\"&gt;Link 1&lt;/a&gt;&lt;br&gt;/n&lt;a href=\\"page2.html\\"&gt;Link 2&lt;/a&gt;&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 id=\\"syntax_test_syntax-page\\" data-original-article=\\"syntax/test.html\\"&gt;&lt;a href=\\"#syntax_test_syntax-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Syntax page&lt;/span&gt;&lt;/a&gt;Syntax page&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#syntax_test\\" id=\\"syntax_test\\"&gt;&lt;/a&gt;&lt;/h2&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 data-original-article=\\"page1.html\\"&gt;Page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href=\\"page2.html#hash\\"&gt;Link&lt;/a&gt;&lt;/p&gt;/n&lt;h4 id=\\"page1_include-link-page\\"&gt;&lt;a href=\\"#page1_include-link-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include link page&lt;/span&gt;&lt;/a&gt;Include link page&lt;/h4&gt;/n&lt;p&gt;&lt;a href=\\"#syntax_test\\"&gt;link&lt;/a&gt;&lt;/p&gt;/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension"},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
68
68
  </script>
69
69
  <script type="application/javascript">
70
70
  const data = document.querySelector('script#diplodoc-state');
@@ -78,4 +78,56 @@ exports[`Pdf page mode > creates a pdf folder when the --pdf flag is specified 2
78
78
  </html>"
79
79
  `;
80
80
 
81
- exports[`Pdf page mode > creates a pdf folder when the --pdf flag is specified 3`] = `"{"data":{"leading":false,"html":"<h2 data-original-article=\\"index.html\\">Header<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"></a></h2><p>Content</p>/n<p><a href=\\"#page1\\">Link 1</a><br>/n<a href=\\"page2.html\\">Link 2</a></p>/n<hr class=\\"yfm-page__delimeter\\"><h2 id=\\"syntax_test_syntax-page\\" data-original-article=\\"syntax/test.html\\"><a href=\\"#syntax_test_syntax-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Syntax page</span></a>Syntax page<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#syntax_test\\" id=\\"syntax_test\\"></a></h2>/n<hr class=\\"yfm-page__delimeter\\"><h2 data-original-article=\\"page1.html\\">Page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"></a></h2><p><a href=\\"page2.html#hash\\">Link</a></p>/n<h4 id=\\"page1_include-link-page\\"><a href=\\"#page1_include-link-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include link page</span></a>Include link page</h4>/n<p><a href=\\"#syntax_test\\">link</a></p>/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension","toc":{"title":"Skip html extension","href":"index.html","items":[{"name":"Syntax","href":"syntax/test.html","id":"UUID"},{"name":"Title 1","href":"page1.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"}},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}"`;
81
+ exports[`Pdf page mode > creates a pdf folder when the --pdf flag is specified 3`] = `"{"data":{"leading":false,"pdfTitlePages":{"content":"","pageCount":0},"html":"<h2 data-original-article=\\"index.html\\">Header<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#index\\" id=\\"index\\"></a></h2><p>Content</p>/n<p><a href=\\"#page1\\">Link 1</a><br>/n<a href=\\"page2.html\\">Link 2</a></p>/n<hr class=\\"yfm-page__delimeter\\"><h2 id=\\"syntax_test_syntax-page\\" data-original-article=\\"syntax/test.html\\"><a href=\\"#syntax_test_syntax-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Syntax page</span></a>Syntax page<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#syntax_test\\" id=\\"syntax_test\\"></a></h2>/n<hr class=\\"yfm-page__delimeter\\"><h2 data-original-article=\\"page1.html\\">Page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"></a></h2><p><a href=\\"page2.html#hash\\">Link</a></p>/n<h4 id=\\"page1_include-link-page\\"><a href=\\"#page1_include-link-page\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include link page</span></a>Include link page</h4>/n<p><a href=\\"#syntax_test\\">link</a></p>/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Skip html extension","toc":{"title":"Skip html extension","href":"index.html","items":[{"name":"Syntax","href":"syntax/test.html","id":"UUID"},{"name":"Title 1","href":"page1.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"}},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}"`;
82
+
83
+ exports[`Pdf page with titles > Generates content for pdf genrator with title pages > filelist 1`] = `
84
+ "[
85
+ "pdf-page-toc.js",
86
+ "pdf-page.html",
87
+ "pdf-page.json"
88
+ ]"
89
+ `;
90
+
91
+ exports[`Pdf page with titles > Generates content for pdf genrator with title pages 1`] = `"window.__DATA__.data.toc = {"title":"Pdf title pages","href":"#index","pdf":{"startPages":["./pdf-titles/pdf-title-page1.md","./pdf-titles/pdf-title-page2.md"]},"items":[{"name":"Title 1","href":"#page1","id":"UUID"},{"name":"Title 2","href":"#page2","id":"UUID"}],"path":"toc.yaml","id":"UUID"};"`;
92
+
93
+ exports[`Pdf page with titles > Generates content for pdf genrator with title pages 2`] = `
94
+ "<!DOCTYPE html>
95
+ <html lang="ru" dir="ltr">
96
+ <head>
97
+ <meta charset="utf-8">
98
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
99
+ <base href="./" />
100
+ <title>Pdf title pages | Pdf title pages</title>
101
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
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,"pdfTitlePages":{"content":"&lt;h2 id=\\"pdf-titles_pdf-title-page1_pdf-title-page-1\\" data-original-article=\\"./pdf-titles/pdf-title-page1.html\\"&gt;&lt;a href=\\"#pdf-titles_pdf-title-page1_pdf-title-page-1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Pdf title page 1&lt;/span&gt;&lt;/a&gt;Pdf title page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#pdf-titles_pdf-title-page1\\" id=\\"pdf-titles_pdf-title-page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;/n&lt;p&gt;Should be able to use variables pdf&lt;/p&gt;/n&lt;p&gt;Should be able to use link to other pages &lt;a href=\\"#page1\\"&gt;test&lt;/a&gt;&lt;/p&gt;/n&lt;p&gt;Should be able to use inlcudes&lt;/p&gt;/n&lt;h4 id=\\"pdf-titles_pdf-title-page1_include-pdf-title\\"&gt;&lt;a href=\\"#pdf-titles_pdf-title-page1_include-pdf-title\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Include Pdf title&lt;/span&gt;&lt;/a&gt;Include Pdf title&lt;/h4&gt;/n&lt;p&gt;Should be able to resolve liquid syntax&lt;/p&gt;/n&lt;p&gt;should be visible&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 id=\\"pdf-titles_pdf-title-page2_pdf-title-page-2\\" data-original-article=\\"./pdf-titles/pdf-title-page2.html\\"&gt;&lt;a href=\\"#pdf-titles_pdf-title-page2_pdf-title-page-2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"&gt;&lt;span class=\\"visually-hidden\\" data-no-index=\\"true\\"&gt;Pdf title page 2&lt;/span&gt;&lt;/a&gt;Pdf title page 2&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#pdf-titles_pdf-title-page2\\" id=\\"pdf-titles_pdf-title-page2\\"&gt;&lt;/a&gt;&lt;/h2&gt;/n&lt;style&gt;.pdf-title-page-wrapper {/n height: 400px;/n background-color: grey;/n}/n/nimg {/n width: 100px;/n height: 100px;/n}&lt;/style&gt;/n&lt;p&gt;&lt;img src=\\"../__images/mountain.jpg\\" alt&gt;&lt;/p&gt;/n&lt;div class=\\"pdf-title-page-wrapper\\"&gt;/n &lt;p&gt;Lorem ipsum title page with var pdf&lt;/p&gt;/n&lt;/div&gt;","pageCount":2},"html":"&lt;h2 data-original-article=\\"page1.html\\"&gt;Page 1&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Page 1 content&lt;/p&gt;/n&lt;hr class=\\"yfm-page__delimeter\\"&gt;&lt;h2 data-original-article=\\"page2.html\\"&gt;Page 2&lt;a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page2\\" id=\\"page2\\"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Page 2 content&lt;/p&gt;/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Pdf title pages"},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["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="pdf-page.html"></script>
117
+ </body>
118
+ </html>"
119
+ `;
120
+
121
+ exports[`Pdf page with titles > Generates content for pdf genrator with title pages 3`] = `"{"data":{"leading":false,"pdfTitlePages":{"content":"<h2 id=\\"pdf-titles_pdf-title-page1_pdf-title-page-1\\" data-original-article=\\"./pdf-titles/pdf-title-page1.html\\"><a href=\\"#pdf-titles_pdf-title-page1_pdf-title-page-1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Pdf title page 1</span></a>Pdf title page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#pdf-titles_pdf-title-page1\\" id=\\"pdf-titles_pdf-title-page1\\"></a></h2>/n<p>Should be able to use variables pdf</p>/n<p>Should be able to use link to other pages <a href=\\"#page1\\">test</a></p>/n<p>Should be able to use inlcudes</p>/n<h4 id=\\"pdf-titles_pdf-title-page1_include-pdf-title\\"><a href=\\"#pdf-titles_pdf-title-page1_include-pdf-title\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include Pdf title</span></a>Include Pdf title</h4>/n<p>Should be able to resolve liquid syntax</p>/n<p>should be visible</p>/n<hr class=\\"yfm-page__delimeter\\"><h2 id=\\"pdf-titles_pdf-title-page2_pdf-title-page-2\\" data-original-article=\\"./pdf-titles/pdf-title-page2.html\\"><a href=\\"#pdf-titles_pdf-title-page2_pdf-title-page-2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Pdf title page 2</span></a>Pdf title page 2<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#pdf-titles_pdf-title-page2\\" id=\\"pdf-titles_pdf-title-page2\\"></a></h2>/n<style>.pdf-title-page-wrapper {/n height: 400px;/n background-color: grey;/n}/n/nimg {/n width: 100px;/n height: 100px;/n}</style>/n<p><img src=\\"../__images/mountain.jpg\\" alt></p>/n<div class=\\"pdf-title-page-wrapper\\">/n <p>Lorem ipsum title page with var pdf</p>/n</div>","pageCount":2},"html":"<h2 data-original-article=\\"page1.html\\">Page 1<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page1\\" id=\\"page1\\"></a></h2><p>Page 1 content</p>/n<hr class=\\"yfm-page__delimeter\\"><h2 data-original-article=\\"page2.html\\">Page 2<a class=\\"yfm-anchor\\" aria-hidden=\\"true\\" href=\\"#page2\\" id=\\"page2\\"></a></h2><p>Page 2 content</p>/n","headings":[],"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"title":"Pdf title pages","toc":{"title":"Pdf title pages","href":"index.html","pdf":{"startPages":["./pdf-titles/pdf-title-page1.md","./pdf-titles/pdf-title-page2.md"]},"items":[{"name":"Title 1","href":"page1.html","id":"UUID"},{"name":"Title 2","href":"page2.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"}},"router":{"pathname":"pdf-page","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}"`;
122
+
123
+ exports[`Pdf page with titles > Generates pdf title pages as regular entries for debug purpose > filelist 1`] = `
124
+ "[
125
+ "__images/mountain.jpg",
126
+ "index.html",
127
+ "page1.html",
128
+ "page2.html",
129
+ "pdf-titles/pdf-title-page1.html",
130
+ "pdf-titles/pdf-title-page2.html",
131
+ "toc.js"
132
+ ]"
133
+ `;
@@ -1,8 +1,14 @@
1
1
  import {describe, test} from 'vitest';
2
2
 
3
- import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
3
+ import {TestAdapter, cleanupDirectory, compareDirectories, getTestPaths} from '../fixtures';
4
4
 
5
- const generateMapTestTemplate = (testTitle: string, testRootPath: string, args: string) => {
5
+ const generateMapTestTemplate = (
6
+ testTitle: string,
7
+ testRootPath: string,
8
+ args: string,
9
+ folder = 'pdf',
10
+ ignoreFileContent = false,
11
+ ) => {
6
12
  test(testTitle, async () => {
7
13
  const {inputPath, outputPath} = getTestPaths(testRootPath);
8
14
 
@@ -12,7 +18,8 @@ const generateMapTestTemplate = (testTitle: string, testRootPath: string, args:
12
18
  args,
13
19
  });
14
20
 
15
- await compareDirectories(`${outputPath}/pdf`);
21
+ await compareDirectories(`${outputPath}/${folder}`, ignoreFileContent);
22
+ await cleanupDirectory(outputPath);
16
23
  });
17
24
  };
18
25
 
@@ -29,3 +36,19 @@ describe('Pdf page mode', () => {
29
36
  '-j2',
30
37
  );
31
38
  });
39
+
40
+ describe('Pdf page with titles', () => {
41
+ generateMapTestTemplate(
42
+ 'Generates content for pdf genrator with title pages',
43
+ 'mocks/pdf-page/title-pages',
44
+ '--pdf',
45
+ );
46
+
47
+ generateMapTestTemplate(
48
+ 'Generates pdf title pages as regular entries for debug purpose',
49
+ 'mocks/pdf-page/title-pages',
50
+ '--pdf-debug',
51
+ '',
52
+ true,
53
+ );
54
+ });
@@ -0,0 +1 @@
1
+ ### Include Pdf title
@@ -0,0 +1 @@
1
+ # PDF mock index
@@ -0,0 +1,3 @@
1
+ # Page 1
2
+
3
+ Page 1 content
@@ -0,0 +1,3 @@
1
+ # Page 2
2
+
3
+ Page 2 content
@@ -0,0 +1,13 @@
1
+ ### Pdf title page 1
2
+
3
+ Should be able to use variables {{test}}
4
+
5
+ Should be able to use link to other pages [test](../page1.md)
6
+
7
+ Should be able to use inlcudes
8
+
9
+ {% include [test-include](../__includes/include1.md) %}
10
+
11
+ Should be able to resolve liquid syntax
12
+
13
+ {% if test == "pdf" %} should be visible {% endif %}
@@ -0,0 +1,18 @@
1
+ ### Pdf title page 2
2
+
3
+ <style>
4
+ .pdf-title-page-wrapper {
5
+ height: 400px;
6
+ background-color: grey
7
+ }
8
+
9
+ img {
10
+ width: 100px;
11
+ height: 100px;
12
+ }
13
+ </style>
14
+
15
+ ![](../__images/mountain.jpg)
16
+ <div class="pdf-title-page-wrapper">
17
+ <p>Lorem ipsum title page with var {{test}}</p>
18
+ </div>
@@ -0,0 +1,2 @@
1
+ default:
2
+ test: pdf
@@ -0,0 +1,12 @@
1
+ title: Pdf title pages
2
+ href: index.md
3
+ pdf:
4
+ startPages:
5
+ - ./pdf-titles/pdf-title-page1.md
6
+ - ./pdf-titles/pdf-title-page2.md
7
+
8
+ items:
9
+ - name: Title 1
10
+ href: page1.md
11
+ - name: Title 2
12
+ href: page2.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.15.0",
3
+ "version": "5.15.1",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },