metanorma-document 0.2.5 → 0.2.7

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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +321 -45
  3. data/Gemfile +2 -0
  4. data/lib/metanorma/basic_document/ancillary_blocks/figure_block.rb +3 -1
  5. data/lib/metanorma/basic_document/blocks/basic_block.rb +5 -1
  6. data/lib/metanorma/basic_document/blocks/note_block.rb +5 -0
  7. data/lib/metanorma/basic_document/blocks.rb +3 -24
  8. data/lib/metanorma/basic_document/lists/list.rb +2 -1
  9. data/lib/metanorma/basic_document/lists/list_item.rb +17 -0
  10. data/lib/metanorma/basic_document/lists.rb +1 -0
  11. data/lib/metanorma/basic_document/paragraphs/paragraph_with_footnote.rb +3 -1
  12. data/lib/metanorma/basic_document/reference_elements/callout.rb +1 -1
  13. data/lib/metanorma/basic_document/reference_elements/footnote.rb +1 -1
  14. data/lib/metanorma/basic_document/text_elements/mathml.rb +1 -1
  15. data/lib/metanorma/bipm_document/root.rb +10 -50
  16. data/lib/metanorma/bipm_document.rb +0 -2
  17. data/lib/metanorma/bsi_document/metadata/bsi_bib_data_extension_type.rb +10 -0
  18. data/lib/metanorma/bsi_document/metadata/bsi_bibliographic_item.rb +15 -0
  19. data/lib/metanorma/bsi_document/metadata.rb +12 -0
  20. data/lib/metanorma/bsi_document/root.rb +29 -0
  21. data/lib/metanorma/bsi_document/sections/bsi_annex_section.rb +25 -0
  22. data/lib/metanorma/bsi_document/sections/bsi_clause_section.rb +25 -0
  23. data/lib/metanorma/bsi_document/sections/bsi_sections.rb +27 -0
  24. data/lib/metanorma/bsi_document/sections.rb +11 -0
  25. data/lib/metanorma/bsi_document.rb +11 -0
  26. data/lib/metanorma/cc_document/root.rb +10 -50
  27. data/lib/metanorma/cc_document.rb +0 -2
  28. data/lib/metanorma/collection.rb +0 -2
  29. data/lib/metanorma/document/components/ancillary_blocks/example_block.rb +3 -3
  30. data/lib/metanorma/document/components/ancillary_blocks/figure_block.rb +2 -0
  31. data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +2 -0
  32. data/lib/metanorma/document/components/blocks/passthrough.rb +21 -0
  33. data/lib/metanorma/document/components/blocks/requirement_model.rb +159 -0
  34. data/lib/metanorma/document/components/blocks.rb +10 -0
  35. data/lib/metanorma/document/components/contrib_metadata/contribution_element_metadata.rb +3 -1
  36. data/lib/metanorma/document/components/id_elements/image.rb +2 -0
  37. data/lib/metanorma/document/components/inline/xref_element.rb +8 -0
  38. data/lib/metanorma/document/components/lists/definition_list.rb +6 -0
  39. data/lib/metanorma/document/components/lists/list_item.rb +1 -1
  40. data/lib/metanorma/document/components/lists/ordered_list.rb +6 -0
  41. data/lib/metanorma/document/components/lists/unordered_list.rb +8 -0
  42. data/lib/metanorma/document/components/multi_paragraph/admonition_block.rb +8 -0
  43. data/lib/metanorma/document/components/multi_paragraph/review_block.rb +3 -0
  44. data/lib/metanorma/document/components/paragraphs/paragraph_block.rb +6 -2
  45. data/lib/metanorma/document/components/reference_elements/source_element.rb +57 -0
  46. data/lib/metanorma/document/components/reference_elements.rb +6 -0
  47. data/lib/metanorma/document/components/sections/references_section.rb +1 -1
  48. data/lib/metanorma/document/components/tables/table_block.rb +10 -0
  49. data/lib/metanorma/document/components/tables/table_cell.rb +2 -1
  50. data/lib/metanorma/document/data_types.rb +0 -4
  51. data/lib/metanorma/document/elements/add.rb +18 -0
  52. data/lib/metanorma/document/elements/del.rb +18 -0
  53. data/lib/metanorma/document/elements.rb +10 -0
  54. data/lib/metanorma/document/relaton/address.rb +16 -0
  55. data/lib/metanorma/document/root.rb +1 -3
  56. data/lib/metanorma/document/version.rb +1 -1
  57. data/lib/metanorma/document.rb +11 -2
  58. data/lib/metanorma/gb_document/metadata/gb_bib_data_extension_type.rb +10 -0
  59. data/lib/metanorma/gb_document/metadata/gb_bibliographic_item.rb +15 -0
  60. data/lib/metanorma/gb_document/metadata.rb +12 -0
  61. data/lib/metanorma/gb_document/root.rb +29 -0
  62. data/lib/metanorma/gb_document.rb +10 -0
  63. data/lib/metanorma/generic_document/root.rb +31 -0
  64. data/lib/metanorma/generic_document.rb +7 -0
  65. data/lib/metanorma/html/base_renderer.rb +245 -113
  66. data/lib/metanorma/html/bipm_renderer.rb +16 -8
  67. data/lib/metanorma/html/cc_renderer.rb +0 -1
  68. data/lib/metanorma/html/component/base.rb +5 -1
  69. data/lib/metanorma/html/component/footnote_collector.rb +3 -3
  70. data/lib/metanorma/html/component/index_section.rb +27 -9
  71. data/lib/metanorma/html/component/index_term_collector.rb +8 -3
  72. data/lib/metanorma/html/component.rb +2 -1
  73. data/lib/metanorma/html/drops/admonition_drop.rb +2 -1
  74. data/lib/metanorma/html/drops/example_drop.rb +2 -11
  75. data/lib/metanorma/html/drops/figure_drop.rb +14 -5
  76. data/lib/metanorma/html/drops/formula_drop.rb +7 -2
  77. data/lib/metanorma/html/drops/note_drop.rb +2 -3
  78. data/lib/metanorma/html/drops/sourcecode_drop.rb +6 -2
  79. data/lib/metanorma/html/drops.rb +2 -1
  80. data/lib/metanorma/html/generator.rb +33 -16
  81. data/lib/metanorma/html/iec_renderer.rb +0 -1
  82. data/lib/metanorma/html/ieee_renderer.rb +0 -1
  83. data/lib/metanorma/html/ietf_renderer.rb +0 -1
  84. data/lib/metanorma/html/iho_renderer.rb +1 -2
  85. data/lib/metanorma/html/iso_renderer.rb +68 -23
  86. data/lib/metanorma/html/itu_renderer.rb +0 -1
  87. data/lib/metanorma/html/ogc_renderer.rb +0 -1
  88. data/lib/metanorma/html/oiml_renderer.rb +0 -1
  89. data/lib/metanorma/html/pdfa_renderer.rb +0 -1
  90. data/lib/metanorma/html/ribose_renderer.rb +0 -1
  91. data/lib/metanorma/html/standard_renderer.rb +61 -28
  92. data/lib/metanorma/html/theme.rb +2 -2
  93. data/lib/metanorma/html.rb +48 -1
  94. data/lib/metanorma/iec_document/root.rb +8 -47
  95. data/lib/metanorma/iec_document.rb +2 -3
  96. data/lib/metanorma/ieee_document/root.rb +14 -50
  97. data/lib/metanorma/ieee_document/sections/ieee_sections.rb +31 -0
  98. data/lib/metanorma/ieee_document/sections.rb +9 -0
  99. data/lib/metanorma/ieee_document.rb +3 -3
  100. data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +0 -2
  101. data/lib/metanorma/ietf_document/metadata/ietf_bibliographic_item.rb +0 -2
  102. data/lib/metanorma/ietf_document/root.rb +14 -50
  103. data/lib/metanorma/ietf_document/sections/ietf_annex_section.rb +26 -0
  104. data/lib/metanorma/ietf_document/sections/ietf_clause_section.rb +26 -0
  105. data/lib/metanorma/ietf_document/sections/ietf_content_section.rb +25 -0
  106. data/lib/metanorma/ietf_document/sections/ietf_sections.rb +35 -0
  107. data/lib/metanorma/ietf_document/sections.rb +4 -23
  108. data/lib/metanorma/ietf_document.rb +4 -3
  109. data/lib/metanorma/iho_document/metadata/iho_bib_data_extension_type.rb +0 -2
  110. data/lib/metanorma/iho_document/root.rb +10 -50
  111. data/lib/metanorma/iho_document.rb +0 -3
  112. data/lib/metanorma/iso_document/annotation_container.rb +1 -10
  113. data/lib/metanorma/iso_document/boilerplate.rb +1 -11
  114. data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +2 -2
  115. data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +4 -3
  116. data/lib/metanorma/iso_document/metadata/metanorma_extension.rb +1 -12
  117. data/lib/metanorma/iso_document/root.rb +7 -73
  118. data/lib/metanorma/iso_document/sections/colophon.rb +1 -16
  119. data/lib/metanorma/iso_document/sections/iso_annex_section.rb +11 -133
  120. data/lib/metanorma/iso_document/sections/iso_clause_section.rb +9 -166
  121. data/lib/metanorma/iso_document/sections/iso_foreword_section.rb +15 -89
  122. data/lib/metanorma/iso_document/sections/iso_preface.rb +15 -21
  123. data/lib/metanorma/iso_document/sections/iso_sections.rb +19 -29
  124. data/lib/metanorma/iso_document/sections/iso_terms_section.rb +6 -9
  125. data/lib/metanorma/iso_document/terms/term_expression.rb +2 -47
  126. data/lib/metanorma/iso_document/terms/term_origin.rb +2 -24
  127. data/lib/metanorma/iso_document/terms/term_source.rb +4 -32
  128. data/lib/metanorma/iso_document.rb +2 -2
  129. data/lib/metanorma/itu_document/root.rb +10 -50
  130. data/lib/metanorma/itu_document.rb +0 -2
  131. data/lib/metanorma/jis_document/metadata/jis_bib_data_extension_type.rb +10 -0
  132. data/lib/metanorma/jis_document/metadata/jis_bibliographic_item.rb +15 -0
  133. data/lib/metanorma/jis_document/metadata.rb +12 -0
  134. data/lib/metanorma/jis_document/root.rb +29 -0
  135. data/lib/metanorma/jis_document/sections/jis_annex_section.rb +20 -0
  136. data/lib/metanorma/jis_document/sections.rb +9 -0
  137. data/lib/metanorma/jis_document.rb +11 -0
  138. data/lib/metanorma/m3d_document/metadata/m3d_bib_data_extension_type.rb +10 -0
  139. data/lib/metanorma/m3d_document/metadata/m3d_bibliographic_item.rb +15 -0
  140. data/lib/metanorma/m3d_document/metadata.rb +12 -0
  141. data/lib/metanorma/m3d_document/root.rb +29 -0
  142. data/lib/metanorma/m3d_document.rb +10 -0
  143. data/lib/metanorma/nist_document/metadata/nist_bib_data_extension_type.rb +10 -0
  144. data/lib/metanorma/nist_document/metadata/nist_bibliographic_item.rb +15 -0
  145. data/lib/metanorma/nist_document/metadata.rb +12 -0
  146. data/lib/metanorma/nist_document/root.rb +29 -0
  147. data/lib/metanorma/nist_document/sections/errata.rb +16 -0
  148. data/lib/metanorma/nist_document/sections/errata_clause.rb +20 -0
  149. data/lib/metanorma/nist_document/sections/errata_row.rb +22 -0
  150. data/lib/metanorma/nist_document/sections/nist_preface.rb +30 -0
  151. data/lib/metanorma/nist_document/sections.rb +12 -0
  152. data/lib/metanorma/nist_document.rb +11 -0
  153. data/lib/metanorma/ogc_document/root.rb +10 -50
  154. data/lib/metanorma/ogc_document.rb +0 -2
  155. data/lib/metanorma/oiml_document/root.rb +8 -47
  156. data/lib/metanorma/oiml_document.rb +2 -3
  157. data/lib/metanorma/plateau_document/metadata/plateau_bibliographic_item.rb +13 -0
  158. data/lib/metanorma/plateau_document/metadata.rb +10 -0
  159. data/lib/metanorma/plateau_document/root.rb +29 -0
  160. data/lib/metanorma/plateau_document.rb +10 -0
  161. data/lib/metanorma/registers/setup.rb +162 -0
  162. data/lib/metanorma/registers.rb +7 -0
  163. data/lib/metanorma/ribose_document/root.rb +10 -52
  164. data/lib/metanorma/ribose_document.rb +0 -2
  165. data/lib/metanorma/standard_document/annotation_container.rb +14 -0
  166. data/lib/metanorma/standard_document/block_attributes.rb +226 -0
  167. data/lib/metanorma/standard_document/blocks/passthrough.rb +1 -18
  168. data/lib/metanorma/standard_document/blocks/requirement_model.rb +18 -163
  169. data/lib/metanorma/standard_document/boilerplate.rb +14 -0
  170. data/lib/metanorma/standard_document/elements/add.rb +1 -17
  171. data/lib/metanorma/standard_document/elements/del.rb +1 -17
  172. data/lib/metanorma/standard_document/metadata/metanorma_extension.rb +16 -0
  173. data/lib/metanorma/standard_document/metadata.rb +2 -0
  174. data/lib/metanorma/standard_document/refs/reference_to_term.rb +2 -1
  175. data/lib/metanorma/standard_document/root_attributes.rb +78 -0
  176. data/lib/metanorma/standard_document/sections/abstract.rb +1 -3
  177. data/lib/metanorma/standard_document/sections/acknowledgements.rb +1 -3
  178. data/lib/metanorma/standard_document/sections/annex_section.rb +81 -16
  179. data/lib/metanorma/standard_document/sections/bibliography_section.rb +1 -2
  180. data/lib/metanorma/standard_document/sections/clause_section.rb +102 -10
  181. data/lib/metanorma/standard_document/sections/colophon.rb +16 -0
  182. data/lib/metanorma/standard_document/sections/definition_section.rb +45 -42
  183. data/lib/metanorma/standard_document/sections/floating_section_title.rb +23 -0
  184. data/lib/metanorma/standard_document/sections/foreword.rb +1 -3
  185. data/lib/metanorma/standard_document/sections/introduction.rb +1 -4
  186. data/lib/metanorma/standard_document/sections/misc_container.rb +5 -2
  187. data/lib/metanorma/standard_document/sections/preface.rb +36 -0
  188. data/lib/metanorma/standard_document/sections/sections.rb +40 -0
  189. data/lib/metanorma/standard_document/sections/standard_content_section.rb +42 -9
  190. data/lib/metanorma/standard_document/sections/terms_section.rb +52 -10
  191. data/lib/metanorma/standard_document/sections.rb +6 -2
  192. data/lib/metanorma/standard_document/terms/designation.rb +1 -1
  193. data/lib/metanorma/standard_document/terms/term_expression.rb +51 -0
  194. data/lib/metanorma/standard_document/terms.rb +1 -0
  195. data/lib/metanorma/standard_document.rb +7 -2
  196. data/lib/metanorma/un_document/metadata/un_bib_data_extension_type.rb +10 -0
  197. data/lib/metanorma/un_document/metadata/un_bibliographic_item.rb +15 -0
  198. data/lib/metanorma/un_document/metadata.rb +12 -0
  199. data/lib/metanorma/un_document/root.rb +29 -0
  200. data/lib/metanorma/un_document/sections/un_preface.rb +23 -0
  201. data/lib/metanorma/un_document/sections/un_sections.rb +24 -0
  202. data/lib/metanorma/un_document/sections.rb +10 -0
  203. data/lib/metanorma/un_document.rb +11 -0
  204. metadata +77 -3
  205. data/lib/metanorma/html/whitespace_patch.rb +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08953283a82f46382002daac11ebb5befc241c798702b21d189db6943ba91f46'
