metanorma-document 0.3.0 → 0.4.0

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 (183) hide show
  1. checksums.yaml +4 -4
  2. data/CLAUDE.md +3 -2
  3. data/Rakefile +30 -5
  4. data/frontend/dist/app.css +1 -0
  5. data/frontend/dist/app.iife.js +24 -0
  6. data/frontend/package-lock.json +7 -505
  7. data/frontend/tailwind.config.js +5 -0
  8. data/lib/metanorma/csa_document/root.rb +27 -0
  9. data/lib/metanorma/csa_document.rb +9 -0
  10. data/lib/metanorma/document/cli.rb +52 -0
  11. data/lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb +14 -0
  12. data/lib/metanorma/document/components/inline/comma_element.rb +3 -0
  13. data/lib/metanorma/document/components/inline/enum_comma_element.rb +3 -0
  14. data/lib/metanorma/document/components/inline/eref_element.rb +4 -1
  15. data/lib/metanorma/document/components/inline/fmt_termsource_element.rb +4 -2
  16. data/lib/metanorma/document/components/inline/math_element.rb +13 -7
  17. data/lib/metanorma/document/components/inline/vocabulary.rb +4 -0
  18. data/lib/metanorma/document/components/multi_paragraph/admonition_block.rb +6 -1
  19. data/lib/metanorma/document/components/paragraphs/paragraph_block.rb +3 -0
  20. data/lib/metanorma/document/components/reference_elements/callout.rb +3 -2
  21. data/lib/metanorma/document/components/tables/table_cell.rb +3 -0
  22. data/lib/metanorma/document/elements/input.rb +44 -0
  23. data/lib/metanorma/document/elements.rb +1 -0
  24. data/lib/metanorma/document/relaton/address.rb +5 -0
  25. data/lib/metanorma/document/relaton/affiliation.rb +3 -0
  26. data/lib/metanorma/document/relaton/bib_item_size.rb +8 -9
  27. data/lib/metanorma/document/relaton/bib_item_type.rb +3 -0
  28. data/lib/metanorma/document/relaton/bibliographic_date.rb +5 -0
  29. data/lib/metanorma/document/relaton/contact_method.rb +5 -0
  30. data/lib/metanorma/document/relaton/contribution_info.rb +6 -2
  31. data/lib/metanorma/document/relaton/contributor.rb +4 -0
  32. data/lib/metanorma/document/relaton/contributor_role.rb +3 -0
  33. data/lib/metanorma/document/relaton/copyright_association.rb +3 -0
  34. data/lib/metanorma/document/relaton/copyright_owner.rb +3 -0
  35. data/lib/metanorma/document/relaton/date_time.rb +3 -0
  36. data/lib/metanorma/document/relaton/document_identifier.rb +4 -0
  37. data/lib/metanorma/document/relaton/document_relation.rb +8 -0
  38. data/lib/metanorma/document/relaton/document_status.rb +4 -0
  39. data/lib/metanorma/document/relaton/formatted_address.rb +4 -0
  40. data/lib/metanorma/document/relaton/full_name.rb +14 -3
  41. data/lib/metanorma/document/relaton/keyword_type.rb +3 -0
  42. data/lib/metanorma/document/relaton/locality_stack.rb +6 -9
  43. data/lib/metanorma/document/relaton/localized_name.rb +8 -5
  44. data/lib/metanorma/document/relaton/logo_element.rb +5 -0
  45. data/lib/metanorma/document/relaton/medium_type.rb +5 -16
  46. data/lib/metanorma/document/relaton/org_identifier.rb +2 -0
  47. data/lib/metanorma/document/relaton/org_subdivision.rb +2 -0
  48. data/lib/metanorma/document/relaton/org_subdivision_identifier.rb +2 -0
  49. data/lib/metanorma/document/relaton/organization.rb +3 -0
  50. data/lib/metanorma/document/relaton/person.rb +7 -1
  51. data/lib/metanorma/document/relaton/person_identifier.rb +3 -0
  52. data/lib/metanorma/document/relaton/place_type.rb +5 -0
  53. data/lib/metanorma/document/relaton/region_element.rb +3 -9
  54. data/lib/metanorma/document/relaton/relaton_collection.rb +2 -0
  55. data/lib/metanorma/document/relaton/series_type.rb +7 -0
  56. data/lib/metanorma/document/relaton/typed_note.rb +4 -0
  57. data/lib/metanorma/document/relaton/typed_title_string.rb +4 -0
  58. data/lib/metanorma/document/relaton/typed_uri.rb +3 -8
  59. data/lib/metanorma/document/relaton/validity_type.rb +8 -10
  60. data/lib/metanorma/document/relaton/variant_full_name.rb +3 -0
  61. data/lib/metanorma/document/relaton/variant_org_name.rb +3 -0
  62. data/lib/metanorma/document/relaton/version_info.rb +5 -0
  63. data/lib/metanorma/document/relaton/vocab_id_type.rb +6 -12
  64. data/lib/metanorma/document/relaton.rb +0 -14
  65. data/lib/metanorma/document/version.rb +1 -1
  66. data/lib/metanorma/document.rb +1 -0
  67. data/lib/metanorma/html/base_renderer.rb +86 -234
  68. data/lib/metanorma/html/concerns/metadata_extraction.rb +61 -0
  69. data/lib/metanorma/html/concerns/presentation_validation.rb +61 -0
  70. data/lib/metanorma/html/concerns/svg_processing.rb +32 -0
  71. data/lib/metanorma/html/concerns/text_extraction.rb +93 -0
  72. data/lib/metanorma/html/concerns/toc_registry.rb +47 -0
  73. data/lib/metanorma/html/csa_renderer.rb +9 -0
  74. data/lib/metanorma/html/drops/figure_drop.rb +33 -10
  75. data/lib/metanorma/html/drops/sourcecode_drop.rb +3 -6
  76. data/lib/metanorma/html/flavor.rb +6 -1
  77. data/lib/metanorma/html/generator.rb +8 -1
  78. data/lib/metanorma/html/iso_renderer.rb +0 -142
  79. data/lib/metanorma/html/renderers/block_renderer.rb +10 -0
  80. data/lib/metanorma/html/renderers/element_order_traversal.rb +15 -1
  81. data/lib/metanorma/html/renderers/inline_renderer.rb +13 -75
  82. data/lib/metanorma/html/standard_renderer.rb +195 -35
  83. data/lib/metanorma/html.rb +1 -51
  84. data/lib/metanorma/iso_document/sections/iso_preface.rb +27 -13
  85. data/lib/metanorma/mirror/default_registry.rb +21 -0
  86. data/lib/metanorma/mirror/handlers/inline/catalog.rb +7 -12
  87. data/lib/metanorma/mirror/handlers/inline/rich_html_renderer.rb +2 -3
  88. data/lib/metanorma/mirror/handlers/sourcecode.rb +1 -1
  89. data/lib/metanorma/mirror/model/guide.rb +3 -2
  90. data/lib/metanorma/mirror/output/formats/inline_format.rb +64 -3
  91. data/lib/metanorma/mirror/output/pipeline.rb +1 -0
  92. data/lib/metanorma/mirror/output.rb +0 -2
  93. data/lib/metanorma/mirror/rewriter.rb +3 -1
  94. data/lib/metanorma/registers/setup.rb +10 -0
  95. data/lib/metanorma/standard_document/annotation_container.rb +2 -0
  96. data/lib/metanorma/standard_document/elements/input.rb +4 -25
  97. data/lib/metanorma/standard_document/metadata/metanorma_extension.rb +12 -2
  98. data/lib/metanorma/standard_document/metadata/presentation_metadata.rb +107 -0
  99. data/lib/metanorma/standard_document/metadata/semantic_metadata.rb +18 -0
  100. data/lib/metanorma/standard_document/metadata/unitsml/amount_of_substance.rb +19 -0
  101. data/lib/metanorma/standard_document/metadata/unitsml/base_quantity.rb +34 -0
  102. data/lib/metanorma/standard_document/metadata/unitsml/dimension.rb +39 -0
  103. data/lib/metanorma/standard_document/metadata/unitsml/dimension_set.rb +19 -0
  104. data/lib/metanorma/standard_document/metadata/unitsml/electric_current.rb +19 -0
  105. data/lib/metanorma/standard_document/metadata/unitsml/enumerated_root_unit.rb +23 -0
  106. data/lib/metanorma/standard_document/metadata/unitsml/length.rb +19 -0
  107. data/lib/metanorma/standard_document/metadata/unitsml/luminous_intensity.rb +19 -0
  108. data/lib/metanorma/standard_document/metadata/unitsml/mass.rb +19 -0
  109. data/lib/metanorma/standard_document/metadata/unitsml/namespace.rb +17 -0
  110. data/lib/metanorma/standard_document/metadata/unitsml/plane_angle.rb +19 -0
  111. data/lib/metanorma/standard_document/metadata/unitsml/prefix.rb +30 -0
  112. data/lib/metanorma/standard_document/metadata/unitsml/prefix_name.rb +21 -0
  113. data/lib/metanorma/standard_document/metadata/unitsml/prefix_set.rb +19 -0
  114. data/lib/metanorma/standard_document/metadata/unitsml/prefix_symbol.rb +21 -0
  115. data/lib/metanorma/standard_document/metadata/unitsml/quantity.rb +28 -0
  116. data/lib/metanorma/standard_document/metadata/unitsml/quantity_name.rb +21 -0
  117. data/lib/metanorma/standard_document/metadata/unitsml/quantity_set.rb +19 -0
  118. data/lib/metanorma/standard_document/metadata/unitsml/root_units.rb +19 -0
  119. data/lib/metanorma/standard_document/metadata/unitsml/thermodynamic_temperature.rb +19 -0
  120. data/lib/metanorma/standard_document/metadata/unitsml/time.rb +19 -0
  121. data/lib/metanorma/standard_document/metadata/unitsml/unit.rb +32 -0
  122. data/lib/metanorma/standard_document/metadata/unitsml/unit_name.rb +21 -0
  123. data/lib/metanorma/standard_document/metadata/unitsml/unit_set.rb +19 -0
  124. data/lib/metanorma/standard_document/metadata/unitsml/unit_symbol.rb +36 -0
  125. data/lib/metanorma/standard_document/metadata/unitsml/unit_system.rb +23 -0
  126. data/lib/metanorma/standard_document/metadata/unitsml/unitsml_root.rb +28 -0
  127. data/lib/metanorma/standard_document/metadata/unitsml.rb +39 -0
  128. data/lib/metanorma/standard_document/metadata.rb +4 -0
  129. data/lib/metanorma/standard_document/sections/misc_container.rb +8 -6
  130. data/lib/metanorma/standard_document/sections/sections.rb +7 -0
  131. data/lib/metanorma/un_document/blocks/un_admonition_block.rb +86 -0
  132. data/lib/metanorma/un_document/blocks.rb +9 -0
  133. data/lib/metanorma/un_document/root.rb +8 -0
  134. data/lib/metanorma/un_document/sections/un_abstract_section.rb +48 -0
  135. data/lib/metanorma/un_document/sections/un_preface.rb +19 -2
  136. data/lib/metanorma/un_document/sections.rb +1 -0
  137. data/lib/metanorma/un_document/un_text_element.rb +116 -0
  138. data/lib/metanorma/un_document.rb +2 -0
  139. data/script/benchmark_render.rb +35 -0
  140. data/tasks/roundtrip_samples.rake +1 -1
  141. metadata +63 -45
  142. data/.rubocop_todo.yml +0 -220
  143. data/TODO.finalize/01-split-multi-class-files.md +0 -8
  144. data/TODO.finalize/02-remove-data-dist-iso-document-frontend.md +0 -6
  145. data/TODO.finalize/03-align-frontend-iife-and-gha-build.md +0 -11
  146. data/TODO.finalize/04-theme-per-flavor-config-driven.md +0 -9
  147. data/TODO.finalize/05-migrate-all-html-to-liquid.md +0 -16
  148. data/TODO.finalize/06-integrate-pubid-library.md +0 -16
  149. data/TODO.finalize/07-replace-relaton-models-with-relaton-bib.md +0 -39
  150. data/TODO.finalize/08-refactor-renderer-architecture.md +0 -25
  151. data/TODO.finalize/09-eliminate-code-smells.md +0 -14
  152. data/TODO.finalize/10-comprehensive-spec-coverage.md +0 -24
  153. data/TODO.finalize/11-config-driven-flavor-metadata.md +0 -20
  154. data/TODO.finalize/12-add-frozen-string-literal.md +0 -6
  155. data/TODO.finalize/13-extract-composition-from-god-class.md +0 -96
  156. data/TODO.finalize/14-config-driven-section-ordering.md +0 -31
  157. data/TODO.finalize/15-theme-directories-per-flavor.md +0 -46
  158. data/TODO.finalize/16-theme-lutaml-model-schema.md +0 -44
  159. data/docs/html-renderer.adoc +0 -261
  160. data/lib/data/dist/iso_document/frontend/assets/index-mwzbzmnK.js +0 -22
  161. data/lib/data/dist/iso_document/frontend/assets/index-pGvKTNid.css +0 -1
  162. data/lib/data/dist/iso_document/frontend/assets/iso-red.svg +0 -53
  163. data/lib/data/dist/iso_document/frontend/index.html +0 -13
  164. data/lib/metanorma/document/relaton/bib_item_size_type.rb +0 -21
  165. data/lib/metanorma/document/relaton/bibliographic_date_type.rb +0 -22
  166. data/lib/metanorma/document/relaton/document_relation_type.rb +0 -31
  167. data/lib/metanorma/document/relaton/iso4217_code.rb +0 -17
  168. data/lib/metanorma/document/relaton/iso8601_date.rb +0 -17
  169. data/lib/metanorma/document/relaton/personal_identifier_type.rb +0 -21
  170. data/lib/metanorma/document/relaton/region_type.rb +0 -20
  171. data/lib/metanorma/document/relaton/series_type_type.rb +0 -21
  172. data/lib/metanorma/document/relaton/specific_locality_type.rb +0 -25
  173. data/lib/metanorma/document/relaton/title_type.rb +0 -21
  174. data/lib/metanorma/mirror/output/html_renderer.rb +0 -95
  175. data/lib/metanorma/mirror/output/html_renderers/block_renderers.rb +0 -178
  176. data/lib/metanorma/mirror/output/html_renderers/inline_renderer.rb +0 -61
  177. data/lib/metanorma/mirror/output/html_renderers/list_renderers.rb +0 -96
  178. data/lib/metanorma/mirror/output/html_renderers/mark_renderers.rb +0 -41
  179. data/lib/metanorma/mirror/output/html_renderers/section_renderers.rb +0 -129
  180. data/lib/metanorma/mirror/output/html_renderers/structural_renderers.rb +0 -80
  181. data/lib/metanorma/mirror/output/html_renderers/table_renderers.rb +0 -87
  182. data/lib/metanorma/mirror/output/html_renderers.rb +0 -76
  183. data/lib/metanorma/standard_document/annotation.rb +0 -37
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-document
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-18 00:00:00.000000000 Z
11
+ date: 2026-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: mml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.4'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.4'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: pubid
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -68,28 +82,11 @@ executables:
68
82
  extensions: []
69
83
  extra_rdoc_files: []
70
84
  files:
71
- - ".rubocop_todo.yml"
72
85
  - CHANGELOG.md
73
86
  - CLAUDE.md
74
87
  - LICENSE.txt
75
88
  - README.adoc
76
89
  - Rakefile
77
- - TODO.finalize/01-split-multi-class-files.md
78
- - TODO.finalize/02-remove-data-dist-iso-document-frontend.md
79
- - TODO.finalize/03-align-frontend-iife-and-gha-build.md
80
- - TODO.finalize/04-theme-per-flavor-config-driven.md
81
- - TODO.finalize/05-migrate-all-html-to-liquid.md
82
- - TODO.finalize/06-integrate-pubid-library.md
83
- - TODO.finalize/07-replace-relaton-models-with-relaton-bib.md
84
- - TODO.finalize/08-refactor-renderer-architecture.md
85
- - TODO.finalize/09-eliminate-code-smells.md
86
- - TODO.finalize/10-comprehensive-spec-coverage.md
87
- - TODO.finalize/11-config-driven-flavor-metadata.md
88
- - TODO.finalize/12-add-frozen-string-literal.md
89
- - TODO.finalize/13-extract-composition-from-god-class.md
90
- - TODO.finalize/14-config-driven-section-ordering.md
91
- - TODO.finalize/15-theme-directories-per-flavor.md
92
- - TODO.finalize/16-theme-lutaml-model-schema.md
93
90
  - data/javascripts/components/mn-code-copy.js
