Skip to content

Commit 93422ee

Browse files
author
james-ball-qualcomm
authored
Merge pull request #113 from riscv/111-create-asciidoc-with-tables-of-norm-rules
Added adoc output format for norm rules
2 parents 75c71b5 + 95079de commit 93422ee

File tree

9 files changed

+325
-32
lines changed

9 files changed

+325
-32
lines changed

Makefile

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,44 @@ NORM_RULE_EXPECTED_DIR := $(NORM_RULE_TESTS_DIR)/expected
2525

2626
# Ruby scripts being tested.
2727
TAGS_BACKEND := tags.rb
28-
CREATE_NORM_RULE_TOOL := create_normative_rules.rb
28+
CREATE_NORM_RULE_TOOL := $(TOOLS_DIR)/create_normative_rules.rb
29+
CREATE_NORM_RULE_RUBY := ruby $(CREATE_NORM_RULE_TOOL)
30+
31+
# Stuff for building mock standards document in HTML to have links into it.
32+
DOCS = "test"
33+
DOCS_HTML := $(addprefix $(BUILD_DIR)/, $(addsuffix .html, $(DOCS)))
34+
ENV := LANG=C.utf8
35+
ASCIIDOCTOR_HTML := $(ENV) asciidoctor
2936

3037
# Input and output file names
38+
DOC_NORM_TAG_SUFFIX := -norm-tags.json
3139
MAIN_TEST_ADOC_INPUT_FNAME := test.adoc
40+
MAIN_TEST_HTML_FNAME := test.html
3241
DUPLICATE_TEST_ADOC_INPUT_FNAME := duplicate.adoc
33-
MAIN_NORM_TAGS_OUTPUT_FNAME := test-norm-tags.json
42+
MAIN_NORM_TAGS_OUTPUT_FNAME := test$(DOC_NORM_TAG_SUFFIX)
3443
DUPLICATE_NORM_TAGS_OUTPUT_FNAME := duplicate-tags.json
3544
NORM_RULE_JSON_OUTPUT_FNAME := test-norm-rules.json
3645
NORM_RULE_XLSX_OUTPUT_FNAME := test-norm-rules.xlsx
46+
NORM_RULE_ADOC_OUTPUT_FNAME := test-norm-rules.adoc
47+
NORM_RULE_HTML_OUTPUT_FNAME := test-norm-rules.html
3748
NORM_RULE_TAGS_NO_RULES_OUTPUT_FNAME := test-norm-rules_tags_no_rules.json
3849

3950
# Built output files
51+
BUILT_MAIN_TEST_HTML := $(BUILD_DIR)/$(MAIN_TEST_HTML_FNAME)
4052
BUILT_NORM_TAGS_MAIN := $(BUILD_DIR)/$(MAIN_NORM_TAGS_OUTPUT_FNAME)
4153
BUILT_NORM_TAGS_DUPLICATE := $(BUILD_DIR)/$(DUPLICATE_NORM_TAGS_OUTPUT_FNAME)
4254
BUILT_NORM_RULES_JSON := $(BUILD_DIR)/$(NORM_RULE_JSON_OUTPUT_FNAME)
4355
BUILT_NORM_RULES_XLSX := $(BUILD_DIR)/$(NORM_RULE_XLSX_OUTPUT_FNAME)
56+
BUILT_NORM_RULES_ADOC := $(BUILD_DIR)/$(NORM_RULE_ADOC_OUTPUT_FNAME)
57+
BUILT_NORM_RULES_HTML := $(BUILD_DIR)/$(NORM_RULE_HTML_OUTPUT_FNAME)
4458
BUILT_NORM_RULES_TAGS_NO_RULES := $(BUILD_DIR)/$(NORM_RULE_TAGS_NO_RULES_OUTPUT_FNAME)
4559

4660
# Copies of expected output files.
4761
# Use make target "update-expected" to update from build dir contents.
4862
EXPECTED_NORM_TAGS := $(NORM_RULE_EXPECTED_DIR)/$(MAIN_NORM_TAGS_OUTPUT_FNAME)
4963
EXPECTED_NORM_RULES_JSON := $(NORM_RULE_EXPECTED_DIR)/$(NORM_RULE_JSON_OUTPUT_FNAME)
5064
EXPECTED_NORM_RULES_XLSX := $(NORM_RULE_EXPECTED_DIR)/$(NORM_RULE_XLSX_OUTPUT_FNAME)
65+
EXPECTED_NORM_RULES_ADOC := $(NORM_RULE_EXPECTED_DIR)/$(NORM_RULE_ADOC_OUTPUT_FNAME)
5166