4
- data.tar.gz: 56e998c5b5b02599f863c29136491711f0dcb2b78da77c5c81bdc62967619e70
3
+ metadata.gz: e710334041f766fc137b7ee644dd8ea468df08e44b6f14861814d6ba82af00af
4
+ data.tar.gz: 226cafd839311d7e71beb173682d9579c9f17fe2fa5d43a8d1cf51197ed96c59
5
5
  SHA512:
6
- metadata.gz: acdce24a10e9919a5dd2396ed6c51a30387686671f3ec8e17125bfea76adaba020709007ff36cbbc9697e0a5c95e02155a4c8993f95406e895a2958d2d7b7bd6
7
- data.tar.gz: 3d59fb7d487a8ac32042f4827054c1f2bd301359073bf27840a215f8eae267b91130232124041cec706662e189503b0206c8449cccf57dc562ff2cc6d1104598
6
+ metadata.gz: 3b5ca51582a6300114f12e9fe083cc8affbc3a10c782dc6eeadbfe5f5adef568c72c1c01e5a9dd90dd9cf1275778e0eddbc52634695e669c615faa92f2cc2f4d
7
+ data.tar.gz: cfc53a641db3f0ccdf2fcab42fd9b50ab16358e7446025a83ff0928ffb88f8abadd8ee3748092df727a5622da9e88f9bbf9ec5de79a058b8b665f4734818f67e
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-06 16:15:52 UTC using RuboCop version 1.86.1.
3
+ # on 2026-05-21 05:48:57 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,22 +11,101 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'metanorma-document.gemspec'
13
13
 
