metanorma-document 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +9 -412
  3. data/lib/metanorma/document/components/blocks/note_block.rb +1 -1
  4. data/lib/metanorma/document/components/inline/eref_element.rb +1 -1
  5. data/lib/metanorma/document/components/inline/fn_element.rb +1 -1
  6. data/lib/metanorma/document/components/lists/unordered_list.rb +2 -2
  7. data/lib/metanorma/document/components/multi_paragraph/admonition_block.rb +5 -2
  8. data/lib/metanorma/document/components/paragraphs/paragraph_block.rb +2 -2
  9. data/lib/metanorma/document/version.rb +1 -1
  10. data/lib/metanorma/html/base_renderer.rb +10 -11
  11. data/lib/metanorma/html/generator.rb +15 -22
  12. data/lib/metanorma/html/iso_renderer.rb +24 -1
  13. data/lib/metanorma/ietf_document/sections/ietf_annex_section.rb +1 -1
  14. data/lib/metanorma/ietf_document/sections/ietf_clause_section.rb +1 -1
  15. data/lib/metanorma/ietf_document/sections/ietf_content_section.rb +1 -1
  16. data/lib/metanorma/iso_document/metadata/doc_identifier.rb +1 -1
  17. data/lib/metanorma/iso_document/sections/iso_foreword_section.rb +2 -13
  18. data/lib/metanorma/iso_document/sections/iso_terms_section.rb +7 -16
  19. data/lib/metanorma/iso_document/terms/term_example.rb +2 -1
  20. data/lib/metanorma/iso_document/terms/term_note.rb +2 -1
  21. data/lib/metanorma/iso_document/terms/verbal_definition.rb +2 -1
  22. data/lib/metanorma/iso_document.rb +0 -1
  23. data/lib/metanorma/jis_document/sections/jis_annex_section.rb +1 -1
  24. data/lib/metanorma/standard_document/annotation_container.rb +25 -2
  25. data/lib/metanorma/standard_document/block_attributes.rb +42 -0
  26. data/lib/metanorma/standard_document/blocks/amend_content_block.rb +21 -3
  27. data/lib/metanorma/standard_document/blocks/standard_block_no_notes.rb +2 -2
  28. data/lib/metanorma/standard_document/boilerplate.rb +20 -2
  29. data/lib/metanorma/standard_document/sections/annex_section.rb +8 -36
  30. data/lib/metanorma/standard_document/sections/clause_hierarchical_section.rb +1 -1
  31. data/lib/metanorma/standard_document/sections/clause_section.rb +4 -34
  32. data/lib/metanorma/standard_document/sections/definition_section.rb +15 -21
  33. data/lib/metanorma/standard_document/sections/standard_content_section.rb +3 -22
  34. data/lib/metanorma/standard_document/sections/standard_hierarchical_section.rb +1 -1
  35. data/lib/metanorma/standard_document/sections/standard_references_section.rb +2 -2
  36. data/lib/metanorma/standard_document/sections/standard_section.rb +1 -1
  37. data/lib/metanorma/standard_document/sections/terms_section.rb +6 -16
  38. data/lib/metanorma/standard_document.rb +3 -0
  39. metadata +2 -3
  40. data/lib/metanorma/iso_document/raw_paragraph.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e710334041f766fc137b7ee644dd8ea468df08e44b6f14861814d6ba82af00af
4
- data.tar.gz: 226cafd839311d7e71beb173682d9579c9f17fe2fa5d43a8d1cf51197ed96c59
3
+ metadata.gz: da12347749776b99b68dcc3816de625289ce2e56f51a9716c05d38088a4913b7
4
+ data.tar.gz: 2bf0989d205c0ab6a0c282fd5c4cab7d0c7deaccf012baafc64fa97c9160029f
5
5
  SHA512:
6
- metadata.gz: 3b5ca51582a6300114f12e9fe083cc8affbc3a10c782dc6eeadbfe5f5adef568c72c1c01e5a9dd90dd9cf1275778e0eddbc52634695e669c615faa92f2cc2f4d
7
- data.tar.gz: cfc53a641db3f0ccdf2fcab42fd9b50ab16358e7446025a83ff0928ffb88f8abadd8ee3748092df727a5622da9e88f9bbf9ec5de79a058b8b665f4734818f67e
6
+ metadata.gz: 1af9848d0640195e2176378b067214afe02f1da504893ed09686625e0a79f637bfad69fa5575d0959b59d31e78eff2b986dcdb42d63169db853ab808fb52bf22
7
+ data.tar.gz: 8dd05a2a8ed9344e5d70a35ab3c4653ec9b4c69dc001ef3cd400c6822b4874b8582304df5eee0798f37f8da43388e90fc71dbd88402d41fc1e401cd95fcd396a
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-05-21 05:48:57 UTC using RuboCop version 1.86.1.
3
+ # on 2026-05-21 09:20:40 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -11,251 +11,28 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'metanorma-document.gemspec'
13
13
 
14
- # Offense count: 155
14
+ # Offense count: 9
15
15
  # This cop supports safe autocorrection (--autocorrect).
16
16
  # Configuration parameters: EnforcedStyle, IndentationWidth.
17
17
  # SupportedStyles: with_first_argument, with_fixed_indentation
18
18
  Layout/ArgumentAlignment:
19
- Enabled: false
20
-
21
- # Offense count: 1
22
- # This cop supports safe autocorrection (--autocorrect).
23
- # Configuration parameters: EnforcedStyle, IndentationWidth.
24
- # SupportedStyles: with_first_element, with_fixed_indentation
25
- Layout/ArrayAlignment:
26
- Exclude:
27
- - 'lib/metanorma/html/standard_renderer.rb'
28
-
29
- # Offense count: 2
30
- # This cop supports safe autocorrection (--autocorrect).
31
- # Configuration parameters: IndentationWidth.
32
- Layout/AssignmentIndentation:
33
- Exclude:
34
- - 'lib/metanorma/html/iso_renderer.rb'
35
-
36
- # Offense count: 59
37
- # This cop supports safe autocorrection (--autocorrect).
38
- # Configuration parameters: EnforcedStyleAlignWith.
39
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
40
- Layout/BlockAlignment:
41
- Enabled: false
42
-
43
- # Offense count: 51
44
- # This cop supports safe autocorrection (--autocorrect).
45
- Layout/BlockEndNewline:
46
- Enabled: false
47
-
48
- # Offense count: 14
49
- # This cop supports safe autocorrection (--autocorrect).
50
- Layout/ClosingParenthesisIndentation:
51
- Exclude:
52
- - 'lib/metanorma/html.rb'
53
- - 'lib/metanorma/html/base_renderer.rb'
54
- - 'lib/metanorma/html/bipm_renderer.rb'
55
- - 'lib/metanorma/html/drops/figure_drop.rb'
56
- - 'lib/metanorma/html/drops/formula_drop.rb'
57
- - 'lib/metanorma/html/drops/sourcecode_drop.rb'
58
- - 'lib/metanorma/html/iso_renderer.rb'
59
- - 'lib/metanorma/html/standard_renderer.rb'
60
- - 'spec/metanorma/html/renderer/architecture_spec.rb'
61
- - 'spec/metanorma/html/renderer/dead_code_removal_spec.rb'
62
-
63
- # Offense count: 1
64
- # This cop supports safe autocorrection (--autocorrect).
65
- # Configuration parameters: EnforcedStyleAlignWith.
66
- # SupportedStylesAlignWith: start_of_line, def
67
- Layout/DefEndAlignment:
68
19
  Exclude:
69
- - 'lib/metanorma/html/component/base.rb'
70
-
71
- # Offense count: 1
72
- # This cop supports safe autocorrection (--autocorrect).
73
- Layout/ElseAlignment:
74
- Exclude:
75
- - 'lib/metanorma/html/standard_renderer.rb'
76
-
77
- # Offense count: 6
78
- # This cop supports safe autocorrection (--autocorrect).
79
- Layout/EmptyLineAfterGuardClause:
80
- Exclude:
81
- - 'lib/metanorma/html/base_renderer.rb'
82
- - 'lib/metanorma/html/generator.rb'
83
- - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
84
-
85
- # Offense count: 1
86
- # This cop supports safe autocorrection (--autocorrect).
87
- # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
88
- Layout/EmptyLineBetweenDefs:
89
- Exclude:
90
- - 'lib/metanorma/html/component/base.rb'
91
-
92
- # Offense count: 7
93
- # This cop supports safe autocorrection (--autocorrect).
94
- Layout/EmptyLines:
95
- Exclude:
96
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
97
-
98
- # Offense count: 4
99
- # This cop supports safe autocorrection (--autocorrect).
100
- # Configuration parameters: EnforcedStyle.
101
- # SupportedStyles: empty_lines, no_empty_lines
102
- Layout/EmptyLinesAroundBlockBody:
103
- Exclude:
104
- - 'lib/metanorma/ieee_document/root.rb'
105
- - 'lib/metanorma/ietf_document/root.rb'
106
- - 'lib/metanorma/nist_document/root.rb'
20
+ - 'lib/metanorma/standard_document.rb'
107
21
  - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
108
22
 
109
- # Offense count: 11
110
- # This cop supports safe autocorrection (--autocorrect).
111
- # Configuration parameters: EnforcedStyle.
112
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
113
- Layout/EmptyLinesAroundClassBody:
114
- Exclude:
115
- - 'lib/metanorma/html/bipm_renderer.rb'
116
- - 'lib/metanorma/html/cc_renderer.rb'
117
- - 'lib/metanorma/html/iec_renderer.rb'
118
- - 'lib/metanorma/html/ieee_renderer.rb'
119
- - 'lib/metanorma/html/ietf_renderer.rb'
120
- - 'lib/metanorma/html/iho_renderer.rb'
121
- - 'lib/metanorma/html/itu_renderer.rb'
122
- - 'lib/metanorma/html/ogc_renderer.rb'
123
- - 'lib/metanorma/html/oiml_renderer.rb'
124
- - 'lib/metanorma/html/pdfa_renderer.rb'
125
- - 'lib/metanorma/html/ribose_renderer.rb'
126
-
127
- # Offense count: 1
128
- # This cop supports safe autocorrection (--autocorrect).
129
- # Configuration parameters: EnforcedStyleAlignWith.
130
- # SupportedStylesAlignWith: keyword, variable, start_of_line
131
- Layout/EndAlignment:
132
- Exclude:
133
- - 'lib/metanorma/html/standard_renderer.rb'
134
-
135
- # Offense count: 9
136
- # This cop supports safe autocorrection (--autocorrect).
137
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
138
- Layout/ExtraSpacing:
139
- Exclude:
140
- - 'lib/metanorma/html/bipm_renderer.rb'
141
- - 'lib/metanorma/html/generator.rb'
142
- - 'lib/metanorma/html/iho_renderer.rb'
143
- - 'lib/metanorma/html/theme.rb'
144
- - 'lib/metanorma/iso_document/sections/iso_preface.rb'
145
- - 'lib/metanorma/iso_document/sections/iso_sections.rb'
146
- - 'lib/metanorma/standard_document/root_attributes.rb'
147
- - 'lib/metanorma/standard_document/sections/preface.rb'
148
-
149
- # Offense count: 13
150
- # This cop supports safe autocorrection (--autocorrect).
151
- # Configuration parameters: EnforcedStyle, IndentationWidth.
152
- # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
153
- Layout/FirstArgumentIndentation:
154
- Exclude:
155
- - 'lib/metanorma/html.rb'
156
- - 'lib/metanorma/html/base_renderer.rb'
157
- - 'lib/metanorma/html/bipm_renderer.rb'
158
- - 'lib/metanorma/html/drops/figure_drop.rb'
159
- - 'lib/metanorma/html/drops/formula_drop.rb'
160
- - 'lib/metanorma/html/drops/sourcecode_drop.rb'
161
- - 'lib/metanorma/html/iso_renderer.rb'
162
- - 'lib/metanorma/html/standard_renderer.rb'
163
- - 'spec/metanorma/html/renderer/architecture_spec.rb'
164
- - 'spec/metanorma/html/renderer/dead_code_removal_spec.rb'
165
-
166
- # Offense count: 51
167
- # This cop supports safe autocorrection (--autocorrect).
168
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
169
- # SupportedHashRocketStyles: key, separator, table
170
- # SupportedColonStyles: key, separator, table
171
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
172
- Layout/HashAlignment:
173
- Exclude:
174
- - 'lib/metanorma/html/base_renderer.rb'
175
- - 'lib/metanorma/html/component/index_section.rb'
176
- - 'lib/metanorma/html/component/index_term_collector.rb'
177
- - 'lib/metanorma/html/drops/figure_drop.rb'
178
- - 'lib/metanorma/registers/setup.rb'
179
- - 'lib/metanorma/standard_document/block_attributes.rb'
180
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
181
- - 'spec/metanorma/html/renderer/index_term_collector_spec.rb'
182
-
183
- # Offense count: 1
184
- # This cop supports safe autocorrection (--autocorrect).
185
- Layout/HeredocIndentation:
186
- Exclude:
187
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
188
-
189
- # Offense count: 4
190
- # This cop supports safe autocorrection (--autocorrect).
191
- # Configuration parameters: EnforcedStyle.
192
- # SupportedStyles: normal, indented_internal_methods
193
- Layout/IndentationConsistency:
194
- Exclude:
195
- - 'lib/metanorma/html/generator.rb'
196
-
197
- # Offense count: 106
198
- # This cop supports safe autocorrection (--autocorrect).
199
- # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
200
- # SupportedStylesAlignWith: start_of_line, relative_to_receiver
201
- Layout/IndentationWidth:
202
- Enabled: false
203
-
204
- # Offense count: 853
23
+ # Offense count: 666
205
24
  # This cop supports safe autocorrection (--autocorrect).
206
25
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
207
26
  # URISchemes: http, https
208
27
  Layout/LineLength:
209
28
  Enabled: false
210
29
 
211
- # Offense count: 4
212
- # This cop supports safe autocorrection (--autocorrect).
213
- Layout/MultilineBlockLayout:
214
- Exclude:
215
- - 'lib/metanorma/html/component/index_section.rb'
216
- - 'lib/metanorma/html/iso_renderer.rb'
217
-
218
- # Offense count: 12
219
- # This cop supports safe autocorrection (--autocorrect).
220
- # Configuration parameters: EnforcedStyle.
221
- # SupportedStyles: symmetrical, new_line, same_line
222
- Layout/MultilineMethodCallBraceLayout:
223
- Exclude:
224
- - 'lib/metanorma/html.rb'
225
- - 'lib/metanorma/html/base_renderer.rb'
226
- - 'lib/metanorma/html/bipm_renderer.rb'
227
- - 'lib/metanorma/html/drops/figure_drop.rb'
228
- - 'lib/metanorma/html/drops/formula_drop.rb'
229
- - 'lib/metanorma/html/drops/sourcecode_drop.rb'
230
- - 'lib/metanorma/html/iso_renderer.rb'
231
- - 'lib/metanorma/html/standard_renderer.rb'
232
- - 'spec/metanorma/html/renderer/architecture_spec.rb'
233
- - 'spec/metanorma/html/renderer/dead_code_removal_spec.rb'
234
-
235
30
  # Offense count: 1
236
31
  # This cop supports safe autocorrection (--autocorrect).
237
- # Configuration parameters: EnforcedStyle, IndentationWidth.
238
- # SupportedStyles: aligned, indented
239
- Layout/MultilineOperationIndentation:
240
- Exclude:
241
- - 'lib/metanorma/html/base_renderer.rb'
242
-
243
- # Offense count: 3
244
- # This cop supports safe autocorrection (--autocorrect).
245
- # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
246
- # SupportedStylesForExponentOperator: space, no_space
247
- # SupportedStylesForRationalLiterals: space, no_space
248
- Layout/SpaceAroundOperators:
249
- Exclude:
250
- - 'lib/metanorma/html/bipm_renderer.rb'
251
- - 'lib/metanorma/html/iho_renderer.rb'
252
- - 'lib/metanorma/html/theme.rb'
253
-
254
- # Offense count: 146
255
- # This cop supports safe autocorrection (--autocorrect).
256
32
  # Configuration parameters: AllowInHeredoc.
257
33
  Layout/TrailingWhitespace:
258
- Enabled: false
34
+ Exclude:
35
+ - 'lib/metanorma/standard_document.rb'
259
36
 
260
37
  # Offense count: 1
261
38
  # Configuration parameters: AllowedMethods.
@@ -291,22 +68,6 @@ Lint/StructNewOverride:
291
68
  Exclude:
292
69
  - 'lib/metanorma/html/component/index_term_collector.rb'
293
70
 
294
- # Offense count: 2
295
- # This cop supports safe autocorrection (--autocorrect).
296
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
297
- # NotImplementedExceptions: NotImplementedError
298
- Lint/UnusedMethodArgument:
299
- Exclude:
300
- - 'lib/metanorma/html/component/index_section.rb'
301
- - 'lib/metanorma/html/generator.rb'
302
-
303
- # Offense count: 4
304
- # This cop supports safe autocorrection (--autocorrect).
305
- Lint/UselessAssignment:
306
- Exclude:
307
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
308
- - 'spec/metanorma/standard_document/sections_spec.rb'
309
-
310
71
  # Offense count: 80
311
72
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
312
73
  Metrics/AbcSize:
@@ -340,7 +101,7 @@ Metrics/CyclomaticComplexity:
340
101
  - 'lib/metanorma/html/theme.rb'
341
102
  - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
342
103
 
343
- # Offense count: 100
104
+ # Offense count: 101
344
105
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
345
106
  Metrics/MethodLength:
346
107
  Max: 95
@@ -367,15 +128,6 @@ Metrics/PerceivedComplexity:
367
128
  - 'lib/metanorma/html/theme.rb'
368
129
  - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
369
130
 
370
- # Offense count: 4
371
- # This cop supports safe autocorrection (--autocorrect).
372
- # Configuration parameters: EnforcedStyle, BlockForwardingName.
373
- # SupportedStyles: anonymous, explicit
374
- Naming/BlockForwarding:
375
- Exclude:
376
- - 'lib/metanorma/html/base_renderer.rb'
377
- - 'lib/metanorma/html/component/footnote_collector.rb'
378
-
379
131
  # Offense count: 28
380
132
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
381
133
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
@@ -410,18 +162,6 @@ Performance/MapMethodChain:
410
162
  Exclude:
411
163
  - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
412
164
 
413
- # Offense count: 1
414
- # This cop supports unsafe autocorrection (--autocorrect-all).
415
- Performance/StringInclude:
416
- Exclude:
417
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
418
-
419
- # Offense count: 1
420
- # This cop supports unsafe autocorrection (--autocorrect-all).
421
- RSpec/BeEq:
422
- Exclude:
423
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
424
-
425
165
  # Offense count: 7
426
166
  RSpec/BeforeAfterAll:
427
167
  Exclude:
@@ -432,31 +172,11 @@ RSpec/BeforeAfterAll:
432
172
  RSpec/DescribeClass:
433
173
  Enabled: false
434
174
 
435
- # Offense count: 11
436
- # This cop supports unsafe autocorrection (--autocorrect-all).
437
- # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
438
- # SupportedStyles: described_class, explicit
439
- RSpec/DescribedClass:
440
- Exclude:
441
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
442
-
443
- # Offense count: 7
444
- # This cop supports safe autocorrection (--autocorrect).
445
- RSpec/EmptyLineAfterSubject:
446
- Exclude:
447
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
448
-
449
- # Offense count: 92
175
+ # Offense count: 95
450
176
  # Configuration parameters: CountAsOne.
451
177
  RSpec/ExampleLength:
452
178
  Max: 29
453
179
 