5267
# All normative rule definition input YAML files
5368
NORM_RULE_DEF_FILES := $(wildcard $(NORM_RULE_DEF_DIR)/*.yaml)
@@ -58,6 +73,9 @@ NORM_TAG_FILE_ARGS := $(foreach relative_pname,$(BUILT_NORM_TAGS_MAIN),-t /$(rel
5873
# Add -d to each normative rule definition filename
5974
NORM_RULE_DEF_ARGS := $(foreach relative_pname,$(NORM_RULE_DEF_FILES),-d $(relative_pname))
6075

76+
# Provide mapping from an standard's norm tags JSON file to its corresponding HTML file. Used to create links into standard's HTML files.
77+
NORM_RULE_DOC2HTML_ARGS := $(foreach doc_name,$(DOCS),-tag2html /$(BUILD_DIR)/$(doc_name)$(DOC_NORM_TAG_SUFFIX) $(doc_name).html)
78+
6179
# Docker stuff
6280
DOCKER_BIN ?= docker
6381
SKIP_DOCKER ?= $(shell if command -v ${DOCKER_BIN} >/dev/null 2>&1 ; then echo false; else echo true; fi)
@@ -124,15 +142,17 @@ test: build-tests compare-tests
124142

125143
# Build tests
126144
.PHONY: build-tests build-test-tags build-test-norm-rules-json build-test-norm-rules-xlsx
127-
build-tests: build-test-tags build-test-norm-rules-json build-test-norm-rules-xlsx build-test-tags-without-rules
145+
build-tests: build-test-tags build-test-norm-rules-json build-test-norm-rules-xlsx build-test-norm-rules-adoc build-test-norm-rules-html build-test-tags-without-rules
128146
build-test-tags: $(BUILT_NORM_TAGS_MAIN) $(BUILT_NORM_TAGS_DUPLICATE)
129147
build-test-norm-rules-json: $(BUILT_NORM_RULES_JSON)
130148
build-test-norm-rules-xlsx: $(BUILT_NORM_RULES_XLSX)
149+
build-test-norm-rules-adoc: $(BUILT_NORM_RULES_ADOC)
150+
build-test-norm-rules-html: $(BUILT_NORM_RULES_HTML)
131151
build-test-tags-without-rules: $(BUILT_NORM_RULES_TAGS_NO_RULES)
132152

133153
# Compare tests against expected
134154
.PHONY: compare-tests
135-
compare-tests: compare-test-tags compare-test-norm-rules-json
155+
compare-tests: compare-test-tags compare-test-norm-rules-json compare-test-norm-rules-adoc
136156

137157
compare-test-tags: $(EXPECTED_NORM_TAGS) $(BUILT_NORM_TAGS_MAIN)
138158
@echo "CHECKING BUILT TAGS AGAINST EXPECTED TAGS"
@@ -144,9 +164,13 @@ compare-test-norm-rules-json: $(EXPECTED_NORM_RULES_JSON) $(BUILT_NORM_RULES_JSO
144164
@echo "CHECKING JSON BUILT NORM RULES AGAINST EXPECTED NORM RULES"
145165
diff $(EXPECTED_NORM_RULES_JSON) $(BUILT_NORM_RULES_JSON) && echo "diff PASSED" || (echo "diff FAILED"; exit 1)
146166

167+
compare-test-norm-rules-adoc: $(EXPECTED_NORM_RULES_ADOC) $(BUILT_NORM_RULES_ADOC)
168+
@echo "CHECKING ADOC BUILT NORM RULES AGAINST EXPECTED NORM RULES"
169+
diff $(EXPECTED_NORM_RULES_ADOC) $(BUILT_NORM_RULES_ADOC) && echo "diff PASSED" || (echo "diff FAILED"; exit 1)
170+
147171
# Update expected files from built files
148172
.PHONY: update-expected
149-
update-expected: update-test-tags update-test-norm-rules-json update-test-norm-rules-xlsx
173+
update-expected: update-test-tags update-test-norm-rules-json update-test-norm-rules-xlsx update-test-norm-rules-adoc
150174

151175
update-test-tags: $(BUILT_NORM_TAGS_MAIN)
152176
cp -f $(BUILT_NORM_TAGS_MAIN) $(EXPECTED_NORM_TAGS)
@@ -157,6 +181,9 @@ update-test-norm-rules-json: $(BUILT_NORM_RULES_JSON)
157181
update-test-norm-rules-xlsx: $(BUILT_NORM_RULES_XLSX)
158182
cp -f $(BUILT_NORM_RULES_XLSX) $(EXPECTED_NORM_RULES_XLSX)
159183

184+
update-test-norm-rules-adoc: $(BUILT_NORM_RULES_ADOC)
185+
cp -f $(BUILT_NORM_RULES_ADOC) $(EXPECTED_NORM_RULES_ADOC)
186+
160187
# Build normative tags with main adoc input
161188
$(BUILT_NORM_TAGS_MAIN): $(NORM_RULE_TESTS_DIR)/$(MAIN_TEST_ADOC_INPUT_FNAME) $(CONVERTERS_DIR)/$(TAGS_BACKEND)
162189
$(WORKDIR_SETUP)
@@ -175,15 +202,36 @@ $(BUILT_NORM_RULES_JSON): $(BUILT_NORM_TAGS_MAIN) $(NORM_RULE_DEF_FILES)
175202
$(WORKDIR_SETUP)
176203
cp -f $(BUILT_NORM_TAGS_MAIN) $@.workdir
177204
mkdir -p $@.workdir/build
178-
$(DOCKER_CMD) $(DOCKER_QUOTE) ruby $(TOOLS_DIR)/$(CREATE_NORM_RULE_TOOL) -w $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $@ $(DOCKER_QUOTE)
205+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(CREATE_NORM_RULE_RUBY) -w -j $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $@ $(DOCKER_QUOTE)
179206
$(WORKDIR_TEARDOWN)
180207

181208
# Build normative rules with XLSX output format
182209
$(BUILT_NORM_RULES_XLSX): $(BUILT_NORM_TAGS_MAIN) $(NORM_RULE_DEF_FILES)
183210
$(WORKDIR_SETUP)
184211
cp -f $(BUILT_NORM_TAGS_MAIN) $@.workdir
185212
mkdir -p $@.workdir/build
186-
$(DOCKER_CMD) $(DOCKER_QUOTE) ruby $(TOOLS_DIR)/$(CREATE_NORM_RULE_TOOL) -w -x $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $@ $(DOCKER_QUOTE)
213+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(CREATE_NORM_RULE_RUBY) -w -x $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $@ $(DOCKER_QUOTE)
214+
$(WORKDIR_TEARDOWN)
215+
216+
$(BUILT_NORM_RULES_ADOC): $(BUILT_NORM_TAGS_MAIN) $(NORM_RULE_DEF_FILES)
217+
$(WORKDIR_SETUP)
218+
cp -f $(BUILT_NORM_TAGS_MAIN) $@.workdir
219+
mkdir -p $@.workdir/build
220+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(CREATE_NORM_RULE_RUBY) -w -a $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $(NORM_RULE_DOC2HTML_ARGS) $@ $(DOCKER_QUOTE)
221+
$(WORKDIR_TEARDOWN)
222+
223+
$(BUILT_NORM_RULES_HTML): $(BUILT_NORM_RULES_ADOC) $(BUILT_MAIN_TEST_HTML)
224+
$(WORKDIR_SETUP)
225+
mkdir -p $@.workdir/build
226+
cp -f $(BUILT_NORM_RULES_ADOC) $@.workdir/build
227+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) $< $(DOCKER_QUOTE)
228+
$(WORKDIR_TEARDOWN)
229+
230+
# This is the HTML file that represents the standards doc. THe norm rule HTML links into this HTML.
231+
$(BUILT_MAIN_TEST_HTML) : $(NORM_RULE_TESTS_DIR)/$(MAIN_TEST_ADOC_INPUT_FNAME)
232+
$(WORKDIR_SETUP)
233+
mkdir -p $@.workdir/build
234+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) -o $@ $< $(DOCKER_QUOTE)
187235
$(WORKDIR_TEARDOWN)
188236

189237
# Build normative rules that should create an error due to tags without norm rules referencing them
@@ -192,7 +240,7 @@ $(BUILT_NORM_RULES_TAGS_NO_RULES): $(BUILT_NORM_TAGS_MAIN) $(NORM_RULE_DEF_FILES
192240
$(WORKDIR_SETUP)
193241
cp -f $(BUILT_NORM_TAGS_MAIN) $@.workdir
194242
mkdir -p $@.workdir/build
195-
$(DOCKER_CMD) $(DOCKER_QUOTE) ruby $(TOOLS_DIR)/$(CREATE_NORM_RULE_TOOL) $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $(BUILD_DIR)/bogus || touch $(BUILT_NORM_RULES_TAGS_NO_RULES) $(DOCKER_QUOTE)
243+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(CREATE_NORM_RULE_RUBY) $(NORM_TAG_FILE_ARGS) $(NORM_RULE_DEF_ARGS) $(BUILD_DIR)/bogus || touch $(BUILT_NORM_RULES_TAGS_NO_RULES) $(DOCKER_QUOTE)
196244
$(WORKDIR_TEARDOWN)
197245

198246
# Update docker image to latest

test-norm-rules-ref.adoc

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
= Normative Rules by Chapter
2+
3+
== my-chapter_name
4+
5+
[cols="20%,80%"]
6+
|===
7+
| Rule Name | Rule Information
8+
9+
.2+| inline
10+
a| Summary: A few words
11+
a| link:test.html#norm:inline[norm:inline] => inside inline
12+
13+
.2+| paragraph-with-a-really-wide-rule-name
14+
a| Description: Here's a description.
15+
It's got 2 lines.
16+
a| link:test.html#norm:paragraph:no-inline-anchors[norm:paragraph:no-inline-anchors] => Paragraph without inline anchors
17+
18+
.1+| inline-anchors-in-paragraph-entire
19+
a| link:test.html#norm:paragraph:inline-anchors:entire[norm:paragraph:inline-anchors:entire] => Paragraph with inline anchor and something.
20+
21+
.1+| inline-anchors-in-paragraph-inline-anchor
22+
a| link:test.html#norm:paragraph:inline-anchors:inline-anchor[norm:paragraph:inline-anchors:inline-anchor] => inline anchor
23+
24+
.1+| formulae
25+
a| link:test.html#norm:formulae[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.
26+
27+
.1+| rule_with_newlines
28+
a| link:test.html#norm:paragraph:tag_with_newlines[norm:paragraph:tag_with_newlines] => Here&#8217;s the first line. Here&#8217;s the second line.
29+
30+
.1+| table1
31+
a| link:test.html#norm:table:anchors-in-cells:entire-table[norm:table:anchors-in-cells:entire-table] =>
32+
!===
33+
34+
!cell with anchor
35+
!cell without anchor
36+
!===
37+
38+
.1+| table2
39+
a| link:test.html#norm:table:no-anchors-in-cells:entire-table[norm:table:no-anchors-in-cells:entire-table] =>
40+
!===
41+
! Header 1!Header 2
42+
43+
!Cell in column 1, row 1!Cell in column 2, row 1
44+
!Cell in column 1, row 2!Cell in column 2, row 2
45+
!===
46+
47+
.1+| unordered1
48+
a| link:test.html#norm:unordered-list:anchors-in-items:entire-list[norm:unordered-list:anchors-in-items:entire-list] => Item 1
49+
Item 2
50+
Item 3
51+
52+
.3+| note_with_2_tags
53+
a| Description: One line description
54+
a| link:test.html#norm:admonition:anchors-in-notes:note1[norm:admonition:anchors-in-notes:note1] => Paragraph 1
55+
a| link:test.html#norm:admonition:anchors-in-notes:note3[norm:admonition:anchors-in-notes:note3] => Paragraph 3
56+
57+
.2+| desc1
58+
a| link:test.html#norm:description-list:anchors-in-items:item1[norm:description-list:anchors-in-items:item1] => Item 1
59+
a| link:test.html#norm:description-list:anchors-in-items:item3[norm:description-list:anchors-in-items:item3] => Item 3
60+
61+
.2+| desc2
62+
a| link:test.html#norm:description-list:anchors-in-items:item1[norm:description-list:anchors-in-items:item1] => Item 1
63+
a| link:test.html#norm:description-list:anchors-in-items:item3[norm:description-list:anchors-in-items:item3] => Item 3
64+
|===
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
= Normative Rules by Chapter
2+
3+
== my-chapter_name
4+
5+
[cols="20%,80%"]
6+
|===
7+
| Rule Name | Rule Information
8+
9+
.2+| inline
10+
a| Summary: A few words
11+
a| link:test.html#norm:inline[norm:inline] => inside inline
12+
13+
.2+| paragraph-with-a-really-wide-rule-name
14+
a| Description: Here's a description.
15+
It's got 2 lines.
16+
a| link:test.html#norm:paragraph:no-inline-anchors[norm:paragraph:no-inline-anchors] => Paragraph without inline anchors
17+
18+
.1+| inline-anchors-in-paragraph-entire
19+
a| link:test.html#norm:paragraph:inline-anchors:entire[norm:paragraph:inline-anchors:entire] => Paragraph with inline anchor and something.
20+
21+
.1+| inline-anchors-in-paragraph-inline-anchor
22+
a| link:test.html#norm:paragraph:inline-anchors:inline-anchor[norm:paragraph:inline-anchors:inline-anchor] => inline anchor
23+
24+
.1+| formulae
25+
a| link:test.html#norm:formulae[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.
26+
27+
.1+| rule_with_newlines
28+
a| link:test.html#norm:paragraph:tag_with_newlines[norm:paragraph:tag_with_newlines] => Here&#8217;s the first line. Here&#8217;s the second line.
29+
30+
.1+| table1
31+
a| link:test.html#norm:table:anchors-in-cells:entire-table[norm:table:anchors-in-cells:entire-table] => ENTIRE TABLE
32+
33+
.1+| table2
34+
a| link:test.html#norm:table:no-anchors-in-cells:entire-table[norm:table:no-anchors-in-cells:entire-table] => ENTIRE TABLE
35+
36+
.1+| anchors-in-cells1
37+
a| link:test.html#norm:table:anchors-in-cells:entire-table-tagged:cell[norm:table:anchors-in-cells:entire-table-tagged:cell] => WITH anchor
38+
39+
.1+| anchors-in-cells2
40+
a| link:test.html#norm:table:anchors-in-cells:entire-table-not-tagged:cell[norm:table:anchors-in-cells:entire-table-not-tagged:cell] => ABC DEF
41+
42+
.1+| unordered1
43+
a| link:test.html#norm:unordered-list:anchors-in-items:entire-list[norm:unordered-list:anchors-in-items:entire-list] => Item 1
44+
Item 2
45+
Item 3
46+
47+
.3+| note_with_2_tags
48+
a| Description: One line description
49+
a| link:test.html#norm:admonition:anchors-in-notes:note1[norm:admonition:anchors-in-notes:note1] => Paragraph 1
50+
a| link:test.html#norm:admonition:anchors-in-notes:note3[norm:admonition:anchors-in-notes:note3] => Paragraph 3
51+
52+
.2+| desc1
53+
a| link:test.html#norm:description-list:anchors-in-items:item1[norm:description-list:anchors-in-items:item1] => Item 1
54+
a| link:test.html#norm:description-list:anchors-in-items:item3[norm:description-list:anchors-in-items:item3] => Item 3
55+
56+
.2+| desc2
57+
a| link:test.html#norm:description-list:anchors-in-items:item1[norm:description-list:anchors-in-items:item1] => Item 1
58+
a| link:test.html#norm:description-list:anchors-in-items:item3[norm:description-list:anchors-in-items:item3] => Item 3
59+
|===

tests/norm-rule/expected/test-norm-rules.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"tags": [
8787
{
8888
"name": "norm:table:anchors-in-cells:entire-table",
89-
"text": "===\ncell with anchor\ncell without anchor\n===",
89+
"text": "===\nWITH anchor\nWITHOUT anchor\n===",
9090
"tag_filename": "/build/test-norm-tags.json"
9191
}
9292
]
@@ -103,6 +103,30 @@
103103
}
104104
]
105105
},
106+
{
107+
"name": "anchors-in-cells1",
108+
"def_filename": "tests/norm-rule/test.yaml",
109+
"chapter_name": "my-chapter_name",
110+
"tags": [
111+
{
112+
"name": "norm:table:anchors-in-cells:entire-table-tagged:cell",
113+
"text": "WITH anchor",
114+
"tag_filename": "/build/test-norm-tags.json"
115+
}
116+
]
117+
},
118+
{
119+
"name": "anchors-in-cells2",
120+
"def_filename": "tests/norm-rule/test.yaml",
121+
"chapter_name": "my-chapter_name",
122+
"tags": [
123+
{
124+
"name": "norm:table:anchors-in-cells:entire-table-not-tagged:cell",
125+
"text": "ABC DEF",
126+
"tag_filename": "/build/test-norm-tags.json"
127+
}
128+
]
129+
},
106130
{
107131
"name": "unordered1",
108132
"def_filename": "tests/norm-rule/test.yaml",
82 Bytes
Binary file not shown.

tests/norm-rule/expected/test-norm-tags.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"norm:def": "This paragraph has two tags but we only ever get a tag for norm:def.",
99
"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.",
1010
"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===",
11-
"norm:table:anchors-in-cells:cell": "cell with anchor",
12-
"norm:table:anchors-in-cells:entire-table": "===\ncell with anchor\ncell without anchor\n===",
11+
"norm:table:anchors-in-cells:entire-table-tagged:cell": "WITH anchor",
12+
"norm:table:anchors-in-cells:entire-table": "===\nWITH anchor\nWITHOUT anchor\n===",
13+
"norm:table:anchors-in-cells:entire-table-not-tagged:cell": "ABC DEF",
1314
"norm:unordered-list:no-anchors-in-items:entire-list": "Item A\nItem B\nItem C",
1415
"norm:unordered-list:anchors-in-items:item1": "Item 1",
1516
"norm:unordered-list:anchors-in-items:item2": "Item 2",
@@ -66,8 +67,9 @@
6667
"children": [],
6768
"tags": [
6869
"norm:table:no-anchors-in-cells:entire-table",
69-
"norm:table:anchors-in-cells:cell",
70-
"norm:table:anchors-in-cells:entire-table"
70+
"norm:table:anchors-in-cells:entire-table-tagged:cell",
71+
"norm:table:anchors-in-cells:entire-table",
72+
"norm:table:anchors-in-cells:entire-table-not-tagged:cell"
7173
]
7274
}
7375
],

tests/norm-rule/test.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Make sure this gets written as a string, not a formulae in the XLSX or else it w
5757

5858
=== Chapter 2 - Table Tagging
5959

60-
// FAILS - Tag includes entire table but has adoc === prefixes/suffixes.
60+
// FAILS - Want tagged text to be "ENTIRE TABLE"
6161
[[norm:table:no-anchors-in-cells:entire-table]]
6262
[cols="1,1"]
6363
|===
@@ -67,19 +67,21 @@ Make sure this gets written as a string, not a formulae in the XLSX or else it w
6767
|Cell in column 1, row 2 |Cell in column 2, row 2
6868
|===
6969

70-
// FAILS - Tag includes entire table but has adoc === prefixes/suffixes.
70+
// FAILS - Want tagged text to be "ENTIRE TABLE"
7171
[[norm:table:anchors-in-cells:entire-table]]
7272
|===
7373

74-
// PASSES
75-
| [#norm:table:anchors-in-cells:cell]#cell with anchor#
76-
| cell without anchor
74+
// FAILS - Want tagged text to be "cell with anchor"
75+
| [#norm:table:anchors-in-cells:entire-table-tagged:cell]#WITH anchor#
76+
| WITHOUT anchor
7777
|===
7878

7979
|===
8080

81-
// PASSES
81+
// PASSES - Handles adoc formatted cell
8282
a| Cell is adoc
83+
// FAILS - Want tagged text to be "ABC DEF"
84+
| [#norm:table:anchors-in-cells:entire-table-not-tagged:cell]#ABC DEF#
8385
|===
8486

8587
== Chapter 3 - Tagging Unordered Lists

tests/norm-rule/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ normative_rule_definitions:
2929
tags: ["norm:table:anchors-in-cells:entire-table"]
3030
- name: table2
3131
tags: ["norm:table:no-anchors-in-cells:entire-table"]
32+
- name: anchors-in-cells1
33+
tags: ["norm:table:anchors-in-cells:entire-table-tagged:cell"]
34+
- name: anchors-in-cells2
35+
tags: ["norm:table:anchors-in-cells:entire-table-not-tagged:cell"]
3236
- name: unordered1
3337
tags: ["norm:unordered-list:anchors-in-items:entire-list"]
3438
- name: note_with_2_tags

0 commit comments

Comments
 (0)