Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions tests/norm-rule/expected/test-norm-rules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

[cols="20%,60%,20%"]
|===
| Rule Name | Rule Description | Description Location
| Rule Name | Rule Description | Origin of Description

.4+| inline
| A few words | Rule Summary
| extension | Rule Kind
| A few words | Rule's 'summary' property
| extension | Rule's 'kind' property
| [Zicsr, ABC] | Rule Instances
| inside inline a| link:test.html#norm:inline[norm:inline]

.1+| no_tag
| Normative rule without tag/tags | Rule Summary
| Normative rule without tag/tags | Rule's 'summary' property

.1+| inline-with-hash
| includes a hash # symbol. a| link:test.html#norm:inline-with-hash[norm:inline-with-hash]

.2+| paragraph-with-a-really-wide-rule-name
| Here's a description.
It's got 2 lines.
| Rule Description
| Rule's 'description' property
| Paragraph without inline anchors a| link:test.html#norm:paragraph:no-inline-anchors[norm:paragraph:no-inline-anchors]

.1+| inline-anchors-in-paragraph-entire
Expand All @@ -39,6 +39,33 @@ It's got 2 lines.
.1+| double_tags
| This paragraph has two tags but we only ever get a tag for norm:def. a| link:test.html#norm:def[norm:def]

.1+| superscript
| xyz 2^32^ 123 a| link:test.html#norm:superscript[norm:superscript]

.1+| subscript
| xyz X~i~ 123 a| link:test.html#norm:subscript[norm:subscript]

.1+| inline-underline
| ABC [.underline]#inside tag# GHI a| link:test.html#norm:inline-underline[norm:inline-underline]

.1+| paragraph-underline
| Paragraph underlined outside. a| link:test.html#norm:paragraph-underline[norm:paragraph-underline]

.1+| unicode_name
| ABC ≥ DEF a| link:test.html#norm:unicode_name[norm:unicode_name]

.1+| unicode_decimal_value
| ABC ≥ DEF a| link:test.html#norm:unicode_decimal_value[norm:unicode_decimal_value]

.1+| unicode_hexadecimal_value
| ABC ≥ DEF a| link:test.html#norm:unicode_hexadecimal_value[norm:unicode_hexadecimal_value]

.1+| unicode_char
| ABC ≥ DEF a| link:test.html#norm:unicode_char[norm:unicode_char]

.1+| macro_call
| 200 {ge} 100 a| link:test.html#norm:macro_call[norm:macro_call]

.1+| table1
| ===
WITH anchor
Expand Down Expand Up @@ -158,8 +185,8 @@ Paragraph 3 a| link:test.html#norm:admonition:anchors-in-notes:entire-note[norm:
| Paragraph Z a| link:test.html#norm:admonition:only-anchors-in-notes:note3[norm:admonition:only-anchors-in-notes:note3]