94
91
  - data/javascripts/components/mn-footnotes.js
95
92
  - data/javascripts/components/mn-glossary.js
@@ -158,8 +155,9 @@ files:
158
155
  - data/themes/oiml.yaml
159
156
  - data/themes/pdfa.yaml
160
157
  - data/themes/ribose.yaml
161
- - docs/html-renderer.adoc
162
158
  - exe/metanorma-document
159
+ - frontend/dist/app.css
160
+ - frontend/dist/app.iife.js
163
161
  - frontend/e2e/sample-html.test.ts
164
162
  - frontend/index.html
165
163
  - frontend/package-lock.json
@@ -208,10 +206,6 @@ files:
208
206
  - frontend/tsconfig.node.json
209
207
  - frontend/vite.config.ts
210
208
  - frontend/vitest.e2e.config.ts
211
- - lib/data/dist/iso_document/frontend/assets/index-mwzbzmnK.js
212
- - lib/data/dist/iso_document/frontend/assets/index-pGvKTNid.css
213
- - lib/data/dist/iso_document/frontend/assets/iso-red.svg
214
- - lib/data/dist/iso_document/frontend/index.html
215
209
  - lib/metanorma/basic_document.rb
216
210
  - lib/metanorma/basic_document/ancillary_blocks.rb
217
211
  - lib/metanorma/basic_document/ancillary_blocks/example_block.rb
@@ -361,6 +355,8 @@ files:
361
355
  - lib/metanorma/collection/doc_container.rb
362
356
  - lib/metanorma/collection/entry.rb
363
357
  - lib/metanorma/collection/root.rb
358
+ - lib/metanorma/csa_document.rb
359
+ - lib/metanorma/csa_document/root.rb
364
360
  - lib/metanorma/document.rb
365
361
  - lib/metanorma/document/cli.rb
366
362
  - lib/metanorma/document/components.rb
@@ -570,15 +566,14 @@ files:
570
566
  - lib/metanorma/document/elements.rb
571
567
  - lib/metanorma/document/elements/add.rb
572
568
  - lib/metanorma/document/elements/del.rb
569
+ - lib/metanorma/document/elements/input.rb
573
570
  - lib/metanorma/document/relaton.rb
574
571
  - lib/metanorma/document/relaton/address.rb
575
572
  - lib/metanorma/document/relaton/affiliation.rb
576
573
  - lib/metanorma/document/relaton/bib_item_locality.rb
577
574
  - lib/metanorma/document/relaton/bib_item_size.rb
578
- - lib/metanorma/document/relaton/bib_item_size_type.rb
579
575
  - lib/metanorma/document/relaton/bib_item_type.rb
580
576
  - lib/metanorma/document/relaton/bibliographic_date.rb
581
- - lib/metanorma/document/relaton/bibliographic_date_type.rb
582
577
  - lib/metanorma/document/relaton/contact_method.rb
583
578
  - lib/metanorma/document/relaton/contribution_info.rb
584
579
  - lib/metanorma/document/relaton/contributor.rb
@@ -588,13 +583,10 @@ files:
588
583
  - lib/metanorma/document/relaton/date_time.rb
589
584
  - lib/metanorma/document/relaton/document_identifier.rb
590
585
  - lib/metanorma/document/relaton/document_relation.rb
591
- - lib/metanorma/document/relaton/document_relation_type.rb
592
586
  - lib/metanorma/document/relaton/document_status.rb
593
587
  - lib/metanorma/document/relaton/edition.rb
594
588
  - lib/metanorma/document/relaton/formatted_address.rb
595
589
  - lib/metanorma/document/relaton/full_name.rb
596
- - lib/metanorma/document/relaton/iso4217_code.rb
597
- - lib/metanorma/document/relaton/iso8601_date.rb
598
590
  - lib/metanorma/document/relaton/keyword_type.rb
599
591
  - lib/metanorma/document/relaton/locality_stack.rb
600
592
  - lib/metanorma/document/relaton/localized_name.rb
@@ -606,17 +598,12 @@ files:
606
598
  - lib/metanorma/document/relaton/organization.rb
607
599
  - lib/metanorma/document/relaton/person.rb
608
600
  - lib/metanorma/document/relaton/person_identifier.rb
609
- - lib/metanorma/document/relaton/personal_identifier_type.rb
610
601
  - lib/metanorma/document/relaton/phone.rb
611
602
  - lib/metanorma/document/relaton/place_type.rb
612
603
  - lib/metanorma/document/relaton/price_type.rb
613
604
  - lib/metanorma/document/relaton/region_element.rb
614
- - lib/metanorma/document/relaton/region_type.rb
615
605
  - lib/metanorma/document/relaton/relaton_collection.rb
616
606
  - lib/metanorma/document/relaton/series_type.rb
617
- - lib/metanorma/document/relaton/series_type_type.rb
618
- - lib/metanorma/document/relaton/specific_locality_type.rb
619
- - lib/metanorma/document/relaton/title_type.rb
620
607
  - lib/metanorma/document/relaton/typed_note.rb
621
608
  - lib/metanorma/document/relaton/typed_title_string.rb
622
609
  - lib/metanorma/document/relaton/typed_uri.rb
@@ -644,6 +631,12 @@ files:
644
631
  - lib/metanorma/html/component/footnote_collector.rb
645
632
  - lib/metanorma/html/component/index_section.rb
646
633
  - lib/metanorma/html/component/index_term_collector.rb
634
+ - lib/metanorma/html/concerns/metadata_extraction.rb
635
+ - lib/metanorma/html/concerns/presentation_validation.rb
636
+ - lib/metanorma/html/concerns/svg_processing.rb
637
+ - lib/metanorma/html/concerns/text_extraction.rb
638
+ - lib/metanorma/html/concerns/toc_registry.rb
639
+ - lib/metanorma/html/csa_renderer.rb
647
640
  - lib/metanorma/html/drops.rb
648
641
  - lib/metanorma/html/drops/admonition_drop.rb
649
642
  - lib/metanorma/html/drops/biblio_entry_drop.rb
@@ -884,15 +877,6 @@ files:
884
877
  - lib/metanorma/mirror/output/formats.rb
885
878
  - lib/metanorma/mirror/output/formats/base_format.rb
886
879
  - lib/metanorma/mirror/output/formats/inline_format.rb
887
- - lib/metanorma/mirror/output/html_renderer.rb
888
- - lib/metanorma/mirror/output/html_renderers.rb
889
- - lib/metanorma/mirror/output/html_renderers/block_renderers.rb
890
- - lib/metanorma/mirror/output/html_renderers/inline_renderer.rb
891
- - lib/metanorma/mirror/output/html_renderers/list_renderers.rb
892
- - lib/metanorma/mirror/output/html_renderers/mark_renderers.rb
893
- - lib/metanorma/mirror/output/html_renderers/section_renderers.rb
894
- - lib/metanorma/mirror/output/html_renderers/structural_renderers.rb
895
- - lib/metanorma/mirror/output/html_renderers/table_renderers.rb
896
880
  - lib/metanorma/mirror/output/pipeline.rb
897
881
  - lib/metanorma/mirror/output/pipeline_context.rb
898
882
  - lib/metanorma/mirror/rewriter.rb
@@ -930,7 +914,6 @@ files:
930
914
  - lib/metanorma/ribose_document/metadata/ribose_bibliographic_item.rb
931
915
  - lib/metanorma/ribose_document/root.rb
932
916
  - lib/metanorma/standard_document.rb
933
- - lib/metanorma/standard_document/annotation.rb
934
917
  - lib/metanorma/standard_document/annotation_container.rb
935
918
  - lib/metanorma/standard_document/block_attributes.rb
936
919
  - lib/metanorma/standard_document/blocks.rb
@@ -988,10 +971,40 @@ files:
988
971
  - lib/metanorma/standard_document/metadata/editorial_group_type.rb
989
972
  - lib/metanorma/standard_document/metadata/ics_type.rb
990
973
  - lib/metanorma/standard_document/metadata/metanorma_extension.rb
974
+ - lib/metanorma/standard_document/metadata/presentation_metadata.rb
975
+ - lib/metanorma/standard_document/metadata/semantic_metadata.rb
991
976
  - lib/metanorma/standard_document/metadata/standard_bib_data.rb
992
977
  - lib/metanorma/standard_document/metadata/standard_bib_data_extension_type.rb
993
978
  - lib/metanorma/standard_document/metadata/structured_identifier_type.rb
994
979
  - lib/metanorma/standard_document/metadata/technical_committee_type.rb
980
+ - lib/metanorma/standard_document/metadata/unitsml.rb
981
+ - lib/metanorma/standard_document/metadata/unitsml/amount_of_substance.rb
982
+ - lib/metanorma/standard_document/metadata/unitsml/base_quantity.rb
983
+ - lib/metanorma/standard_document/metadata/unitsml/dimension.rb
984
+ - lib/metanorma/standard_document/metadata/unitsml/dimension_set.rb
985
+ - lib/metanorma/standard_document/metadata/unitsml/electric_current.rb
986
+ - lib/metanorma/standard_document/metadata/unitsml/enumerated_root_unit.rb
987
+ - lib/metanorma/standard_document/metadata/unitsml/length.rb
988
+ - lib/metanorma/standard_document/metadata/unitsml/luminous_intensity.rb
989
+ - lib/metanorma/standard_document/metadata/unitsml/mass.rb
990
+ - lib/metanorma/standard_document/metadata/unitsml/namespace.rb
991
+ - lib/metanorma/standard_document/metadata/unitsml/plane_angle.rb
992
+ - lib/metanorma/standard_document/metadata/unitsml/prefix.rb
993
+ - lib/metanorma/standard_document/metadata/unitsml/prefix_name.rb
994
+ - lib/metanorma/standard_document/metadata/unitsml/prefix_set.rb
995
+ - lib/metanorma/standard_document/metadata/unitsml/prefix_symbol.rb
996
+ - lib/metanorma/standard_document/metadata/unitsml/quantity.rb
997
+ - lib/metanorma/standard_document/metadata/unitsml/quantity_name.rb
998
+ - lib/metanorma/standard_document/metadata/unitsml/quantity_set.rb
999
+ - lib/metanorma/standard_document/metadata/unitsml/root_units.rb
1000
+ - lib/metanorma/standard_document/metadata/unitsml/thermodynamic_temperature.rb
1001
+ - lib/metanorma/standard_document/metadata/unitsml/time.rb
1002
+ - lib/metanorma/standard_document/metadata/unitsml/unit.rb
1003
+ - lib/metanorma/standard_document/metadata/unitsml/unit_name.rb
1004
+ - lib/metanorma/standard_document/metadata/unitsml/unit_set.rb
1005
+ - lib/metanorma/standard_document/metadata/unitsml/unit_symbol.rb
1006
+ - lib/metanorma/standard_document/metadata/unitsml/unit_system.rb
1007
+ - lib/metanorma/standard_document/metadata/unitsml/unitsml_root.rb
995
1008
  - lib/metanorma/standard_document/namespace.rb
996
1009
  - lib/metanorma/standard_document/refs.rb
997
1010
  - lib/metanorma/standard_document/refs/reference_to_term.rb
@@ -1052,13 +1065,18 @@ files:
1052
1065
  - lib/metanorma/standard_document/terms/term_source_type.rb
1053
1066
  - lib/metanorma/standard_document/terms/verbal_expression.rb
1054
1067
  - lib/metanorma/un_document.rb
1068
+ - lib/metanorma/un_document/blocks.rb
1069
+ - lib/metanorma/un_document/blocks/un_admonition_block.rb
1055
1070
  - lib/metanorma/un_document/metadata.rb
1056
1071
  - lib/metanorma/un_document/metadata/un_bib_data_extension_type.rb
1057
1072
  - lib/metanorma/un_document/metadata/un_bibliographic_item.rb
1058
1073
  - lib/metanorma/un_document/root.rb
1059
1074
  - lib/metanorma/un_document/sections.rb
1075
+ - lib/metanorma/un_document/sections/un_abstract_section.rb
1060
1076
  - lib/metanorma/un_document/sections/un_preface.rb
1061
1077
  - lib/metanorma/un_document/sections/un_sections.rb
1078
+ - lib/metanorma/un_document/un_text_element.rb
1079
+ - script/benchmark_render.rb
1062
1080
  - script/render_both.rb
1063
1081
  - tasks/roundtrip_samples.rake
1064
1082
  homepage: https://github.com/metanorma/metanorma-document
@@ -1077,7 +1095,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1077
1095
  requirements:
1078
1096
  - - ">="
1079
1097
  - !ruby/object:Gem::Version
1080
- version: '3.1'
1098
+ version: '3.3'
1081
1099
  required_rubygems_version: !ruby/object:Gem::Requirement
1082
1100
  requirements:
1083
1101
  - - ">="