14
- # Offense count: 5
14
+ # Offense count: 155
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:
19
26
  Exclude:
20
- - 'lib/metanorma/html/component/index_term_collector.rb'
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'
21
60
  - 'spec/metanorma/html/renderer/architecture_spec.rb'
61
+ - 'spec/metanorma/html/renderer/dead_code_removal_spec.rb'
22
62
 
23
- # Offense count: 5
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
+ 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
24
78
  # This cop supports safe autocorrection (--autocorrect).
25
79
  Layout/EmptyLineAfterGuardClause:
26
80
  Exclude:
81
+ - 'lib/metanorma/html/base_renderer.rb'
27
82
  - 'lib/metanorma/html/generator.rb'
28
83
  - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
29
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'
107
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
108
+
30
109
  # Offense count: 11
31
110
  # This cop supports safe autocorrection (--autocorrect).
32
111
  # Configuration parameters: EnforcedStyle.
@@ -45,7 +124,15 @@ Layout/EmptyLinesAroundClassBody:
45
124
  - 'lib/metanorma/html/pdfa_renderer.rb'
46
125
  - 'lib/metanorma/html/ribose_renderer.rb'
47
126
 
48
- # Offense count: 5
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
49
136
  # This cop supports safe autocorrection (--autocorrect).
50
137
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
51
138
  Layout/ExtraSpacing:
@@ -54,14 +141,105 @@ Layout/ExtraSpacing:
54
141
  - 'lib/metanorma/html/generator.rb'
55
142
  - 'lib/metanorma/html/iho_renderer.rb'
56
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'
57
165
 
58
- # Offense count: 801
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
59
205
  # This cop supports safe autocorrection (--autocorrect).
60
206
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
61
207
  # URISchemes: http, https
62
208
  Layout/LineLength:
63
209
  Enabled: false
64
210
 
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
+ # Offense count: 1
236
+ # 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
+
65
243
  # Offense count: 3
66
244
  # This cop supports safe autocorrection (--autocorrect).
67
245
  # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
@@ -73,6 +251,12 @@ Layout/SpaceAroundOperators:
73
251
  - 'lib/metanorma/html/iho_renderer.rb'
74
252
  - 'lib/metanorma/html/theme.rb'
75
253
 
254
+ # Offense count: 146
255
+ # This cop supports safe autocorrection (--autocorrect).
256
+ # Configuration parameters: AllowInHeredoc.
257
+ Layout/TrailingWhitespace:
258
+ Enabled: false
259
+
76
260
  # Offense count: 1
77
261
  # Configuration parameters: AllowedMethods.
78
262
  # AllowedMethods: enums
@@ -116,28 +300,30 @@ Lint/UnusedMethodArgument:
116
300
  - 'lib/metanorma/html/component/index_section.rb'
