Skip to content

Commit 8e51e9f

Browse files
author
james-ball-qualcomm
authored
Merge pull request #125 from riscv/124-add-anchors-into-html-norm-rules
Added HTML id tag to each normative rule to enable linking to normative rules
2 parents 707d21c + 583c7db commit 8e51e9f

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h3>my-chapter_name</h3>
110110
</thead>
111111
<tbody>
112112
<tr>
113-
<td rowspan=4>inline</td>
113+
<td rowspan=4 id="inline">inline</td>
114114
<td>A few words</td>
115115
<td>Rule Summary</td>
116116
</tr>
@@ -127,17 +127,17 @@ <h3>my-chapter_name</h3>
127127
<td><a href="test.html#norm:inline">norm:inline</a></td>
128128
</tr>
129129
<tr>
130-
<td rowspan=1>no_tag</td>
130+
<td rowspan=1 id="no_tag">no_tag</td>
131131
<td>Normative rule without tag/tags</td>
132132
<td>Rule Summary</td>
133133
</tr>
134134
<tr>
135-
<td rowspan=1>inline-with-hash</td>
135+
<td rowspan=1 id="inline-with-hash">inline-with-hash</td>
136136
<td>includes a hash # symbol.</td>
137137
<td><a href="test.html#norm:inline-with-hash">norm:inline-with-hash</a></td>
138138
</tr>
139139
<tr>
140-
<td rowspan=2>paragraph-with-a-really-wide-rule-name</td>
140+
<td rowspan=2 id="paragraph-with-a-really-wide-rule-name">paragraph-with-a-really-wide-rule-name</td>
141141
<td>Here's a description.<br>It's got 2 lines.<br></td>
142142
<td>Rule Description</td>
143143
</tr>
@@ -146,112 +146,112 @@ <h3>my-chapter_name</h3>
146146
<td><a href="test.html#norm:paragraph:no-inline-anchors">norm:paragraph:no-inline-anchors</a></td>
147147
</tr>
148148
<tr>
149-
<td rowspan=1>inline-anchors-in-paragraph-entire</td>
149+
<td rowspan=1 id="inline-anchors-in-paragraph-entire">inline-anchors-in-paragraph-entire</td>
150150
<td>Paragraph with inline anchor and something.</td>
151151
<td><a href="test.html#norm:paragraph:inline-anchors:entire">norm:paragraph:inline-anchors:entire</a></td>
152152
</tr>
153153
<tr>
154-
<td rowspan=1>inline-anchors-in-paragraph-inline-anchor</td>
154+
<td rowspan=1 id="inline-anchors-in-paragraph-inline-anchor">inline-anchors-in-paragraph-inline-anchor</td>
155155
<td>inline anchor</td>
156156
<td><a href="test.html#norm:paragraph:inline-anchors:inline-anchor">norm:paragraph:inline-anchors:inline-anchor</a></td>
157157
</tr>
158158
<tr>
159-
<td rowspan=1>formulae</td>
159+
<td rowspan=1 id="formulae">formulae</td>
160160
<td>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.</td>
161161
<td><a href="test.html#norm:formulae">norm:formulae</a></td>
162162
</tr>
163163
<tr>
164-
<td rowspan=1>rule_with_newlines</td>
164+
<td rowspan=1 id="rule_with_newlines">rule_with_newlines</td>
165165
<td>Here&#8217;s the first line. Here&#8217;s the second line.</td>
166166
<td><a href="test.html#norm:paragraph:tag_with_newlines">norm:paragraph:tag_with_newlines</a></td>
167167
</tr>
168168
<tr>
169-
<td rowspan=1>double_tags</td>
169+
<td rowspan=1 id="double_tags">double_tags</td>
170170
<td>This paragraph has two tags but we only ever get a tag for norm:def.</td>
171171
<td><a href="test.html#norm:def">norm:def</a></td>
172172
</tr>
173173
<tr>
174-
<td rowspan=1>table1</td>
174+
<td rowspan=1 id="table1">table1</td>
175175
<td>===<br>WITH anchor<br>WITHOUT anchor<br>===</td>
176176
<td><a href="test.html#norm:table:anchors-in-cells:entire-table">norm:table:anchors-in-cells:entire-table</a></td>
177177
</tr>
178178
<tr>
179-
<td rowspan=1>table2</td>
179+
<td rowspan=1 id="table2">table2</td>
180180
<td>Header 1|Header 2<br>===<br>Cell in column 1, row 1|Cell in column 2, row 1<br>Cell in column 1, row 2|Cell in column 2, row 2<br>===</td>
181181
<td><a href="test.html#norm:table:no-anchors-in-cells:entire-table">norm:table:no-anchors-in-cells:entire-table</a></td>
182182
</tr>
183183
<tr>
184-
<td rowspan=1>table3</td>
184+
<td rowspan=1 id="table3">table3</td>
185185
<td>WITH anchor</td>
186186
<td><a href="test.html#norm:table:anchors-in-cells:entire-table-tagged:cell">norm:table:anchors-in-cells:entire-table-tagged:cell</a></td>
187187
</tr>
188188
<tr>
189-
<td rowspan=1>table4</td>
189+
<td rowspan=1 id="table4">table4</td>
190190
<td>ABC DEF</td>
191191
<td><a href="test.html#norm:table:anchors-in-cells:entire-table-not-tagged:cell">norm:table:anchors-in-cells:entire-table-not-tagged:cell</a></td>
192192
</tr>
193193
<tr>
194-
<td rowspan=1>table5</td>
194+
<td rowspan=1 id="table5">table5</td>
195195
<td>Name|Color<br>===<br>Roses|Red<br>Violets|Blue<br>Name1|Color1<br>Name2|Color2<br>Name3|Color3<br>Name4|Color4<br>Name5|Color5<br>Name6|Color6<br>Name7|Color8<br>Name9|Color9<br>Name10|Color10<br>...</td>
196196
<td><a href="test.html#norm:table:many-rows">norm:table:many-rows</a></td>
197197
</tr>
198198
<tr>
199-
<td rowspan=1>unordered1</td>
199+
<td rowspan=1 id="unordered1">unordered1</td>
200200
<td>Item A<br>Item B<br>Item C</td>
201201
<td><a href="test.html#norm:unordered-list:no-anchors-in-items:entire-list">norm:unordered-list:no-anchors-in-items:entire-list</a></td>
202202
</tr>
203203
<tr>
204-
<td rowspan=1>unordered2</td>
204+
<td rowspan=1 id="unordered2">unordered2</td>
205205
<td>Item 1<br>Item 2<br>Item 3</td>
206206
<td><a href="test.html#norm:unordered-list:anchors-in-items:entire-list">norm:unordered-list:anchors-in-items:entire-list</a></td>
207207
</tr>
208208
<tr>
209-
<td rowspan=1>unordered3</td>
209+
<td rowspan=1 id="unordered3">unordered3</td>
210210
<td>Item 1</td>
211211
<td><a href="test.html#norm:unordered-list:anchors-in-items:item1">norm:unordered-list:anchors-in-items:item1</a></td>
212212
</tr>
213213
<tr>
214-
<td rowspan=1>unordered4</td>
214+
<td rowspan=1 id="unordered4">unordered4</td>
215215
<td>Item 2</td>
216216
<td><a href="test.html#norm:unordered-list:anchors-in-items:item2">norm:unordered-list:anchors-in-items:item2</a></td>
217217
</tr>
218218
<tr>
219-
<td rowspan=1>unordered5</td>
219+
<td rowspan=1 id="unordered5">unordered5</td>
220220
<td>Zca and not F<br>Zca, Zcf and F (but not D) is specified (RV32 only)<br>Zca, Zcf and Zcd if D is specified (RV32 only)<br><br>this configuration excludes Zcmp, Zcmt<br>Zca, Zcd if D is specified (RV64 only)<br><br>this configuration excludes Zcmp, Zcmt</td>
221221
<td><a href="test.html#norm:unordered-list:multiple-levels">norm:unordered-list:multiple-levels</a></td>
222222
</tr>
223223
<tr>
224-
<td rowspan=1>ordered1</td>
224+
<td rowspan=1 id="ordered1">ordered1</td>
225225
<td>Item A<br>Item B<br>Item C</td>
226226
<td><a href="test.html#norm:ordered-list:no-anchors-in-items:entire-list">norm:ordered-list:no-anchors-in-items:entire-list</a></td>
227227
</tr>
228228
<tr>
229-
<td rowspan=1>ordered2</td>
229+
<td rowspan=1 id="ordered2">ordered2</td>
230230
<td>Item 1<br>Item 2<br>Item 3</td>
231231
<td><a href="test.html#norm:ordered-list:anchors-in-items:entire-list">norm:ordered-list:anchors-in-items:entire-list</a></td>
232232
</tr>
233233
<tr>
234-
<td rowspan=1>ordered3</td>
234+
<td rowspan=1 id="ordered3">ordered3</td>
235235
<td>Item 1</td>
236236
<td><a href="test.html#norm:ordered-list:anchors-in-items:item1">norm:ordered-list:anchors-in-items:item1</a></td>
237237
</tr>
238238
<tr>
239-
<td rowspan=1>ordered4</td>
239+
<td rowspan=1 id="ordered4">ordered4</td>
240240
<td>Item 2</td>
241241
<td><a href="test.html#norm:ordered-list:anchors-in-items:item2">norm:ordered-list:anchors-in-items:item2</a></td>
242242
</tr>
243243
<tr>
244-
<td rowspan=1>desc1</td>
244+
<td rowspan=1 id="desc1">desc1</td>
245245
<td>Description-A<br>Item A<br>Description-B<br>Item B<br>Description-C<br>Item C</td>
246246
<td><a href="test.html#norm:description-list:no-anchors-in-items:entire-list">norm:description-list:no-anchors-in-items:entire-list</a></td>
247247
</tr>
248248
<tr>
249-
<td rowspan=1>desc2</td>
249+
<td rowspan=1 id="desc2">desc2</td>
250250
<td>Description-1</td>
251251
<td><a href="test.html#norm:description-list:anchors-in-items:entire-list">norm:description-list:anchors-in-items:entire-list</a></td>
252252
</tr>
253253
<tr>
254-
<td rowspan=2>desc3</td>
254+
<td rowspan=2 id="desc3">desc3</td>
255255
<td>Item 1</td>
256256
<td><a href="test.html#norm:description-list:anchors-in-items:item1">norm:description-list:anchors-in-items:item1</a></td>
257257
</tr>
@@ -260,7 +260,7 @@ <h3>my-chapter_name</h3>
260260
<td><a href="test.html#norm:description-list:anchors-in-items:item3">norm:description-list:anchors-in-items:item3</a></td>
261261
</tr>
262262
<tr>
263-
<td rowspan=2>desc4</td>
263+
<td rowspan=2 id="desc4">desc4</td>
264264
<td>Item 1</td>
265265
<td><a href="test.html#norm:description-list:anchors-in-items:item1">norm:description-list:anchors-in-items:item1</a></td>
266266
</tr>
@@ -269,22 +269,22 @@ <h3>my-chapter_name</h3>
269269
<td><a href="test.html#norm:description-list:anchors-in-items:item3">norm:description-list:anchors-in-items:item3</a></td>
270270
</tr>
271271
<tr>
272-
<td rowspan=1>admon1</td>
272+
<td rowspan=1 id="admon1">admon1</td>
273273
<td>Single paragraph note<br>that spans lines.</td>
274274
<td><a href="test.html#norm:admonition:single-paragraph-note">norm:admonition:single-paragraph-note</a></td>
275275
</tr>
276276
<tr>
277-
<td rowspan=1>admon2</td>
277+
<td rowspan=1 id="admon2">admon2</td>
278278
<td>Paragraph A<br><br>Paragraph B<br><br>Paragraph C</td>
279279
<td><a href="test.html#norm:admonition:no-anchors-in-notes:entire-note">norm:admonition:no-anchors-in-notes:entire-note</a></td>
280280
</tr>
281281
<tr>
282-
<td rowspan=1>admon3</td>
282+
<td rowspan=1 id="admon3">admon3</td>
283283
<td>Paragraph 1<br><br>Paragraph 2<br><br>Paragraph 3</td>
284284
<td><a href="test.html#norm:admonition:anchors-in-notes:entire-note">norm:admonition:anchors-in-notes:entire-note</a></td>
285285
</tr>
286286
<tr>
287-
<td rowspan=2>admon4</td>
287+
<td rowspan=2 id="admon4">admon4</td>
288288
<td>Paragraph X</td>
289289
<td><a href="test.html#norm:admonition:only-anchors-in-notes:note1">norm:admonition:only-anchors-in-notes:note1</a></td>
290290
</tr>
@@ -293,7 +293,7 @@ <h3>my-chapter_name</h3>
293293
<td><a href="test.html#norm:admonition:only-anchors-in-notes:note3">norm:admonition:only-anchors-in-notes:note3</a></td>
294294
</tr>
295295
<tr>
296-
<td rowspan=5>admon5</td>
296+
<td rowspan=5 id="admon5">admon5</td>
297297
<td>One line description</td>
298298
<td>Rule Description</td>
299299
</tr>
-1 Bytes
Binary file not shown.

tools/create_normative_rules.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def html_chapter_table(f, table_num, chapter_name, nr_defs, tags, tag_fname2url)
891891

892892
row_started = true
893893
f.puts(%Q{ <tr>})
894-
f.puts(%Q{ <td rowspan=#{name_row_span}>#{nr.name}</td>})
894+
f.puts(%Q{ <td rowspan=#{name_row_span} id="#{nr.name}">#{nr.name}</td>})
895895

896896
unless nr.summary.nil?
897897
f.puts(%Q{ <tr>}) unless row_started

0 commit comments

Comments
 (0)