@diplodoc/cli-tests 5.22.3 → 5.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/e2e/__snapshots__/includes.test.ts.snap +10 -2
- package/e2e/__snapshots__/translation.spec.ts.snap +17 -4
- package/e2e/nested-include-links.spec.ts +26 -0
- package/e2e/translation.spec.ts +10 -0
- package/mocks/includes/input/index.md +8 -1
- package/mocks/nested-include-links/input/includes/middle.md +4 -0
- package/mocks/nested-include-links/input/other/page.md +4 -0
- package/mocks/nested-include-links/input/sub/deep/entry.md +8 -0
- package/mocks/nested-include-links/input/target.md +4 -0
- package/mocks/nested-include-links/input/toc.yaml +6 -0
- package/mocks/translation/toc-include/input/included-toc/merged-included-toc-item.md +1 -0
- package/mocks/translation/toc-include/input/included-toc/toc.yaml +3 -0
- package/mocks/translation/toc-include/input/included-toc.md +1 -0
- package/mocks/translation/toc-include/input/index.md +7 -0
- package/mocks/translation/toc-include/input/merged-included-toc-item.md +1 -0
- package/mocks/translation/toc-include/input/no-translate.md +57 -0
- package/mocks/translation/toc-include/input/openapi-spec.yaml +37 -0
- package/mocks/translation/toc-include/input/toc.yaml +14 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -197,7 +197,15 @@ This is a test page for various include scenarios.
|
|
|
197
197
|
{% include [user](includes/user-hash.md) %}
|
|
198
198
|
## Include without title
|
|
199
199
|
|
|
200
|
-
{% include [no-title-include](includes/no-title-include-hash.md) %}
|
|
200
|
+
{% include [no-title-include](includes/no-title-include-hash.md) %}
|
|
201
|
+
|
|
202
|
+
## Include with anchor {#anchor}
|
|
203
|
+
|
|
204
|
+
{% include notitle [anchor](#anchor) %}
|
|
205
|
+
{% include [anchor](#anchor) %}
|
|
206
|
+
|
|
207
|
+
{% include [no-title-include](includes/no-title-include-hash.md#anchor) %}
|
|
208
|
+
"
|
|
201
209
|
`;
|
|
202
210
|
|
|
203
211
|
exports[`Includes > Various include scenarios 9`] = `
|
|
@@ -381,7 +389,7 @@ exports[`Includes > Various include scenarios 17`] = `
|
|
|
381
389
|
<body class="g-root g-root_theme_light">
|
|
382
390
|
<div id="root"></div>
|
|
383
391
|
<script type="application/json" id="diplodoc-state">
|
|
384
|
-
{"data":{"leading":false,"html":"<p>This is a test page for various include scenarios.</p>/n<h2 id=\\"include-from-root-level\\"><a href=\\"index.html#include-from-root-level\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from root level</span></a>Include from root level</h2>/n<p>This is an include from the root level.</p>/n<p><a href=\\"level1/page1.html\\">Link to level1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<h2 id=\\"include-with-anchor\\"><a href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → level1</span></a>Include with anchor <a href=\\"level1/page1.html\\">→ level1</a></h2>/n<h2 id=\\"section2\\"><a href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 2</span></a>Section 2</h2>/n<p>This is content of section 2.</p>/n<h3 id=\\"subsection21\\"><a href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-from-level1\\"><a href=\\"index.html#include-from-level1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from level1</span></a>Include from level1</h2>/n<p>This is an include from level 1.</p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor1\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → root</span></a>Include with anchor <a href=\\"index.html\\">→ root</a></h2>/n<h3 id=\\"subsection211\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-from-level2\\"><a href=\\"index.html#include-from-level2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from level2</span></a>Include from level2</h2>/n<p>This is an include from level 2.</p>/n<p><a href=\\"level1/level2/page2.html\\">Link to page2</a></p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<h2 id=\\"include-with-anchor2\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → level1</span></a>Include with anchor <a href=\\"level1/page1.html\\">→ level1</a></h2>/n<h2 id=\\"section3\\"><a href=\\"index.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 3</span></a>Section 3</h2>/n<p>This is content of section 3.</p>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<p>Some paragraph without anchor</p>/n<p id=\\"p2\\">Some paragraph with anchor</p>/n<h2 id=\\"include-with-missing-file\\"><a href=\\"index.html#include-with-missing-file\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with missing file</span></a>Include with missing file</h2>/n/n<h2 id=\\"include-file-that-is-in-toc\\"><a href=\\"index.html#include-file-that-is-in-toc\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include file that is in toc</span></a>Include file that is in toc</h2>/n<p><a href=\\"toc-include.html\\">Link to toc-include</a></p>/n<h1>Toc Include</h1>/n<p>This file is included in the toc.</p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to page2</a></p>/n<h2 id=\\"include-with-anchor3\\"><a href=\\"index.html#include-with-anchor3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor</span></a>Include with anchor</h2>/n<h2 id=\\"section1\\"><a href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 1</span></a>Section 1</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"links-to-different-levels\\"><a href=\\"index.html#links-to-different-levels\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Links to different levels</span></a>Links to different levels</h2>/n<p><a href=\\"level1/page1.html\\">Link to level1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor4\\"><a href=\\"index.html#include-with-anchor4\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor</span></a>Include with anchor</h2>/n<h2 id=\\"section11\\"><a id=\\"section1\\" href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 1</span></a>Section 1</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"include-with-multiple-anchors\\"><a href=\\"index.html#include-with-multiple-anchors\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with multiple anchors</span></a>Include with multiple anchors</h2>/n<h2 id=\\"section21\\"><a id=\\"section2\\" href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 2</span></a>Section 2</h2>/n<p>This is content of section 2.</p>/n<h3 id=\\"subsection212\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-with-paragraph-anchor\\"><a href=\\"index.html#include-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with paragraph anchor</span></a>Include with paragraph anchor</h2>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<h2 id=\\"nested-includes\\"><a href=\\"index.html#nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Nested includes</span></a>Nested includes</h2>/n<h1 id=\\"nested-include\\">Nested include <a href=\\"index.html\\">→ index</a></h1>/n<p>This is a nested include.</p>/n<p>This is an include from level 1.</p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor5\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → root</span></a>Include with anchor <a href=\\"index.html\\">→ root</a></h2>/n<h3 id=\\"subsection213\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"deep-nested-includes\\"><a href=\\"index.html#deep-nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Deep nested includes</span></a>Deep nested includes</h2>/n<h1 id=\\"deep-nested-include\\">Deep nested include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/page1.html\\">Link to level1 page1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2 page2</a></p>/n<p>This is a deep nested include.</p>/n<h1 id=\\"user-include\\">User include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<p><img src=\\"_assets/4.png\\" alt=\\"img 3\\" /></p>/n<h2 id=\\"commented-includes\\"><a href=\\"index.html#commented-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Commented includes</span></a>Commented includes</h2>/n/n<h2 id=\\"include-with-variable-substitution\\"><a href=\\"index.html#include-with-variable-substitution\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with variable substitution</span></a>Include with variable substitution</h2>/n<h1 id=\\"user-include\\">User include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<h2 id=\\"include-without-title\\"><a href=\\"index.html#include-without-title\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title</span></a>Include without title</h2>/n<h1 id=\\"include-without-title\\">Include without title <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a test for include without title.</p>/n<h2 id=\\"include-without-title-from-the-same-directory\\"><a href=\\"index.html#include-without-title-from-the-same-directory\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title from the same directory</span></a>Include without title from the same directory</h2>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<h2 id=\\"include-without-title-with-anchor\\"><a href=\\"index.html#include-without-title-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title with anchor</span></a>Include without title with anchor</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"include-without-title-with-paragraph-anchor\\"><a href=\\"index.html#include-without-title-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title with paragraph anchor</span></a>Include without title with paragraph anchor</h2>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"},"headings":[{"title":"Include from root level","href":"index.html#include-from-root-level","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor","level":2},{"title":"Section 2","href":"index.html#section2","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection21","level":3}]},{"title":"Include from level1","href":"index.html#include-from-level1","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor1","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection211","level":3}]},{"title":"Include from level2","href":"index.html#include-from-level2","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor2","level":2},{"title":"Section 3","href":"index.html#section3","level":2},{"title":"Include with missing file","href":"index.html#include-with-missing-file","level":2},{"title":"Include file that is in toc","href":"index.html#include-file-that-is-in-toc","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor3","level":2},{"title":"Section 1","href":"index.html#section1","level":2},{"title":"Links to different levels","href":"index.html#links-to-different-levels","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor4","level":2},{"title":"Section 1","href":"index.html#section11","level":2},{"title":"Include with multiple anchors","href":"index.html#include-with-multiple-anchors","level":2},{"title":"Section 2","href":"index.html#section21","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection212","level":3}]},{"title":"Include with paragraph anchor","href":"index.html#include-with-paragraph-anchor","level":2},{"title":"Nested includes","href":"index.html#nested-includes","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor5","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection213","level":3}]},{"title":"Deep nested includes","href":"index.html#deep-nested-includes","level":2},{"title":"Commented includes","href":"index.html#commented-includes","level":2},{"title":"Include with variable substitution","href":"index.html#include-with-variable-substitution","level":2},{"title":"Include without title","href":"index.html#include-without-title","level":2},{"title":"Include without title from the same directory","href":"index.html#include-without-title-from-the-same-directory","level":2},{"title":"Include without title with anchor","href":"index.html#include-without-title-with-anchor","level":2},{"title":"Include without title with paragraph anchor","href":"index.html#include-without-title-with-paragraph-anchor","level":2}],"title":"Test Includes"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
392
|
+
{"data":{"leading":false,"html":"<p>This is a test page for various include scenarios.</p>/n<h2 id=\\"include-from-root-level\\"><a href=\\"index.html#include-from-root-level\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from root level</span></a>Include from root level</h2>/n<p>This is an include from the root level.</p>/n<p><a href=\\"level1/page1.html\\">Link to level1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<h2 id=\\"include-with-anchor\\"><a href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → level1</span></a>Include with anchor <a href=\\"level1/page1.html\\">→ level1</a></h2>/n<h2 id=\\"section2\\"><a href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 2</span></a>Section 2</h2>/n<p>This is content of section 2.</p>/n<h3 id=\\"subsection21\\"><a href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-from-level1\\"><a href=\\"index.html#include-from-level1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from level1</span></a>Include from level1</h2>/n<p>This is an include from level 1.</p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor1\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → root</span></a>Include with anchor <a href=\\"index.html\\">→ root</a></h2>/n<h3 id=\\"subsection211\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-from-level2\\"><a href=\\"index.html#include-from-level2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include from level2</span></a>Include from level2</h2>/n<p>This is an include from level 2.</p>/n<p><a href=\\"level1/level2/page2.html\\">Link to page2</a></p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<h2 id=\\"include-with-anchor2\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → level1</span></a>Include with anchor <a href=\\"level1/page1.html\\">→ level1</a></h2>/n<h2 id=\\"section3\\"><a href=\\"index.html#section3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 3</span></a>Section 3</h2>/n<p>This is content of section 3.</p>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<p>Some paragraph without anchor</p>/n<p id=\\"p2\\">Some paragraph with anchor</p>/n<h2 id=\\"include-with-missing-file\\"><a href=\\"index.html#include-with-missing-file\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with missing file</span></a>Include with missing file</h2>/n/n<h2 id=\\"include-file-that-is-in-toc\\"><a href=\\"index.html#include-file-that-is-in-toc\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include file that is in toc</span></a>Include file that is in toc</h2>/n<p><a href=\\"toc-include.html\\">Link to toc-include</a></p>/n<h1>Toc Include</h1>/n<p>This file is included in the toc.</p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to page2</a></p>/n<h2 id=\\"include-with-anchor3\\"><a href=\\"index.html#include-with-anchor3\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor</span></a>Include with anchor</h2>/n<h2 id=\\"section1\\"><a href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 1</span></a>Section 1</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"links-to-different-levels\\"><a href=\\"index.html#links-to-different-levels\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Links to different levels</span></a>Links to different levels</h2>/n<p><a href=\\"level1/page1.html\\">Link to level1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor4\\"><a href=\\"index.html#include-with-anchor4\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor</span></a>Include with anchor</h2>/n<h2 id=\\"section11\\"><a id=\\"section1\\" href=\\"index.html#section1\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 1</span></a>Section 1</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"include-with-multiple-anchors\\"><a href=\\"index.html#include-with-multiple-anchors\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with multiple anchors</span></a>Include with multiple anchors</h2>/n<h2 id=\\"section21\\"><a id=\\"section2\\" href=\\"index.html#section2\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Section 2</span></a>Section 2</h2>/n<p>This is content of section 2.</p>/n<h3 id=\\"subsection212\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"include-with-paragraph-anchor\\"><a href=\\"index.html#include-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with paragraph anchor</span></a>Include with paragraph anchor</h2>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<h2 id=\\"nested-includes\\"><a href=\\"index.html#nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Nested includes</span></a>Nested includes</h2>/n<h1 id=\\"nested-include\\">Nested include <a href=\\"index.html\\">→ index</a></h1>/n<p>This is a nested include.</p>/n<p>This is an include from level 1.</p>/n<p><a href=\\"level1/page1.html\\">Link to page1</a></p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2</a></p>/n<h2 id=\\"include-with-anchor5\\"><a id=\\"include-with-anchor\\" href=\\"index.html#include-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor → root</span></a>Include with anchor <a href=\\"index.html\\">→ root</a></h2>/n<h3 id=\\"subsection213\\"><a id=\\"subsection21\\" href=\\"index.html#subsection21\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Subsection 2.1</span></a>Subsection 2.1</h3>/n<p>This is content of subsection 2.1.</p>/n<h2 id=\\"deep-nested-includes\\"><a href=\\"index.html#deep-nested-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Deep nested includes</span></a>Deep nested includes</h2>/n<h1 id=\\"deep-nested-include\\">Deep nested include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p><a href=\\"level1/page1.html\\">Link to level1 page1</a></p>/n<p><a href=\\"level1/level2/page2.html\\">Link to level2 page2</a></p>/n<p>This is a deep nested include.</p>/n<h1 id=\\"user-include\\">User include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<p><img src=\\"_assets/4.png\\" alt=\\"img 3\\" /></p>/n<h2 id=\\"commented-includes\\"><a href=\\"index.html#commented-includes\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Commented includes</span></a>Commented includes</h2>/n/n<h2 id=\\"include-with-variable-substitution\\"><a href=\\"index.html#include-with-variable-substitution\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with variable substitution</span></a>Include with variable substitution</h2>/n<h1 id=\\"user-include\\">User include <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<h2 id=\\"include-without-title\\"><a href=\\"index.html#include-without-title\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title</span></a>Include without title</h2>/n<h1 id=\\"include-without-title\\">Include without title <a href=\\"index.html\\">→ index</a></h1>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a test for include without title.</p>/n<h2 id=\\"include-without-title-from-the-same-directory\\"><a href=\\"index.html#include-without-title-from-the-same-directory\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title from the same directory</span></a>Include without title from the same directory</h2>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<p>This is a user include with variable substitution: Alice</p>/n<h2 id=\\"include-without-title-with-anchor\\"><a href=\\"index.html#include-without-title-with-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title with anchor</span></a>Include without title with anchor</h2>/n<p>This is content of section 1.</p>/n<h2 id=\\"include-without-title-with-paragraph-anchor\\"><a href=\\"index.html#include-without-title-with-paragraph-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include without title with paragraph anchor</span></a>Include without title with paragraph anchor</h2>/n<p id=\\"p1\\">Some paragraph with anchor</p>/n<p><a href=\\"index.html\\">Link to index</a></p>/n<h2 id=\\"anchor\\"><a href=\\"index.html#anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Include with anchor</span></a>Include with anchor</h2>/n<p>{% include notitle <a href=\\"index.html#anchor\\">anchor</a> %}<br />/n{% include <a href=\\"index.html#anchor\\">anchor</a> %}</p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"},"headings":[{"title":"Include from root level","href":"index.html#include-from-root-level","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor","level":2},{"title":"Section 2","href":"index.html#section2","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection21","level":3}]},{"title":"Include from level1","href":"index.html#include-from-level1","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor1","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection211","level":3}]},{"title":"Include from level2","href":"index.html#include-from-level2","level":2},{"title":"Include with anchor → level1","href":"index.html#include-with-anchor2","level":2},{"title":"Section 3","href":"index.html#section3","level":2},{"title":"Include with missing file","href":"index.html#include-with-missing-file","level":2},{"title":"Include file that is in toc","href":"index.html#include-file-that-is-in-toc","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor3","level":2},{"title":"Section 1","href":"index.html#section1","level":2},{"title":"Links to different levels","href":"index.html#links-to-different-levels","level":2},{"title":"Include with anchor","href":"index.html#include-with-anchor4","level":2},{"title":"Section 1","href":"index.html#section11","level":2},{"title":"Include with multiple anchors","href":"index.html#include-with-multiple-anchors","level":2},{"title":"Section 2","href":"index.html#section21","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection212","level":3}]},{"title":"Include with paragraph anchor","href":"index.html#include-with-paragraph-anchor","level":2},{"title":"Nested includes","href":"index.html#nested-includes","level":2},{"title":"Include with anchor → root","href":"index.html#include-with-anchor5","level":2,"items":[{"title":"Subsection 2.1","href":"index.html#subsection213","level":3}]},{"title":"Deep nested includes","href":"index.html#deep-nested-includes","level":2},{"title":"Commented includes","href":"index.html#commented-includes","level":2},{"title":"Include with variable substitution","href":"index.html#include-with-variable-substitution","level":2},{"title":"Include without title","href":"index.html#include-without-title","level":2},{"title":"Include without title from the same directory","href":"index.html#include-without-title-from-the-same-directory","level":2},{"title":"Include without title with anchor","href":"index.html#include-without-title-with-anchor","level":2},{"title":"Include without title with paragraph anchor","href":"index.html#include-without-title-with-paragraph-anchor","level":2},{"title":"Include with anchor","href":"index.html#anchor","level":2}],"title":"Test Includes"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
|
|
385
393
|
</script>
|
|
386
394
|
<script type="application/javascript">
|
|
387
395
|
const data = document.querySelector('script#diplodoc-state');
|
|
@@ -702,10 +702,6 @@ exports[`Translate command > do not filter files on extract > filelist 1`] = `
|
|
|
702
702
|
"es/index.md.xliff",
|
|
703
703
|
"es/nested/a1.md.skl",
|
|
704
704
|
"es/nested/a1.md.xliff",
|
|
705
|
-
"es/nested/folder1/a1.md.skl",
|
|
706
|
-
"es/nested/folder1/a1.md.xliff",
|
|
707
|
-
"es/nested/folder1/toc-i.yaml.skl",
|
|
708
|
-
"es/nested/folder1/toc-i.yaml.xliff",
|
|
709
705
|
"es/nested/index-yfm.md.skl",
|
|
710
706
|
"es/nested/index-yfm.md.xliff",
|
|
711
707
|
"es/nested/index.yaml.skl",
|
|
@@ -804,6 +800,23 @@ exports[`Translate command > do not resolve liquid conditions if vars not specif
|
|
|
804
800
|
</xliff>"
|
|
805
801
|
`;
|
|
806
802
|
|
|
803
|
+
exports[`Translate command > do not translate merged entries with included toc > filelist 1`] = `
|
|
804
|
+
"[
|
|
805
|
+
"included-toc.md.skl",
|
|
806
|
+
"included-toc.md.xliff",
|
|
807
|
+
"index.md.skl",
|
|
808
|
+
"index.md.xliff",
|
|
809
|
+
"merged-included-toc-item.md.skl",
|
|
810
|
+
"merged-included-toc-item.md.xliff",
|
|
811
|
+
"no-translate.md.skl",
|
|
812
|
+
"no-translate.md.xliff",
|
|
813
|
+
"openapi-spec.yaml.skl",
|
|
814
|
+
"openapi-spec.yaml.xliff",
|
|
815
|
+
"toc.yaml.skl",
|
|
816
|
+
"toc.yaml.xliff"
|
|
817
|
+
]"
|
|
818
|
+
`;
|
|
819
|
+
|
|
807
820
|
exports[`Translate command > extract openapi spec files > filelist 1`] = `
|
|
808
821
|
"[
|
|
809
822
|
"openapi-spec.yaml.skl",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {readFileSync} from 'node:fs';
|
|
2
|
+
import {resolve} from 'node:path';
|
|
3
|
+
import {describe, expect, test} from 'vitest';
|
|
4
|
+
|
|
5
|
+
import {TestAdapter, getTestPaths} from '../fixtures';
|
|
6
|
+
|
|
7
|
+
describe('Nested include links', () => {
|
|
8
|
+
test('Links in nested includes should resolve relative to the include file, not the entry file', async () => {
|
|
9
|
+
const {inputPath, outputPath} = getTestPaths('mocks/nested-include-links');
|
|
10
|
+
|
|
11
|
+
// Build directly to HTML
|
|
12
|
+
await TestAdapter.testBuildPass(inputPath, outputPath, {
|
|
13
|
+
md2md: false,
|
|
14
|
+
md2html: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const htmlPath = resolve(outputPath, 'sub/deep/entry.html');
|
|
18
|
+
const html = readFileSync(htmlPath, 'utf8');
|
|
19
|
+
|
|
20
|
+
// The link from other/page.md is [link to target](../target.md)
|
|
21
|
+
// It should resolve relative to other/page.md → target.md → target.html
|
|
22
|
+
// NOT relative to the entry file sub/deep/entry.md → sub/deep/target.html
|
|
23
|
+
expect(html).toContain('target.html');
|
|
24
|
+
expect(html).not.toContain('sub/deep/target.html');
|
|
25
|
+
});
|
|
26
|
+
});
|
package/e2e/translation.spec.ts
CHANGED
|
@@ -100,6 +100,16 @@ describe('Translate command', () => {
|
|
|
100
100
|
target: 'es-ES',
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
+
generateMapTestTemplate(
|
|
104
|
+
'do not translate merged entries with included toc',
|
|
105
|
+
'mocks/translation/toc-include',
|
|
106
|
+
{
|
|
107
|
+
subcommand: 'extract',
|
|
108
|
+
source: 'ru-RU',
|
|
109
|
+
target: 'es-ES',
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
|
|
103
113
|
generateMapTestTemplate('do not filter files on extract', 'mocks/translation/dir-files', {
|
|
104
114
|
subcommand: 'extract',
|
|
105
115
|
source: 'ru-RU',
|
|
@@ -59,4 +59,11 @@ This is a test page for various include scenarios.
|
|
|
59
59
|
{% include [user](includes/user.md) %}
|
|
60
60
|
## Include without title
|
|
61
61
|
|
|
62
|
-
{% include [no-title-include](includes/no-title-include.md) %}
|
|
62
|
+
{% include [no-title-include](includes/no-title-include.md) %}
|
|
63
|
+
|
|
64
|
+
## Include with anchor {#anchor}
|
|
65
|
+
|
|
66
|
+
{% include notitle [anchor](#anchor) %}
|
|
67
|
+
{% include [anchor](#anchor) %}
|
|
68
|
+
|
|
69
|
+
{% include [no-title-include](includes/no-title-include.md#anchor) %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#### Included toc item
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### Included toc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#### Included toc item
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# No-translate directive
|
|
2
|
+
|
|
3
|
+
## Block directive
|
|
4
|
+
:::no-translate
|
|
5
|
+
### No-translate header
|
|
6
|
+
|
|
7
|
+
:::html-block
|
|
8
|
+
testsetsets
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
::: any-other-directive
|
|
12
|
+
content test
|
|
13
|
+
:::
|
|
14
|
+
|
|
15
|
+
Should not be translated.
|
|
16
|
+
Can use **markup** inside.
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
::: some-other-directive
|
|
21
|
+
content here
|
|
22
|
+
:::
|
|
23
|
+
::: no-translate
|
|
24
|
+
content here
|
|
25
|
+
::: some-other-directive
|
|
26
|
+
nested content
|
|
27
|
+
:::
|
|
28
|
+
:::
|
|
29
|
+
|
|
30
|
+
## Leaf directive
|
|
31
|
+
|
|
32
|
+
::no-translate [## /usr/local/bin/application]
|
|
33
|
+
::no-translate[**C:\Program Files\Application\config.ini**]
|
|
34
|
+
::no-translate [~/Documents/project/src/main.rs]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- :no-translate[GET /api/v1/users] — get all users
|
|
38
|
+
- :no-translate[POST /api/v1/auth/login] — authorization
|
|
39
|
+
- :no-translate[PUT /api/v1/users/{id}] — update users data
|
|
40
|
+
|
|
41
|
+
## Simple case leaf
|
|
42
|
+
Install using command.
|
|
43
|
+
:no-translate[The default port is unless specified.] Next sentence.
|
|
44
|
+
Set NODE_ENV=production for production builds.
|
|
45
|
+
|
|
46
|
+
## Simple case inline
|
|
47
|
+
Install using :no-translate[npm install @company/package] command.
|
|
48
|
+
The default port is :no-translate[8080] unless specified.
|
|
49
|
+
Set :no-translate[NODE_ENV=production] for production builds.
|
|
50
|
+
|
|
51
|
+
## Few inline directives
|
|
52
|
+
Use :no-translate[**GET /api/v1/users**] to list users and :no-translate[POST /api/v1/users] to create.
|
|
53
|
+
|
|
54
|
+
## Empty inline directive
|
|
55
|
+
This is text with empty :no-translate[] directive.
|
|
56
|
+
|
|
57
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
openapi: 3.0.1
|
|
2
|
+
info:
|
|
3
|
+
title: OpenAPI definition
|
|
4
|
+
version: v0
|
|
5
|
+
servers:
|
|
6
|
+
- url: http://localhost:8080
|
|
7
|
+
description: Generated server url
|
|
8
|
+
paths:
|
|
9
|
+
/test:
|
|
10
|
+
get:
|
|
11
|
+
tags:
|
|
12
|
+
- test-controller
|
|
13
|
+
summary: Simple get operation. тест новой верстки 3
|
|
14
|
+
description: Defines a simple get :no-translate[skip this] operation with no inputs and a complex
|
|
15
|
+
operationId: getWithPayloadResponse
|
|
16
|
+
responses:
|
|
17
|
+
"200":
|
|
18
|
+
description: 200!!!!
|
|
19
|
+
content:
|
|
20
|
+
application/json:
|
|
21
|
+
schema:
|
|
22
|
+
$ref: '#/components/schemas/RecurceTop'
|
|
23
|
+
components:
|
|
24
|
+
schemas:
|
|
25
|
+
RecurceTop:
|
|
26
|
+
type: object
|
|
27
|
+
properties:
|
|
28
|
+
A:
|
|
29
|
+
type: string
|
|
30
|
+
# $ref: '#/components/schemas/RecurceMiddle'
|
|
31
|
+
RecurceMiddle:
|
|
32
|
+
type: object
|
|
33
|
+
properties:
|
|
34
|
+
B:
|
|
35
|
+
type: array
|
|
36
|
+
items:
|
|
37
|
+
$ref: '#/components/schemas/RecurceTop'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
title: Test123
|
|
2
|
+
href: index.md
|
|
3
|
+
items:
|
|
4
|
+
- name: Не переводить
|
|
5
|
+
href: no-translate.md
|
|
6
|
+
- name: openapi
|
|
7
|
+
include:
|
|
8
|
+
path: openapi
|
|
9
|
+
includers:
|
|
10
|
+
- name: openapi
|
|
11
|
+
input: openapi-spec.yaml
|
|
12
|
+
- name: Included TOC
|
|
13
|
+
href: included-toc.md
|
|
14
|
+
include: { mode: merge, path: included-toc/toc.yaml }
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED