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
20 changes: 15 additions & 5 deletions tests/norm-rule/expected/test-norm-rules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
| inside inline a| link:test.html#norm:inline[norm:inline]

.2+| no_tag
| Normative rule without tag/tags | Rule's 'summary' property
| This normative rule has no references to the standard. This should only be used in extraordinary circumstances. | Rule's 'note' property
| Normative rule *without* tag/tags | Rule's 'summary' property
| This normative rule has no references to the standard. This should only be used in extraordinary circumstances.
It does include a link to <<table1>> (another normative rule).
Has basic adoc formatting such as *bold*, ita__lics__, `monospace`, 2^superscript^, ~subscript~, [.underline]#underline#,
and &le; (Unicode text for less-than-equals-to) and &#8800; (Unicode decimal value for not-equal-to).
| Rule's 'note' 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.
| Here's a [.underline]#description#.
It's got 2 lines.
| Rule's 'description' property
| Paragraph without inline anchors a| link:test.html#norm:paragraph:no-inline-anchors[norm:paragraph:no-inline-anchors]
Expand All @@ -40,11 +44,17 @@ 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+| bold
| ABC is a network - Bold is removed by tags backend so I don't see it a| link:test.html#norm:bold[norm:bold]

.1+| italics
| Let's have fun today - Italics is removed by tags backend so I don't see it a| link:test.html#norm:italics[norm:italics]

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

.1+| subscript
| xyz X~i~ 123 a| link:test.html#norm:subscript[norm:subscript]
| both ~log~ and log~2~ work 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]
Expand Down
20 changes: 15 additions & 5 deletions tests/norm-rule/expected/test-norm-rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ <h3>my-chapter_name</h3>
</tr>
<tr>
<td rowspan=2 id="no_tag">no_tag</td>
<td>Normative rule without tag/tags</td>
<td>Normative rule <b>without</b> tag/tags</td>
<td>Rule's "summary" property</td>
</tr>
<tr>
<td>This normative rule has no references to the standard. This should only be used in extraordinary circumstances.</td>
<td>This normative rule has no references to the standard. This should only be used in extraordinary circumstances.<br>It does include a link to <a href="#table1">table1</a> (another normative rule).<br>Has basic adoc formatting such as <b>bold</b>, ita<i>lics</i>, <code>monospace</code>, 2<sup>superscript</sup>, <sub>subscript</sub>, <span class="underline">underline</span>,<br>and &#8804; (Unicode text for less-than-equals-to) and &#8800; (Unicode decimal value for not-equal-to).<br></td>
<td>Rule's "note" property</td>
</tr>
<tr>
Expand All @@ -145,7 +145,7 @@ <h3>my-chapter_name</h3>
</tr>
<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>Here's a <span class="underline">description</span>.<br>It's got 2 lines.<br></td>
<td>Rule's "description" property</td>
</tr>
<tr>
Expand Down Expand Up @@ -177,14 +177,24 @@ <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="bold">bold</td>
<td>ABC is a network - Bold is removed by tags backend so I don't see it</td>
<td><a href="test.html#norm:bold">norm:bold</a></td>
</tr>
<tr>
<td rowspan=1 id="italics">italics</td>
<td>Let's have fun today - Italics is removed by tags backend so I don't see it</td>
<td><a href="test.html#norm:italics">norm:italics</a></td>
</tr>
<tr>
<td rowspan=1 id="superscript">superscript</td>
<td>xyz 2<sup>32</sup> 123</td>
<td>both 2<sup>32</sup> and <sup>32</sup> work</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>both <sub>log</sub> and log<sub>2</sub> work</td>
<td><a href="test.html#norm:subscript">norm:subscript</a></td>
</tr>
<tr>
Expand Down
36 changes: 31 additions & 5 deletions tests/norm-rule/expected/test-norm-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"name": "no_tag",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"summary": "Normative rule without tag/tags",
"note": "This normative rule has no references to the standard. This should only be used in extraordinary circumstances.",
"summary": "Normative rule *without* tag/tags",
"note": "This normative rule has no references to the standard. This should only be used in extraordinary circumstances.\nIt does include a link to <<table1>> (another normative rule).\nHas basic adoc formatting such as *bold*, ita__lics__, `monospace`, 2^superscript^, ~subscript~, [.underline]#underline#,\nand &le; (Unicode text for less-than-equals-to) and &#8800; (Unicode decimal value for not-equal-to).\n",
"tags": []
},
{
Expand All @@ -44,7 +44,7 @@
"name": "paragraph-with-a-really-wide-rule-name",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"description": "Here's a description.\nIt's got 2 lines.\n",
"description": "Here's a [.underline]#description#.\nIt's got 2 lines.\n",
"tags": [
{
"name": "norm:paragraph:no-inline-anchors",
Expand Down Expand Up @@ -119,14 +119,40 @@
}
]
},
{
"name": "bold",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:bold",
"text": "ABC is a network - Bold is removed by tags backend so I don't see it",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "italics",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:italics",
"text": "Let's have fun today - Italics is removed by tags backend so I don't see it",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
]
},
{
"name": "superscript",
"def_filename": "tests/norm-rule/test.yaml",
"chapter_name": "my-chapter_name",
"tags": [
{
"name": "norm:superscript",
"text": "xyz 2^32^ 123",
"text": "both 2^32^ and ^32^ work",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
Expand All @@ -139,7 +165,7 @@
"tags": [
{
"name": "norm:subscript",
"text": "xyz X~i~ 123",
"text": "both ~log~ and log~2~ work",
"tag_filename": "/build/test-norm-tags.json",
"stds_doc_url": "test.html"
}
Expand Down
Binary file modified tests/norm-rule/expected/test-norm-rules.xlsx
Binary file not shown.
8 changes: 6 additions & 2 deletions tests/norm-rule/expected/test-norm-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"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:bold": "ABC is a network - Bold is removed by tags backend so I don't see it",
"norm:italics": "Let's have fun today - Italics is removed by tags backend so I don't see it",
"norm:superscript": "both 2^32^ and ^32^ work",
"norm:subscript": "both ~log~ and log~2~ work",
"norm:inline-underline": "ABC [.underline]#inside tag# GHI",
"norm:paragraph-underline": "Paragraph underlined outside.",
"norm:standalone_ampersand": "ABC &amp; DEF",
Expand Down Expand Up @@ -86,6 +88,8 @@
"id": "_chapter_1_3_asciidoc_formatting",
"children": [],
"tags": [
"norm:bold",
"norm:italics",
"norm:superscript",
"norm:subscript",
"norm:inline-underline",
Expand Down
8 changes: 6 additions & 2 deletions tests/norm-rule/test.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ Make sure this gets written as a string, not a formulae in the XLSX or else it w
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.
Bold and italics are stripped by the tags backend somehow so they aren't present in the tags JSON file.
Bold [#norm:bold]#*ABC* is a n**et**work - Bold is removed by tags backend so I don't see it# outside.
Italics [#norm:italics]#Let's have _fun_ to__day__ - Italics is removed by tags backend so I don't see it# outside.

Subscript [#norm:subscript]#xyz X~i~ 123# outside.
Superscript [#norm:superscript]#both 2^32^ and ^32^ work# outside.

Subscript [#norm:subscript]#both ~log~ and log~2~ work# outside.

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

Expand Down
14 changes: 11 additions & 3 deletions tests/norm-rule/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ normative_rule_definitions:
instances: [Zicsr, ABC]
tag: "norm:inline"
- name: no_tag
summary: Normative rule without tag/tags
note: This normative rule has no references to the standard. This should only be used in extraordinary circumstances.
summary: Normative rule *without* tag/tags
note: |
This normative rule has no references to the standard. This should only be used in extraordinary circumstances.
It does include a link to <<table1>> (another normative rule).
Has basic adoc formatting such as *bold*, ita__lics__, `monospace`, 2^superscript^, ~subscript~, [.underline]#underline#,
and &le; (Unicode text for less-than-equals-to) and &#8800; (Unicode decimal value for not-equal-to).
- name: inline-with-hash
tag: "norm:inline-with-hash"

# Paragraph
- name: paragraph-with-a-really-wide-rule-name
description: |
Here's a description.
Here's a [.underline]#description#.
It's got 2 lines.
tag: "norm:paragraph:no-inline-anchors"
- name: inline-anchors-in-paragraph-entire
Expand All @@ -37,6 +41,10 @@ normative_rule_definitions:
tag: "norm:def"

# AsciiDoc formatting
- name: bold
tag: "norm:bold"
- name: italics
tag: "norm:italics"
- name: superscript
tag: "norm:superscript"
- name: subscript
Expand Down
Loading