117
301
  - 'lib/metanorma/html/generator.rb'
118
302
 
119
- # Offense count: 1
120
- Lint/UselessConstantScoping:
303
+ # Offense count: 4
304
+ # This cop supports safe autocorrection (--autocorrect).
305
+ Lint/UselessAssignment:
121
306
  Exclude:
122
- - 'lib/metanorma/html/base_renderer.rb'
307
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
308
+ - 'spec/metanorma/standard_document/sections_spec.rb'
123
309
 
124
- # Offense count: 78
310
+ # Offense count: 80
125
311
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
126
312
  Metrics/AbcSize:
127
313
  Enabled: false
128
314
 
129
- # Offense count: 22
315
+ # Offense count: 23
130
316
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
131
317
  # AllowedMethods: refine
132
318
  Metrics/BlockLength:
133
- Max: 66
319
+ Max: 80
134
320
 
135
- # Offense count: 2
321
+ # Offense count: 1
136
322
  # Configuration parameters: CountBlocks, CountModifierForms.
137
323
  Metrics/BlockNesting:
138
324
  Max: 4
139
325
 
140
- # Offense count: 58
326
+ # Offense count: 56
141
327
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
142
328
  Metrics/CyclomaticComplexity:
143
329
  Exclude:
@@ -145,10 +331,8 @@ Metrics/CyclomaticComplexity:
145
331
  - 'lib/metanorma/html/base_renderer.rb'
