-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track UID_TO_NODE for SDocDocument to resolve LINK to DOCUMENT
We can now use [LINK: DOC] to link to whole documents, where DOC is [DOCUMENT] TITLE: Document UID: DOC in the same or another sdoc.
- Loading branch information
Showing
11 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/integration/commands/export/html/markup/11_node_LINK_references_a_document/input1.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
UID: DOC-1 | ||
|
||
[REQUIREMENT] | ||
UID: REQ-2 | ||
TITLE: Foo Bar | ||
STATEMENT: >>> | ||
Read [LINK: DOC-1] then [LINK: DOC-2]. | ||
<<< |
8 changes: 8 additions & 0 deletions
8
tests/integration/commands/export/html/markup/11_node_LINK_references_a_document/input2.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[DOCUMENT] | ||
TITLE: Document 2 | ||
UID: DOC-2 | ||
|
||
[TEXT] | ||
STATEMENT: >>> | ||
Read [LINK: DOC-2] then [LINK: DOC-1]. | ||
<<< |
10 changes: 10 additions & 0 deletions
10
tests/integration/commands/export/html/markup/11_node_LINK_references_a_document/test.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RUN: %strictdoc export %S --output-dir Output | filecheck %s --dump-input=fail | ||
CHECK: Published: Document 1 | ||
|
||
RUN: %cat %S/Output/html/%THIS_TEST_FOLDER/input1.html | filecheck %s --dump-input=fail --check-prefix CHECK-HTML-DOC1 | ||
|
||
CHECK-HTML-DOC1: Read <a href="../11_node_LINK_references_a_document/input1.html#_TOP">🔗 Document 1</a> then <a href="../11_node_LINK_references_a_document/input2.html#_TOP">🔗 Document 2</a>. | ||
|
||
RUN: %cat %S/Output/html/%THIS_TEST_FOLDER/input2.html | filecheck %s --dump-input=fail --check-prefix CHECK-HTML-DOC2 | ||
|
||
CHECK-HTML-DOC2: Read <a href="../11_node_LINK_references_a_document/input2.html#_TOP">🔗 Document 2</a> then <a href="../11_node_LINK_references_a_document/input1.html#_TOP">🔗 Document 1</a>. |
18 changes: 18 additions & 0 deletions
18
tests/integration/commands/export/rst/52_link_to_document/expected/input1.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _DOC-1: | ||
|
||
Document 1 | ||
$$$$$$$$$$ | ||
|
||
.. _REQ-2: | ||
|
||
Foo Bar | ||
======= | ||
|
||
.. list-table:: | ||
:align: left | ||
:header-rows: 0 | ||
|
||
* - **UID:** | ||
- REQ-2 | ||
|
||
Read :ref:`Document 1 <DOC-1>` then :ref:`Document 2 <DOC-2>`. |
6 changes: 6 additions & 0 deletions
6
tests/integration/commands/export/rst/52_link_to_document/expected/input2.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _DOC-2: | ||
|
||
Document 2 | ||
$$$$$$$$$$ | ||
|
||
Read :ref:`Document 2 <DOC-2>` then :ref:`Document 1 <DOC-1>`. |
10 changes: 10 additions & 0 deletions
10
tests/integration/commands/export/rst/52_link_to_document/input1.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
UID: DOC-1 | ||
|
||
[REQUIREMENT] | ||
UID: REQ-2 | ||
TITLE: Foo Bar | ||
STATEMENT: >>> | ||
Read [LINK: DOC-1] then [LINK: DOC-2]. | ||
<<< |
8 changes: 8 additions & 0 deletions
8
tests/integration/commands/export/rst/52_link_to_document/input2.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[DOCUMENT] | ||
TITLE: Document 2 | ||
UID: DOC-2 | ||
|
||
[TEXT] | ||
STATEMENT: >>> | ||
Read [LINK: DOC-2] then [LINK: DOC-1]. | ||
<<< |
6 changes: 6 additions & 0 deletions
6
tests/integration/commands/export/rst/52_link_to_document/test.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
RUN: %strictdoc export %S --formats=rst --output-dir Output | ||
|
||
RUN: %check_exists --file "%S/Output/rst/input1.rst" | ||
|
||
RUN: %diff "%S/Output/rst/input1.rst" "%S/expected/input1.rst" | ||
RUN: %diff "%S/Output/rst/input2.rst" "%S/expected/input2.rst" |