454
- # Offense count: 7
455
- # This cop supports safe autocorrection (--autocorrect).
456
- RSpec/LeadingSubject:
457
- Exclude:
458
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
459
-
460
180
  # Offense count: 1
461
181
  RSpec/LeakyConstantDeclaration:
462
182
  Exclude:
@@ -480,7 +200,7 @@ RSpec/NamedSubject:
480
200
  Exclude:
481
201
  - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
482
202
 
483
- # Offense count: 595
203
+ # Offense count: 599
484
204
  # Configuration parameters: AllowedPatterns.
485
205
  # AllowedPatterns: ^expect_, ^assert_
486
206
  RSpec/NoExpectationExample:
@@ -492,27 +212,6 @@ RSpec/NoExpectationExample:
492
212
  RSpec/SpecFilePathFormat:
493
213
  Enabled: false
494
214
 
495
- # Offense count: 4
496
- # This cop supports safe autocorrection (--autocorrect).
497
- # Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
498
- # RedundantRestArgumentNames: args, arguments
499
- # RedundantKeywordRestArgumentNames: kwargs, options, opts
500
- # RedundantBlockArgumentNames: blk, block, proc
501
- Style/ArgumentsForwarding:
502
- Exclude:
503
- - 'lib/metanorma/html/base_renderer.rb'
504
- - 'lib/metanorma/html/component/footnote_collector.rb'
505
-
506
- # Offense count: 81
507
- # This cop supports safe autocorrection (--autocorrect).
508
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
509
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
510
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
511
- # FunctionalMethods: let, let!, subject, watch
512
- # AllowedMethods: lambda, proc, it
513
- Style/BlockDelimiters:
514
- Enabled: false
515
-
516
215
  # Offense count: 5
517
216
  # This cop supports safe autocorrection (--autocorrect).
518
217
  Style/ComparableClamp:
@@ -521,36 +220,6 @@ Style/ComparableClamp:
521
220
  - 'lib/metanorma/html/iso_renderer.rb'
522
221
  - 'lib/metanorma/html/standard_renderer.rb'
523
222
 
524
- # Offense count: 1
525
- # This cop supports safe autocorrection (--autocorrect).
526
- # Configuration parameters: EnforcedStyle.
527
- # SupportedStyles: allow_single_line, allow_always, disallow, require_single_line, require_always
528
- Style/EndlessMethod:
529
- Exclude:
530
- - 'lib/metanorma/html/component/base.rb'
531
-
532
- # Offense count: 1
533
- # This cop supports unsafe autocorrection (--autocorrect-all).
534
- # Configuration parameters: InverseMethods, InverseBlocks.
535
- Style/InverseMethods:
536
- Exclude:
537
- - 'lib/metanorma/html/component/index_term_collector.rb'
538
-
539
- # Offense count: 9
540
- # This cop supports safe autocorrection (--autocorrect).
541
- Style/MultilineIfModifier:
542
- Exclude:
543
- - 'lib/metanorma/html/component/index_section.rb'
544
- - 'lib/metanorma/html/component/index_term_collector.rb'
545
- - 'lib/metanorma/html/iso_renderer.rb'
546
- - 'lib/metanorma/html/standard_renderer.rb'
547
-
548
- # Offense count: 1
549
- # This cop supports safe autocorrection (--autocorrect).
550
- Style/MultilineTernaryOperator:
551
- Exclude:
552
- - 'lib/metanorma/html/standard_renderer.rb'
553
-
554
223
  # Offense count: 1
555
224
  # This cop supports unsafe autocorrection (--autocorrect-all).
556
225
  # Configuration parameters: EnforcedStyle.
@@ -558,75 +227,3 @@ Style/MultilineTernaryOperator:
558
227
  Style/MutableConstant:
559
228
  Exclude:
560
229
  - 'lib/metanorma/html/base_renderer.rb'