data/.rubocop_todo.yml DELETED
@@ -1,220 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2026-07-18 16:00:24 UTC using RuboCop version 1.86.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- Gemspec/RequiredRubyVersion:
11
- Exclude:
12
- - 'metanorma-document.gemspec'
13
-
14
- # Offense count: 703
15
- # This cop supports safe autocorrection (--autocorrect).
16
- # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
17
- # URISchemes: http, https
18
- Layout/LineLength:
19
- Enabled: false
20
-
21
- # Offense count: 2
22
- # Configuration parameters: AllowedMethods.
23
- # AllowedMethods: enums
24
- Lint/ConstantDefinitionInBlock:
25
- Exclude:
26
- - 'spec/metanorma/html/renderer/class_ownership_spec.rb'
27
- - 'spec/metanorma/html/renderer/liquid_templates_spec.rb'
28
-
29
- # Offense count: 3
30
- # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
31
- Lint/DuplicateBranch:
32
- Exclude:
33
- - 'lib/metanorma/html/base_renderer.rb'
34
- - 'lib/metanorma/html/renderers/inline_renderer.rb'
35
- - 'lib/metanorma/html/standard_renderer.rb'
36
-
37
- # Offense count: 2
38
- # Configuration parameters: AllowComments, AllowEmptyLambdas.
39
- Lint/EmptyBlock:
40
- Exclude:
41
- - 'spec/metanorma/iso_document/metadata/title_roundtrip_spec.rb'
42
-
43
- # Offense count: 4
44
- # Configuration parameters: AllowedParentClasses.
45
- Lint/MissingSuper:
46
- Exclude:
47
- - 'lib/metanorma/html/drops/figure_drop.rb'
48
- - 'lib/metanorma/html/drops/formula_drop.rb'
49
- - 'lib/metanorma/html/drops/sourcecode_drop.rb'
50
- - 'lib/metanorma/mirror/id_strategy/positional.rb'
51
-
52
- # Offense count: 1
53
- Lint/StructNewOverride:
54
- Exclude:
55
- - 'lib/metanorma/html/component/index_term_collector.rb'
56
-
57
- # Offense count: 23
58
- # This cop supports safe autocorrection (--autocorrect).
59
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
60
- # NotImplementedExceptions: NotImplementedError
61
- Lint/UnusedMethodArgument:
62
- Exclude:
63
- - 'lib/metanorma/mirror/handlers/formula.rb'
64
- - 'lib/metanorma/mirror/handlers/sourcecode.rb'
65
- - 'lib/metanorma/mirror/output/html_renderers/block_renderers.rb'
66
- - 'lib/metanorma/mirror/output/html_renderers/list_renderers.rb'
67
- - 'lib/metanorma/mirror/output/html_renderers/section_renderers.rb'
68
- - 'lib/metanorma/mirror/output/html_renderers/structural_renderers.rb'
69
- - 'lib/metanorma/mirror/output/html_renderers/table_renderers.rb'
70
- - 'spec/metanorma/mirror/handler_registry_spec.rb'
71
- - 'spec/metanorma/mirror/html_renderer_spec.rb'
72
-
73
- # Offense count: 114
74
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
75
- Metrics/AbcSize:
76
- Enabled: false
77
-
78
- # Offense count: 12
79
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
80
- # AllowedMethods: refine
81
- Metrics/BlockLength:
82
- Max: 76
83
-
84
- # Offense count: 3
85
- # Configuration parameters: CountBlocks, CountModifierForms.
86
- Metrics/BlockNesting:
87
- Max: 4
88
-
89
- # Offense count: 84
90
- # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
91
- Metrics/CyclomaticComplexity:
92
- Enabled: false
93
-
94
- # Offense count: 149
95
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
96
- Metrics/MethodLength:
97
- Max: 102
98
-
99
- # Offense count: 3
100
- # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
101
- Metrics/ParameterLists:
102
- Max: 7
103
-
104
- # Offense count: 68
105
- # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
106
- Metrics/PerceivedComplexity:
107
- Enabled: false
108
-
109
- # Offense count: 52
110
- # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
111
- # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
112
- Naming/MethodParameterName:
113
- Exclude:
114
- - 'lib/metanorma/html/base_renderer.rb'
115
- - 'lib/metanorma/html/component/footnote_collector.rb'
116
- - 'lib/metanorma/html/drops/sourcecode_drop.rb'
117
- - 'lib/metanorma/html/iso_renderer.rb'
118
- - 'lib/metanorma/html/renderers/block_renderer.rb'
119
- - 'lib/metanorma/html/renderers/inline_renderer.rb'
120
- - 'spec/metanorma/html/renderer/footnote_collector_spec.rb'
121
-
122
- # Offense count: 4
123
- # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
124
- # AllowedMethods: call
125
- # WaywardPredicates: infinite?, nonzero?
126
- Naming/PredicateMethod:
127
- Exclude:
128
- - 'lib/metanorma/html/base_renderer.rb'
129
- - 'lib/metanorma/html/drops/biblio_entry_drop.rb'
130
- - 'lib/metanorma/html/renderers/inline_renderer.rb'
131
-
132
- # Offense count: 3
133
- # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
134
- # NamePrefix: is_, has_, have_, does_
135
- # ForbiddenPrefixes: is_, has_, have_, does_
136
- # AllowedMethods: is_a?
137
- # MethodDefinitionMacros: define_method, define_singleton_method
138
- Naming/PredicatePrefix:
139
- Exclude:
140
- - 'spec/**/*'
141
- - 'lib/metanorma/html/base_renderer.rb'
142
- - 'lib/metanorma/html/drops/biblio_entry_drop.rb'
143
-
144
- # Offense count: 1
145
- Performance/MapMethodChain:
146
- Exclude:
147
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
148
-
149
- # Offense count: 7
150
- RSpec/BeforeAfterAll:
151
- Exclude:
152
- - '**/spec/spec_helper.rb'
153
- - '**/spec/rails_helper.rb'
154
- - '**/spec/support/**/*.rb'
155
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
156
-
157
- # Offense count: 14
158
- # Configuration parameters: Prefixes, AllowedPatterns.
159
- # Prefixes: when, with, without
160
- RSpec/ContextWording:
161
- Exclude:
162
- - 'spec/metanorma/html/renderer/theme_spec.rb'
163
- - 'spec/metanorma/mirror/html_renderer_spec.rb'
164
-
165
- # Offense count: 32
166
- # Configuration parameters: IgnoredMetadata.
167
- RSpec/DescribeClass:
168
- Enabled: false
169
-
170
- # Offense count: 234
171
- # Configuration parameters: CountAsOne.
172
- RSpec/ExampleLength:
173
- Max: 37
174
-
175
- # Offense count: 2
176
- RSpec/LeakyConstantDeclaration:
177
- Exclude:
178
- - 'spec/metanorma/html/renderer/class_ownership_spec.rb'
179
- - 'spec/metanorma/html/renderer/liquid_templates_spec.rb'
180
-
181
- # Offense count: 5
182
- RSpec/MultipleDescribes:
183
- Exclude:
184
- - 'spec/metanorma/document_spec.rb'
185
- - 'spec/metanorma/html/flavor_registry_spec.rb'
186
- - 'spec/metanorma/mirror/handlers/remaining_handlers_spec.rb'
187
- - 'spec/metanorma/mirror/serialization_spec.rb'
188
- - 'spec/metanorma/standard_document/sections_spec.rb'
189
-
190
- # Offense count: 1
191
- # Configuration parameters: AllowSubject.
192
- RSpec/MultipleMemoizedHelpers:
193
- Max: 7
194
-
195
- # Offense count: 30
196
- # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
197
- # SupportedStyles: always, named_only
198
- RSpec/NamedSubject:
199
- Exclude:
200
- - 'spec/metanorma/flavor_roots/flavor_roots_spec.rb'
201
-
202
- # Offense count: 1076
203
- # Configuration parameters: AllowedPatterns.
204
- # AllowedPatterns: ^expect_, ^assert_
205
- RSpec/NoExpectationExample:
206
- Enabled: false
207
-
208
- # Offense count: 29
209
- # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
210
- # SupportedInflectors: default, active_support
211
- RSpec/SpecFilePathFormat:
212
- Enabled: false
213
-
214
- # Offense count: 5
215
- # This cop supports safe autocorrection (--autocorrect).
216
- Style/ComparableClamp:
217
- Exclude:
218
- - 'lib/metanorma/html/iso_renderer.rb'
219
- - 'lib/metanorma/html/renderers/section_renderer.rb'
220
- - 'lib/metanorma/html/standard_renderer.rb'
@@ -1,8 +0,0 @@
1
- # 01 — Split multi-class files into one-class-per-file — DONE
2
-
3
- All model files now contain exactly one class per file. Verified: every file under `lib/metanorma/document/`, `lib/metanorma/standard_document/`, `lib/metanorma/iso_document/`, `lib/metanorma/bipm_document/`, `lib/metanorma/itu_document/`, `lib/metanorma/ietf_document/`, `lib/metanorma/cc_document/` is single-class.
4
-
5
- Nested classes that are only used internally by their parent (e.g. `AnnotationContainer::Annotation`) are legitimate and NOT split.
6
-
7
- ## Code quality requirements
8
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,6 +0,0 @@
1
- # 02 — Remove misplaced `data/dist/iso_document/frontend/` artifacts — DONE
2
-
3
- `data/dist/iso_document/frontend/` directory no longer exists. Frontend build artifacts are correctly placed in `frontend/dist/` and included in gemspec via `Dir.glob("frontend/dist/*")`.
4
-
5
- ## Code quality requirements
6
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,11 +0,0 @@
1
- # 03 — Align frontend IIFE build and GHA gem release with docbook pattern — DONE
2
-
3
- Aligned with docbook project:
4
- - `Rakefile` has `build_frontend` task + release hook
5
- - `gemspec` includes `frontend/dist/*`
6
- - `.github/workflows/rake.yml` has `after-setup-ruby: cd frontend && npm install && npm run build`
7
- - `frontend/vite.config.ts` produces `app.iife.js` + `app.css`
8
- - `.gitignore` has `frontend/node_modules/` and `frontend/dist/`
9
-
10
- ## Code quality requirements
11
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,9 +0,0 @@
1
- # 04 — Data-centric theme system: config files per flavor — DONE
2
-
3
- All 13 flavor themes extracted to `data/themes/{flavor}.yaml`. `Theme.load(:iso)` reads YAML and applies overrides. BaseRenderer provides default `Theme.new`. Every flavor renderer uses `Theme.load(:flavor_name)`.
4
-
5
- ### Remaining enhancement
6
- Publisher metadata (publishers, publisher_name, logo_map, font_url) still hardcoded in flavor renderers. These should move into theme YAML config so flavor renderers can be auto-generated from config alone.
7
-
8
- ## Code quality requirements
9
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,16 +0,0 @@
1
- # 05 — Migrate all HTML generation to Liquid templates — DONE
2
-
3
- All HTML element generation uses Liquid templates. Zero raw HTML string injection via `@output <<` remains. The `tag()` helper has been removed from `base_renderer.rb`. All remaining `@output <<` calls are text streaming (`escape_html`, whitespace, raw content passthrough) — not HTML element generation.
4
-
5
- 32+ Liquid templates exist in `lib/metanorma/html/templates/`. The generic `_element.html.liquid` handles most tag wrapping. Specialized templates exist for tables, lists, figures, headings, math, links, etc.
6
-
7
- ### OOP Liquid pattern
8
- All rendering uses the `capture_output` + `render_liquid` pattern:
9
- 1. Capture child content into a Ruby string via `capture_output`
10
- 2. Pass captured content to `render_liquid("_template.html.liquid", assigns)`
11
- 3. Result is appended to `@output` by the caller
12
-
13
- Drop classes (`Drops::*`) are used for complex objects that need pre-rendered HTML fields (e.g. `BiblioEntryDrop`, `FigureDrop`).
14
-
15
- ## Code quality requirements
16
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,16 +0,0 @@
1
- # 06 — Integrate pubid library for publication identifier handling — DONE
2
-
3
- ## What was done
4
- 1. Added `pubid ~> 2.0` to gemspec dependency
5
- 2. Added `gem "pubid", path: "../../mn/pubid"` to Gemfile for local dev
6
- 3. Created `lib/metanorma/html/concerns/pubid_rendering.rb` — `PubidRendering` module with:
7
- - `FLAVOR_PUBID_MAP` mapping document class names to pubid modules
8
- - `parse_pubid(docidentifier_string)` — flavor-aware pubid parsing
9
- - `pubid_to_html(identifier)` — renders to semantic HTML with CSS classes
10
- - `resolve_pubid_module` — auto-detects flavor from renderer class
11
- 4. Wired into `BaseRenderer` via `include PubidRendering`
12
- 5. Refactored `render_bibitem_content` in `standard_renderer.rb` to try pubid first
13
- 6. Created specs in `pubid_rendering_spec.rb`
14
-
15
- ## Code quality requirements
16
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,39 +0,0 @@
1
- # 07 — Integrate relaton-bib library (partially complete)
2
-
3
- ## Status
4
- - **Done**: relaton-bib dependency added, 4 models replaced via inheritance, `require` at module level
5
- - **Blocked**: Most models have incompatible XML schemas (different attribute names/types, different XML mappings)
6
-
7
- ## What was done
8
- 1. Added `relaton-bib ~> 2.1` to gemspec dependency
9
- 2. Added `require "relaton/bib"` to `lib/metanorma/document/relaton.rb`
10
- 3. Replaced 4 models with inheritance from relaton-bib:
11
- - `Phone` < `::Relaton::Bib::Phone` (exact match)
12
- - `PriceType` < `::Relaton::Bib::Price` (exact match)
13
- - `BibItemLocality` < `::Relaton::Bib::Locality` (exact match)
14
- - `Edition` < `::Relaton::Bib::Edition` (inherits + adds `language` attribute)
15
-
16
- ## Why most models can't be directly replaced
17
- The 53 relaton models in our project have different XML schemas from relaton-bib's models:
18
-
19
- | Difference | Our models | relaton-bib |
20
- |---|---|---|
21
- | Attribute names | `on` (BibliographicDate), `bib_locality` (LocalityStack), `validity_begins` (ValidityType) | `at`, `locality`, `begins` |
22
- | Attribute types | `Components::DataTypes::*` throughout | `LocalizedString`, `LocalizedMarkedUpString` |
23
- | XML mapping | `map_attribute` for medium, `map_all_content` for logo | `map_element` for medium, `map_element "image"` for logo |
24
- | Extra attributes | `language` on Edition, `id` on DocumentIdentifier, `stage_abbreviation` on DocumentStatus | Not present |
25
- | Mixed content | Used in TypedTitleString (em/fn/stem/strong/sub/sup/tt/variant) | Plain content |
26
- | Model nesting | `CopyrightOwner` wraps `Organization` | `Contributor` as owner |
27
-
28
- A full replacement requires updating all 86 consuming references and adapting to relaton-bib's API. This is a separate project-level migration.
29
-
30
- ## Remaining work for full migration
31
- 1. Update consuming code (86 references) to use relaton-bib attribute names
32
- 2. For models with extra attributes: inherit from relaton-bib and add extras
33
- 3. For models with structural differences: create adapter classes
34
- 4. Remove `lib/metanorma/document/relaton/` once fully migrated
35
- 5. Update autoload configuration
36
- 6. Integration specs for relaton-bib model usage
37
-
38
- ## Code quality requirements
39
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,25 +0,0 @@
1
- # 08 — Refactor renderer architecture for OCP and DRY — DONE
2
-
3
- ### Completed decomposition (Phase 1)
4
- BaseRenderer originally included three concern modules:
5
- - `InlineRendering` (~590 lines, 39 methods)
6
- - `BlockRendering` (~295 lines, 24 methods)
7
- - `SectionRendering` (~90 lines, 8 methods)
8
-
9
- ### Completed composition (Phase 2 — TODO 13)
10
- Module includes replaced with composition. Each module became a standalone class:
11
- - `Renderers::InlineRenderer` at `lib/metanorma/html/renderers/inline_renderer.rb`
12
- - `Renderers::BlockRenderer` at `lib/metanorma/html/renderers/block_renderer.rb`
13
- - `Renderers::SectionRenderer` at `lib/metanorma/html/renderers/section_renderer.rb`
14
- - `Renderers::PubidRenderer` at `lib/metanorma/html/renderers/pubid_renderer.rb`
15
-
16
- BaseRenderer is now a thin coordinator with delegation wrappers for backward compatibility.
17
- Old concern modules at `lib/metanorma/html/concerns/` are no longer referenced and can be removed.
18
-
19
- ### Remaining enhancements
20
- - Publisher metadata (flavor_publishers, flavor_publisher_name, publisher_logo_map) duplicated across 12+ flavor renderers. See TODO 11 for config-driven migration.
21
- - Config-driven section ordering. See TODO 14.
22
- - Theme directories per flavor. See TODO 15.
23
-
24
- ## Code quality requirements
25
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,14 +0,0 @@
1
- # 09 — Eliminate code smells and enforce project constraints — DONE
2
-
3
- ## Fixed
4
- - `respond_to?` duck-typing eliminated from inline_rendering.rb (replaced with `is_a?`)
5
- - `tag()` helper removed from base_renderer (replaced with Liquid `_element.html.liquid`)
6
- - All `@output <<` raw HTML generation eliminated
7
- - `method_missing` + `respond_to_missing?` eliminated from RendererContext (replaced with explicit `def` methods)
8
- - `public_send(attr)` in boilerplate_to_xml replaced with explicit `collect_boilerplate_part` helper
9
- - `public_send(setter)` in Theme.load is acceptable — setter list validated via `VALID_KEYS`/`SETTERS` constants
10
- - `instance_variable_get`/`instance_variable_set` eliminated from Drops and Component::Base (replaced with `OutputProxy` wrapper)
11
- - `# frozen_string_literal: true` added to all 48 inline component files
12
-
13
- ## Code quality requirements
14
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. ultrathink. Always think about what can we improve here in architecture and code? Make sure we have good specs throughout. Never use private send methods (breaks encapsulation), instance_variable_set/get, and never use respond_to? (poor typing).
@@ -1,24 +0,0 @@
1
- # 10 — Comprehensive spec coverage for HTML rendering pipeline — DONE
2
-
3
- ## Status
4
- All HTML renderer specs use real model instances (zero doubles). Coverage spans theme loading, config-driven ordering, composition, pubid, metadata, CSS generation, and Liquid templates.
5
-
6
- ## Spec count
7
- - Current: 159+ examples passing (0 failures) — ~40 pre-existing moxml failures excluded (upstream lutaml-model issue)
8
-
9
- ## Spec files
10
- 1. `theme_spec.rb` — 111 specs: defaults, all 13 flavor loading, publisher metadata, directory-based themes, lutaml-model schema validation
11
- 2. `config_metadata_spec.rb` — 8 specs: theme auto-resolution, publisher/logo config from YAML
12
- 3. `config_preface_spec.rb` — 8 specs: config-driven preface ordering (ordered mode, wrapped mode, clause filtering, delegation) using real IsoPreface models
13
- 4. `composition_spec.rb` — 10 specs: sub-renderer composition, delegation wrappers, theme resolution using real IsoClauseSection models
14
- 5. `pubid_rendering_spec.rb` — 3 specs: pubid parsing and HTML generation via composition using real IsoDocument::Root
15
- 6. `base_renderer_spec.rb` — 19 specs: escape_html, element_attrs, utility methods
16
- 7. `liquid_templates_spec.rb` — 62 specs: all 48 templates + 12 individual template tests
17
- 8. `relaton_bib_spec.rb` — relaton-bib model inheritance verification
18
-
19
- ## Key decisions
20
- - **Zero doubles**: All specs use real lutaml-model instances (IsoPreface, IsoClauseSection, IsoForewordSection, IsoDocument::Root, Theme)
21
- - **Zero instance_variable_set**: Only used in pubid_rendering_spec for setting @document (coordinator's required state) — acceptable for test setup
22
-
23
- ## Code quality requirements
24
- Ensure code cleanliness and OOP and MECE and fully model-driven, semantically-driven and open/closed principle, DRY, performance. Never use private send methods (breaks encapsulation), instance_variable_set/get, never use respond_to? (poor typing). NEVER use RSpec doubles — use real model instances.