146
332
  - 'lib/metanorma/html/bipm_renderer.rb'
147
333
  - 'lib/metanorma/html/component/index_term_collector.rb'
148
- - 'lib/metanorma/html/drops/example_drop.rb'
149
334
  - 'lib/metanorma/html/drops/figure_drop.rb'
150
335
  - 'lib/metanorma/html/drops/formula_drop.rb'
151
- - 'lib/metanorma/html/drops/note_drop.rb'
152
336
  - 'lib/metanorma/html/generator.rb'
153
337
  - 'lib/metanorma/html/iso_renderer.rb'
154
338
  - 'lib/metanorma/html/ogc_renderer.rb'
@@ -156,17 +340,17 @@ Metrics/CyclomaticComplexity:
156
340
  - 'lib/metanorma/html/theme.rb'
157
341
  - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
158
342
 
159
- # Offense count: 84
343
+ # Offense count: 100
160
344
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
161
345
  Metrics/MethodLength:
162
- Max: 75
346
+ Max: 95
163
347
 
164
348
  # Offense count: 1
165
349
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
166
350
  Metrics/ParameterLists:
167
351
  Max: 7
168
352
 
169
- # Offense count: 53
353
+ # Offense count: 51
170
354
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
171
355
  Metrics/PerceivedComplexity:
172
356
  Exclude:
@@ -174,10 +358,8 @@ Metrics/PerceivedComplexity:
174
358
  - 'lib/metanorma/html/base_renderer.rb'
175
359
  - 'lib/metanorma/html/bipm_renderer.rb'
176
360
  - 'lib/metanorma/html/component/index_term_collector.rb'
177
- - 'lib/metanorma/html/drops/example_drop.rb'
178
361
  - 'lib/metanorma/html/drops/figure_drop.rb'
179
362
  - 'lib/metanorma/html/drops/formula_drop.rb'
180
- - 'lib/metanorma/html/drops/note_drop.rb'
181
363
  - 'lib/metanorma/html/generator.rb'
182
364
  - 'lib/metanorma/html/iso_renderer.rb'
183
365
  - 'lib/metanorma/html/ogc_renderer.rb'
@@ -223,47 +405,82 @@ Naming/PredicatePrefix:
223
405
  Exclude:
224
406
  - 'lib/metanorma/html/standard_renderer.rb'
225
407
 
226
- # Offense count: 15
408
+ # Offense count: 1
409
+ Performance/MapMethodChain:
410
+ Exclude:
411
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
412
+
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
+ # Offense count: 7
426
+ RSpec/BeforeAfterAll:
427
+ Exclude:
428
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
429
+
430
+ # Offense count: 18
227
431
  # Configuration parameters: IgnoredMetadata.
228
432
  RSpec/DescribeClass:
433
+ Enabled: false
434
+
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:
229
440
  Exclude:
230
- - 'spec/metanorma/document_spec.rb'
231
- - 'spec/metanorma/html/renderer/architecture_spec.rb'
232
- - 'spec/metanorma/html/renderer/class_ownership_spec.rb'
233
- - 'spec/metanorma/html/renderer/dead_code_removal_spec.rb'
234
- - 'spec/metanorma/html/renderer/section_rendering_spec.rb'
235
- - 'spec/metanorma/html/renderer/type_registry_spec.rb'
236
- - 'spec/metanorma/iso_document/metadata/title_roundtrip_spec.rb'
237
- - 'spec/metanorma/iso_document/roundtrip/bipm_roundtrip_spec.rb'
238
- - 'spec/metanorma/iso_document/roundtrip/cc_roundtrip_spec.rb'
239
- - 'spec/metanorma/iso_document/roundtrip/iso_amd_roundtrip_spec.rb'
240
- - 'spec/metanorma/iso_document/roundtrip/iso_is_roundtrip_spec.rb'
241
- - 'spec/metanorma/iso_document/roundtrip/itu_roundtrip_spec.rb'
242
- - 'spec/metanorma/iso_document/roundtrip/ogc_roundtrip_spec.rb'
243
- - 'spec/metanorma/iso_document/roundtrip/oiml_collection_roundtrip_spec.rb'
244
- - 'spec/metanorma/iso_document/roundtrip/oiml_roundtrip_spec.rb'
441
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
245
442
 