561
-
562
- # Offense count: 1
563
- # This cop supports safe autocorrection (--autocorrect).
564
- Style/NegatedIfElseCondition:
565
- Exclude:
566
- - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
567
-
568
- # Offense count: 2
569
- # This cop supports unsafe autocorrection (--autocorrect-all).
570
- Style/RedundantInterpolation:
571
- Exclude:
572
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
573
-
574
- # Offense count: 1
575
- # This cop supports safe autocorrection (--autocorrect).
576
- Style/RedundantRegexpArgument:
577
- Exclude:
578
- - 'lib/metanorma/html/bipm_renderer.rb'
579
-
580
- # Offense count: 2
581
- # This cop supports safe autocorrection (--autocorrect).
582
- Style/RescueModifier:
583
- Exclude:
584
- - 'lib/metanorma/html/generator.rb'
585
-
586
- # Offense count: 2
587
- # This cop supports safe autocorrection (--autocorrect).
588
- # Configuration parameters: EnforcedStyle.
589
- # SupportedStyles: implicit, explicit
590
- Style/RescueStandardError:
591
- Exclude:
592
- - 'lib/metanorma/html/generator.rb'
593
-
594
- # Offense count: 1
595
- # This cop supports unsafe autocorrection (--autocorrect-all).
596
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
597
- # AllowedMethods: present?, blank?, presence, try, try!
598
- Style/SafeNavigation:
599
- Exclude:
600
- - 'lib/metanorma/html/bipm_renderer.rb'
601
-
602
- # Offense count: 1
603
- # This cop supports safe autocorrection (--autocorrect).
604
- # Configuration parameters: AllowModifier.
605
- Style/SoleNestedConditional:
606
- Exclude:
607
- - 'lib/metanorma/html/base_renderer.rb'
608
-
609
- # Offense count: 3
610
- # This cop supports safe autocorrection (--autocorrect).
611
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
612
- # SupportedStyles: single_quotes, double_quotes
613
- Style/StringLiterals:
614
- Exclude:
615
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
616
-
617
- # Offense count: 15
618
- # This cop supports safe autocorrection (--autocorrect).
619
- # Configuration parameters: EnforcedStyleForMultiline.
620
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
621
- Style/TrailingCommaInArguments:
622
- Exclude:
623
- - 'lib/metanorma/html/component/footnote_collector.rb'
624
- - 'lib/metanorma/html/component/index_term_collector.rb'
625
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
626
-
627
- # Offense count: 3
628
- # This cop supports safe autocorrection (--autocorrect).
629
- # Configuration parameters: AllowNamedUnderscoreVariables.
630
- Style/TrailingUnderscoreVariable:
631
- Exclude:
632
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
@@ -45,7 +45,7 @@ module Metanorma
45
45
 
46
46
  attribute :anchor, :string
47
47
 
48
- attribute :remove_in_rfc, :string
48
+ attribute :remove_in_rfc, :boolean
49
49
 
50
50
  attribute :name, Metanorma::Document::Components::Inline::NameWithIdElement,
51
51
  collection: true
@@ -7,7 +7,7 @@ module Metanorma
7
7
  attribute :type, :string
8
8
  attribute :bibitemid, :string
9
9
  attribute :citeas, :string
10
- attribute :normative, :string
10
+ attribute :normative, :boolean
11
11
  attribute :alt, :string
12
12
  attribute :display_format, :string
13
13
  attribute :relative, :string
@@ -5,7 +5,7 @@ module Metanorma
5
5
  class FnElement < Lutaml::Model::Serializable
6
6
  attribute :id, :string
7
7
  attribute :reference, :string
8
- attribute :hiddenref, :string
8
+ attribute :hiddenref, :boolean
9
9
  attribute :target, :string
10
10
  attribute :semx_id, :string
11
11
  attribute :original_reference, :string
@@ -9,10 +9,10 @@ module Metanorma
9
9
  attribute :id, :string
10
10
  attribute :semx_id, :string
11
11
  attribute :original_id, :string
12
- attribute :nobullet, :string
12
+ attribute :nobullet, :boolean
13
13
  attribute :spacing, :string
14
14
  attribute :indent, :string
15
- attribute :bare, :string
15
+ attribute :bare, :boolean
16
16
  attribute :json_type, :string