.5+| admon5
| One line description | Rule Description
| parameter | Rule Kind
| One line description | Rule's 'description' property
| parameter | Rule's 'kind' property
| [MY_PARAMETER] | Rule Instances
| Paragraph 1 a| link:test.html#norm:admonition:anchors-in-notes:note1[norm:admonition:anchors-in-notes:note1]
| Paragraph 3 a| link:test.html#norm:admonition:anchors-in-notes:note3[norm:admonition:anchors-in-notes:note3]
Expand Down
66 changes: 57 additions & 9 deletions tests/norm-rule/expected/test-norm-rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Normative Rules per Chapter</title>
<style>
.underline {
text-decoration: underline;
}
:root{
--sidebar-width: 200px;
--accent: #0366d6;
Expand Down Expand Up @@ -106,21 +109,21 @@ <h3>my-chapter_name</h3>
<col class="col-location">
</colgroup>
<thead>
<tr><th>Rule Name</th><th>Rule Description</th><th>Description Location</th></tr>
<tr><th>Rule Name</th><th>Rule Description</th><th>Origin of Description</th></tr>
</thead>
<tbody>
<tr>
<td rowspan=4 id="inline">inline</td>
<td>A few words</td>
<td>Rule Summary</td>
<td>Rule's "summary" property</td>
</tr>
<tr>
<td>extension</td>
<td>Rule Kind</td>
<td>Rule's "kind" property</td>
</tr>
<tr>
<td>[Zicsr, ABC]</td>
<td>Rule Instances</td>
<td>Rule's "instance/instances" property</td>
</tr>
<tr>
<td>inside inline</td>
Expand All @@ -129,7 +132,7 @@ <h3>my-chapter_name</h3>
<tr>
<td rowspan=1 id="no_tag">no_tag</td>
<td>Normative rule without tag/tags</td>
<td>Rule Summary</td>
<td>Rule's "summary" property</td>
</tr>
<tr>
<td rowspan=1 id="inline-with-hash">inline-with-hash</td>
Expand All @@ -139,7 +142,7 @@ <h3>my-chapter_name</h3>
<tr>
<td rowspan=2 id="paragraph-with-a-really-wide-rule-name">paragraph-with-a-really-wide-rule-name</td>
<td>Here's a description.<br>It's got 2 lines.<br></td>
<td>Rule Description</td>
<td>Rule's "description" property</td>
</tr>
<tr>
<td>Paragraph without inline anchors</td>
Expand Down Expand Up @@ -170,6 +173,51 @@ <h3>my-chapter_name</h3>
<td>This paragraph has two tags but we only ever get a tag for norm:def.</td>
<td><a href="test.html#norm:def">norm:def</a></td>
</tr>
<tr>
<td rowspan=1 id="superscript">superscript</td>
<td>xyz 2<sup>32</sup> 123</td>
<td><a href="test.html#norm:superscript">norm:superscript</a></td>
</tr>
<tr>
<td rowspan=1 id="subscript">subscript</td>
<td>xyz X<sub>i</sub> 123</td>
<td><a href="test.html#norm:subscript">norm:subscript</a></td>
</tr>
<tr>
<td rowspan=1 id="inline-underline">inline-underline</td>
<td>ABC <span class="underline">inside tag</span> GHI</td>
<td><a href="test.html#norm:inline-underline">norm:inline-underline</a></td>
</tr>
<tr>
<td rowspan=1 id="paragraph-underline">paragraph-underline</td>
<td>Paragraph underlined outside.</td>
<td><a href="test.html#norm:paragraph-underline">norm:paragraph-underline</a></td>
</tr>
<tr>
<td rowspan=1 id="unicode_name">unicode_name</td>
<td>ABC &#8805; DEF</td>
<td><a href="test.html#norm:unicode_name">norm:unicode_name</a></td>
</tr>
<tr>
<td rowspan=1 id="unicode_decimal_value">unicode_decimal_value</td>
<td>ABC &#8805; DEF</td>
<td><a href="test.html#norm:unicode_decimal_value">norm:unicode_decimal_value</a></td>
</tr>
<tr>
<td rowspan=1 id="unicode_hexadecimal_value">unicode_hexadecimal_value</td>
<td>ABC &#x2265; DEF</td>
<td><a href="test.html#norm:unicode_hexadecimal_value">norm:unicode_hexadecimal_value</a></td>
</tr>
<tr>
<td rowspan=1 id="unicode_char">unicode_char</td>
<td>ABC ≥ DEF</td>
<td><a href="test.html#norm:unicode_char">norm:unicode_char</a></td>
</tr>
<tr>
<td rowspan=1 id="macro_call">macro_call</td>
<td>200 {ge} 100</td>
<td><a href="test.html#norm:macro_call">norm:macro_call</a></td>
</tr>
<tr>
<td rowspan=1 id="table1">table1</td>
<td>===<br>WITH anchor<br>WITHOUT anchor<br>===</td>
Expand Down Expand Up @@ -295,15 +343,15 @@ <h3>my-chapter_name</h3>
<tr>
<td rowspan=5 id="admon5">admon5</td>
<td>One line description</td>
<td>Rule Description</td>
<td>Rule's "description" property</td>
</tr>
<tr>
<td>parameter</td>
<td>Rule Kind</td>
<td>Rule's "kind" property</td>
</tr>
<tr>
<td>[MY_PARAMETER]</td>
<td>Rule Instances</td>
<td>Rule's "instance/instances" property</td>
</tr>
<tr>
<td>Paragraph 1</td>
Expand Down
117 changes: 117 additions & 0 deletions tests/norm-rule/expected/test-norm-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,123 @@
}
]
},
{
"name": "superscript",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:superscript",
"text": "xyz 2^32^ 123",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "subscript",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:subscript",
"text": "xyz X~i~ 123",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "inline-underline",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:inline-underline",
"text": "ABC [.underline]#inside tag# GHI",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "paragraph-underline",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:paragraph-underline",
"text": "Paragraph underlined outside.",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "unicode_name",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:unicode_name",
"text": "ABC &amp;ge; DEF",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "unicode_decimal_value",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:unicode_decimal_value",
"text": "ABC &amp;#8805; DEF",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "unicode_hexadecimal_value",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:unicode_hexadecimal_value",
"text": "ABC &amp;#x2265; DEF",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "unicode_char",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:unicode_char",
"text": "ABC ≥ DEF",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "macro_call",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:macro_call",
"text": "200 {ge} 100",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "table1",
"def_filename": "tests/norm-rule/test.yaml",
Expand Down
Binary file modified tests/norm-rule/expected/test-norm-rules.xlsx
Binary file not shown.
25 changes: 25 additions & 0 deletions tests/norm-rule/expected/test-norm-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"norm:paragraph:tag_with_newlines": "Here&#8217;s the first line. Here&#8217;s the second line.",
"norm:def": "This paragraph has two tags but we only ever get a tag for norm:def.",
"norm:formulae": "This paragraph looks like a formulae to Excel because it has this &lt; sign in it. Make sure this gets written as a string, not a formulae in the XLSX or else it will create an error in Excel.",
"norm:superscript": "xyz 2^32^ 123",
"norm:subscript": "xyz X~i~ 123",
"norm:inline-underline": "ABC [.underline]#inside tag# GHI",
"norm:paragraph-underline": "Paragraph underlined outside.",
"norm:unicode_name": "ABC &amp;ge; DEF",
"norm:unicode_decimal_value": "ABC &amp;#8805; DEF",
"norm:unicode_hexadecimal_value": "ABC &amp;#x2265; DEF",
"norm:unicode_char": "ABC ≥ DEF",
"norm:macro_call": "200 {ge} 100",
"norm:table:no-anchors-in-cells:entire-table": "Header 1|Header 2\n===\nCell in column 1, row 1|Cell in column 2, row 1\nCell in column 1, row 2|Cell in column 2, row 2\n===",
"norm:table:anchors-in-cells:entire-table-tagged:cell": "WITH anchor",
"norm:table:anchors-in-cells:entire-table": "===\nWITH anchor\nWITHOUT anchor\n===",
Expand Down Expand Up @@ -64,6 +73,22 @@
"norm:formulae"
]
},
{
"title": "Chapter 1.3 - AsciiDoc Formatting",
"id": "_chapter_1_3_asciidoc_formatting",
"children": [],
"tags": [
"norm:superscript",
"norm:subscript",
"norm:inline-underline",
"norm:paragraph-underline",
"norm:unicode_name",
"norm:unicode_decimal_value",
"norm:unicode_hexadecimal_value",
"norm:unicode_char",
"norm:macro_call"
]
},
{
"title": "Chapter 2 - Table Tagging",
"id": "_chapter_2_table_tagging",
Expand Down
27 changes: 27 additions & 0 deletions tests/norm-rule/test.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,33 @@ This paragraph has two tags but we'll never see either since the 1st isn't picke
This paragraph looks like a formulae to Excel because it has this < sign in it.
Make sure this gets written as a string, not a formulae in the XLSX or else it will create an error in Excel.

=== Chapter 1.3 - AsciiDoc Formatting

These are present to test conversation of normative text that contains AsciiDoc formatting to
output formats such as HTML.

Superscript [#norm:superscript]#xyz 2^32^ 123# outside.

Subscript [#norm:subscript]#xyz X~i~ 123# outside.

Inline underline [.underline]#before tag# [#norm:inline-underline]+ABC [.underline]#inside tag# GHI+ outside.

[[norm:paragraph-underline]]
Paragraph [.underline]#underlined# outside.

Unicode name [#norm:unicode_name]#ABC &ge; DEF# outside.

Unicode decimal value [#norm:unicode_decimal_value]#ABC &#8805; DEF# outside.

Unicode hexadecimal value [#norm:unicode_hexadecimal_value]#ABC &#x2265; DEF# outside.

Unicode character [#norm:unicode_char]#ABC ≥ DEF# outside.

:ge: &#8805;

Macro call [#norm:macro_call]#200 {ge} 100# outside.


=== Chapter 2 - Table Tagging

// FAILS - Want tagged text to be "ENTIRE TABLE"
Expand Down
Loading