246
- # Offense count: 4
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
247
450
  # Configuration parameters: CountAsOne.
248
451
  RSpec/ExampleLength:
249
- Max: 8
452
+ Max: 29
453
+
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'
250
459
 
251
460
  # Offense count: 1
252
461
  RSpec/LeakyConstantDeclaration:
253
462
  Exclude:
254
463
  - 'spec/metanorma/html/renderer/class_ownership_spec.rb'
255
464
 
256
- # Offense count: 1
465
+ # Offense count: 2
257
466
  RSpec/MultipleDescribes:
258
467
  Exclude:
259
468
  - 'spec/metanorma/document_spec.rb'
469
+ - 'spec/metanorma/standard_document/sections_spec.rb'
260
470
 
261
471
  # Offense count: 1
262
472
  # Configuration parameters: AllowSubject.
263
473
  RSpec/MultipleMemoizedHelpers:
264
474
  Max: 7
265
475
 
266
- # Offense count: 322
476
+ # Offense count: 30
477
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
478
+ # SupportedStyles: always, named_only
479
+ RSpec/NamedSubject:
480
+ Exclude:
481
+ - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
482
+
483
+ # Offense count: 595
267
484
  # Configuration parameters: AllowedPatterns.
268
485
  # AllowedPatterns: ^expect_, ^assert_
269
486
  RSpec/NoExpectationExample:
@@ -286,7 +503,7 @@ Style/ArgumentsForwarding:
286
503
  - 'lib/metanorma/html/base_renderer.rb'
287
504
  - 'lib/metanorma/html/component/footnote_collector.rb'
288
505
 
289
- # Offense count: 1
506
+ # Offense count: 81
290
507
  # This cop supports safe autocorrection (--autocorrect).
291
508
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
292
509
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -294,8 +511,7 @@ Style/ArgumentsForwarding:
294
511
  # FunctionalMethods: let, let!, subject, watch
295
512
  # AllowedMethods: lambda, proc, it
296
513
  Style/BlockDelimiters:
297
- Exclude:
298
- - 'lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb'
514
+ Enabled: false
299
515
 
300
516
  # Offense count: 5
301
517
  # This cop supports safe autocorrection (--autocorrect).
@@ -305,6 +521,14 @@ Style/ComparableClamp:
305
521
  - 'lib/metanorma/html/iso_renderer.rb'
306
522
  - 'lib/metanorma/html/standard_renderer.rb'
307
523
 
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
+
308
532
  # Offense count: 1
309
533
  # This cop supports unsafe autocorrection (--autocorrect-all).
310
534
  # Configuration parameters: InverseMethods, InverseBlocks.
@@ -312,6 +536,21 @@ Style/InverseMethods:
312
536
  Exclude:
313
537
  - 'lib/metanorma/html/component/index_term_collector.rb'
314
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
+
315
554
  # Offense count: 1
316
555
  # This cop supports unsafe autocorrection (--autocorrect-all).
317
556
  # Configuration parameters: EnforcedStyle.
@@ -326,6 +565,12 @@ Style/NegatedIfElseCondition:
326
565
  Exclude:
327
566
  - 'lib/metanorma/iso_document/metadata/iso_localized_title.rb'
328
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
+
329
574
  # Offense count: 1
330
575
  # This cop supports safe autocorrection (--autocorrect).
331
576
  Style/RedundantRegexpArgument:
@@ -338,6 +583,14 @@ Style/RescueModifier:
338
583
  Exclude:
339
584
  - 'lib/metanorma/html/generator.rb'
340
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
+
341
594
  # Offense count: 1
342
595
  # This cop supports unsafe autocorrection (--autocorrect-all).
343
596
  # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
@@ -346,7 +599,22 @@ Style/SafeNavigation:
346
599
  Exclude:
347
600
  - 'lib/metanorma/html/bipm_renderer.rb'
348
601
 
349
- # Offense count: 2
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
350
618
  # This cop supports safe autocorrection (--autocorrect).
351
619
  # Configuration parameters: EnforcedStyleForMultiline.
352
620
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
@@ -354,3 +622,11 @@ Style/TrailingCommaInArguments:
354
622
  Exclude:
355
623
  - 'lib/metanorma/html/component/footnote_collector.rb'
356
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'
data/Gemfile CHANGED
@@ -24,3 +24,5 @@ gem "rubocop"
24
24
  gem "rubocop-performance"
25
25
  gem "rubocop-rake"
26
26
  gem "rubocop-rspec"
27
+
28
+ gem "concurrent-ruby", "~> 1.3"
@@ -42,7 +42,9 @@ module Metanorma
42
42
  attribute :definitions, Metanorma::BasicDocument::Lists::DefinitionList
43
43
 
44
44
  # Optional footnotes specific to the figure.
45
- attribute :footnotes, BasicObject, collection: true # But actually: ReferenceToldWithParagraphElement
45
+ attribute :footnotes,
46
+ Metanorma::BasicDocument::ReferenceElements::Footnote,
47
+ collection: true
46
48
 
47
49
  xml do
48
50
  element "figure"
@@ -3,9 +3,13 @@
3
3
  module Metanorma
4
4
  module BasicDocument
5
5
  module Blocks
6
- class BasicBlock < Lutaml::Model::Serializable
6
+ class BasicBlock < Metanorma::BasicDocument::Blocks::BasicBlockNoNotes
7
+ attribute :notes, "Metanorma::BasicDocument::Blocks::NoteBlock",
8
+ collection: true
9
+
7
10
  xml do
8
11
  element "basic-block"
12
+ map_element "notes", to: :notes
9
13
  end
10
14
  end
11
15
  end
@@ -4,8 +4,13 @@ module Metanorma
4
4
  module BasicDocument
5
5
  module Blocks
6
6
  class NoteBlock < Metanorma::BasicDocument::Blocks::BasicBlockNoNotes
7
+ attribute :content,
8
+ "Metanorma::BasicDocument::Paragraphs::ParagraphBlock",
9
+ collection: true
10
+
7
11
  xml do
8
12
  element "note"
13
+ map_element "content", to: :content
9
14
  end
10
15
  end
11
16
  end
@@ -1,32 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "blocks/basic_block_no_notes"
4
- require_relative "blocks/basic_block"
5
- require_relative "blocks/note_block"
6
-
7
3
  module Metanorma
8
4
  module BasicDocument
9
5
  module Blocks
6
+ autoload :BasicBlock, "#{__dir__}/blocks/basic_block"
7
+ autoload :BasicBlockNoNotes, "#{__dir__}/blocks/basic_block_no_notes"
8
+ autoload :NoteBlock, "#{__dir__}/blocks/note_block"
10
9
  end
11
10
  end
12
11
  end
13
-
14
- Metanorma::BasicDocument::Blocks::BasicBlock.class_eval do
15
- attribute :notes, Metanorma::BasicDocument::Blocks::NoteBlock,
16
- collection: true
17
-
18
- xml do
19
- map_element "notes", to: :notes
20
- end
21
- end
22
-
23
- require_relative "paragraphs"
24
-
25
- Metanorma::BasicDocument::Blocks::NoteBlock.class_eval do
26
- attribute :content,
27
- Metanorma::BasicDocument::Paragraphs::ParagraphBlock, collection: true
28
-
29
- xml do
30
- map_element "content", to: :content
31
- end
32
- end
@@ -5,7 +5,8 @@ module Metanorma
5
5
  module Lists
6
6
  # List block.
7
7
  class List < Metanorma::BasicDocument::Blocks::BasicBlock
8
- attribute :listitem, BasicObject, collection: true
8
+ attribute :listitem, Metanorma::BasicDocument::Lists::ListItem,
9
+ collection: true
9
10
 
10
11
  xml do
11
12
  element "list"
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metanorma
4
+ module BasicDocument
5
+ module Lists
6
+ class ListItem < Lutaml::Model::Serializable
7
+ attribute :content, :string, collection: true
8
+
9
+ xml do
10
+ element "listitem"
11
+ mixed_content
12
+ map_content to: :content
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end