17
17
 
18
18
  def json_type
@@ -10,7 +10,10 @@ module Metanorma
10
10
  # Subclass of admonition determining how it is to be rendered; e.g.
11
11
  # Warning, Note, Tip.
12
12
  # Distinct admonition types are often associated with distinct icons or rendering.
13
- attribute :type, :string
13
+ attribute :type, :string,
14
+ values: %w[danger caution warning important
15
+ safety\ precautions editorial tip note
16
+ commentary]
14
17
 
15
18
  # Caption of admonition.
16
19
  attribute :name, Metanorma::Document::Components::TextElements::TextElement,
@@ -28,7 +31,7 @@ module Metanorma
28
31
  attribute :target, :string
29
32
 
30
33
  # Whether the admonition is excluded from automatic numbering (UN).
31
- attribute :unnumbered, :string
34
+ attribute :unnumbered, :boolean
32
35
 
33
36
  # Paragraphs within the admonition.
34
37
  attribute :paragraphs,
@@ -11,8 +11,8 @@ module Metanorma
11
11
  attribute :alignment, :string
12
12
  attribute :semx_id, :string
13
13
  attribute :original_id, :string
14
- attribute :keep_with_next, :string
15
- attribute :keep_with_previous, :string
14
+ attribute :keep_with_next, :boolean
15
+ attribute :keep_with_previous, :boolean
16
16
  attribute :indent, :string
17
17
  attribute :class_attr, :string
18
18
  attribute :type_attr, :string
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Metanorma
4
4
  module Document
5
- VERSION = "0.2.7"
5
+ VERSION = "0.2.9"
6
6
  Version = VERSION
7
7
  end
8
8
  end
@@ -161,7 +161,7 @@ module Metanorma
161
161
 
162
162
  # --- Document Assembly ---
163
163
 
164
- TEMPLATE_CACHE = {}
164
+ TEMPLATE_CACHE = {} # rubocop:disable Style/MutableConstant
165
165
  TEMPLATE_CACHE_MUTEX = Mutex.new
166
166
 
167
167
  def render_liquid(template_name, assigns)
@@ -1143,7 +1143,7 @@ module Metanorma
1143
1143
  end
1144
1144
 
1145
1145
  def render_mixed_inline(node)
1146
- # Models using map_all_content (e.g. RawParagraph): raw XML in content
1146
+ # Models using map_all_content: raw XML in content
1147
1147
  if raw_content_node?(node)
1148
1148
  raw = node.content
1149
1149
  if raw.is_a?(String) && !raw.strip.empty?
@@ -1385,7 +1385,7 @@ module Metanorma
1385
1385
  end
1386
1386
  end
1387
1387
 
1388
- # Process raw XML content from map_all_content models (e.g. RawParagraph).
1388
+ # Process raw XML content from map_all_content models.
1389
1389
  # Strips source elements (xref, eref, stem) that have a following <semx>
1390
1390
  # wrapper, keeping only the semx display content.
1391
1391
  def render_raw_content(raw_xml)
@@ -1554,14 +1554,13 @@ module Metanorma
1554
1554
  # TextElements::StemElement — block math (no fmt- counterpart for display formulas)
1555
1555
  if stem.is_a?(Metanorma::Document::Components::TextElements::StemElement)
1556
1556
  if stem.math
1557
- begin
1558
- return stem.math.to_xml
1559
- rescue StandardError
1560
- math_items = Array(stem.math)
1561
- return math_items.join
1562
- end
1563
- end
1564
- if stem.asciimath
1557
+ math_val = stem.math
1558
+ return math_val.to_xml if math_val.is_a?(Nokogiri::XML::Node)
1559
+ return math_val.to_xml if defined?(Moxml::Document) && math_val.is_a?(Moxml::Document)
1560
+
1561
+ math_items = Array(math_val)
1562
+ math_items.join
1563
+ elsif stem.asciimath
1565
1564
  text = extract_text_value(stem.asciimath)
1566
1565
  return %(<span class="stem">#{escape_html(text)}</span>)
1567
1566
  end