metanorma-document 0.2.9 → 0.2.12
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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +164 -66
- data/CLAUDE.md +26 -0
- data/README.adoc +144 -0
- data/Rakefile +14 -2
- data/TODO.finalize/01-split-multi-class-files.md +8 -0
- data/TODO.finalize/02-remove-data-dist-iso-document-frontend.md +6 -0
- data/TODO.finalize/03-align-frontend-iife-and-gha-build.md +11 -0
- data/TODO.finalize/04-theme-per-flavor-config-driven.md +9 -0
- data/TODO.finalize/05-migrate-all-html-to-liquid.md +16 -0
- data/TODO.finalize/06-integrate-pubid-library.md +16 -0
- data/TODO.finalize/07-replace-relaton-models-with-relaton-bib.md +39 -0
- data/TODO.finalize/08-refactor-renderer-architecture.md +25 -0
- data/TODO.finalize/09-eliminate-code-smells.md +14 -0
- data/TODO.finalize/10-comprehensive-spec-coverage.md +24 -0
- data/TODO.finalize/11-config-driven-flavor-metadata.md +20 -0
- data/TODO.finalize/12-add-frozen-string-literal.md +6 -0
- data/TODO.finalize/13-extract-composition-from-god-class.md +96 -0
- data/TODO.finalize/14-config-driven-section-ordering.md +31 -0
- data/TODO.finalize/15-theme-directories-per-flavor.md +46 -0
- data/TODO.finalize/16-theme-lutaml-model-schema.md +44 -0
- data/data/javascripts/components/mn-footnotes.js +68 -0
- data/data/javascripts/components/mn-lightbox.js +18 -2
- data/data/javascripts/components/mn-shortcuts.js +2 -0
- data/data/javascripts/core/mn-navigation.js +8 -0
- data/data/javascripts/core/mn-theme.js +9 -9
- data/data/logos/oiml-logo-full-dark.svg +1 -0
- data/data/logos/oiml-logo-full-light.svg +1 -0
- data/data/logos/oiml-logo-icon-dark.svg +1 -0
- data/data/logos/oiml-logo-icon-light.svg +1 -0
- data/data/logos/oiml-logo.svg +1 -0
- data/data/logos/pdfa-logo.svg +31 -94
- data/data/stylesheets/base/_layout.css +3 -0
- data/data/stylesheets/base/_reset.css +3 -3
- data/data/stylesheets/base/_typography.css +0 -5
- data/data/stylesheets/components/bibliography.css +3 -3
- data/data/stylesheets/components/cover.css +3 -1
- data/data/stylesheets/components/figure.css +13 -1
- data/data/stylesheets/components/footnote.css +65 -5
- data/data/stylesheets/components/formula.css +44 -0
- data/data/stylesheets/components/header.css +17 -2
- data/data/stylesheets/components/inline.css +1 -1
- data/data/stylesheets/components/table.css +15 -2
- data/data/stylesheets/components/term.css +0 -1
- data/data/themes/bipm.yaml +60 -0
- data/data/themes/cc.yaml +43 -0
- data/data/themes/icc.yaml +39 -0
- data/data/themes/iec.yaml +44 -0
- data/data/themes/ieee.yaml +43 -0
- data/data/themes/ietf.yaml +45 -0
- data/data/themes/iho.yaml +46 -0
- data/data/themes/iso.yaml +40 -0
- data/data/themes/itu.yaml +45 -0
- data/data/themes/ogc.yaml +51 -0
- data/data/themes/oiml.yaml +56 -0
- data/data/themes/pdfa.yaml +44 -0
- data/data/themes/ribose.yaml +43 -0
- data/exe/metanorma-document +11 -0
- data/frontend/e2e/sample-html.test.ts +256 -0
- data/frontend/index.html +12 -0
- data/frontend/package-lock.json +4725 -0
- data/frontend/package.json +32 -0
- data/frontend/postcss.config.js +6 -0
- data/frontend/src/App.vue +79 -0
- data/frontend/src/app.ts +21 -0
- data/frontend/src/components/AppSidebar.vue +77 -0
- data/frontend/src/components/DocumentReader.vue +180 -0
- data/frontend/src/components/MirrorRenderer.vue +23 -0
- data/frontend/src/components/ReadingProgressBar.vue +29 -0
- data/frontend/src/components/TextRenderer.vue +131 -0
- data/frontend/src/components/TocItem.vue +57 -0
- data/frontend/src/components/TopBar.vue +49 -0
- data/frontend/src/components/__tests__/MirrorRenderer.test.ts +178 -0
- data/frontend/src/components/blocks/AdmonitionBlock.vue +74 -0
- data/frontend/src/components/blocks/ClauseBlock.vue +53 -0
- data/frontend/src/components/blocks/ExampleBlock.vue +21 -0
- data/frontend/src/components/blocks/FallbackBlock.vue +18 -0
- data/frontend/src/components/blocks/FigureBlock.vue +26 -0
- data/frontend/src/components/blocks/FootnotesBlock.vue +25 -0
- data/frontend/src/components/blocks/ListBlocks.vue +62 -0
- data/frontend/src/components/blocks/NoteBlock.vue +21 -0
- data/frontend/src/components/blocks/ParagraphBlock.vue +25 -0
- data/frontend/src/components/blocks/QuoteBlock.vue +25 -0
- data/frontend/src/components/blocks/ReviewBlock.vue +39 -0
- data/frontend/src/components/blocks/SourcecodeBlock.vue +52 -0
- data/frontend/src/components/blocks/TableBlock.vue +48 -0
- data/frontend/src/components/blocks/index.ts +36 -0
- data/frontend/src/stores/__tests__/documentStore.fixture.test.ts +272 -0
- data/frontend/src/stores/__tests__/documentStore.test.ts +143 -0
- data/frontend/src/stores/__tests__/ebookStore.test.ts +145 -0
- data/frontend/src/stores/__tests__/uiStore.test.ts +42 -0
- data/frontend/src/stores/documentStore.ts +153 -0
- data/frontend/src/stores/ebookStore.ts +179 -0
- data/frontend/src/stores/uiStore.ts +32 -0
- data/frontend/src/styles.css +156 -0
- data/frontend/src/types/__tests__/rendering-contract.test.ts +172 -0
- data/frontend/src/types/rendering-contract.ts +209 -0
- data/frontend/src/utils/__tests__/typeMetadata.test.ts +102 -0
- data/frontend/src/utils/typeMetadata.ts +121 -0
- data/frontend/tailwind.config.js +18 -0
- data/frontend/test/fixtures/iso-document.json +271 -0
- data/frontend/tmp/debug_e2e.cjs +46 -0
- data/frontend/tsconfig.json +25 -0
- data/frontend/tsconfig.node.json +11 -0
- data/frontend/vite.config.ts +37 -0
- data/frontend/vitest.e2e.config.ts +9 -0
- data/lib/metanorma/bipm_document/metadata/bipm_bibliographic_item.rb +0 -14
- data/lib/metanorma/bipm_document/metadata/depiction_element.rb +18 -0
- data/lib/metanorma/bipm_document/metadata.rb +1 -1
- data/lib/metanorma/document/cli.rb +116 -0
- data/lib/metanorma/document/components/ancillary_blocks/callout_annotation.rb +27 -0
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +0 -65
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb +18 -0
- data/lib/metanorma/document/components/ancillary_blocks.rb +4 -0
- data/lib/metanorma/document/components/bib_data/bib_data.rb +7 -0
- data/lib/metanorma/document/components/blocks/classification_value.rb +21 -0
- data/lib/metanorma/document/components/blocks/permission_model.rb +28 -0
- data/lib/metanorma/document/components/blocks/recommendation_model.rb +28 -0
- data/lib/metanorma/document/components/blocks/requirement_base.rb +30 -0
- data/lib/metanorma/document/components/blocks/requirement_classification.rb +20 -0
- data/lib/metanorma/document/components/blocks/requirement_description.rb +43 -0
- data/lib/metanorma/document/components/blocks/requirement_inherit.rb +24 -0
- data/lib/metanorma/document/components/blocks/requirement_model.rb +0 -131
- data/lib/metanorma/document/components/blocks.rb +8 -7
- data/lib/metanorma/document/components/id_elements/image.rb +2 -0
- data/lib/metanorma/document/components/inline/asciimath_element.rb +2 -0
- data/lib/metanorma/document/components/inline/attribution_element.rb +2 -0
- data/lib/metanorma/document/components/inline/bcp14_element.rb +2 -0
- data/lib/metanorma/document/components/inline/biblio_tag_element.rb +2 -0
- data/lib/metanorma/document/components/inline/br_element.rb +2 -0
- data/lib/metanorma/document/components/inline/comma_element.rb +2 -0
- data/lib/metanorma/document/components/inline/concept_element.rb +2 -0
- data/lib/metanorma/document/components/inline/display_text_element.rb +2 -0
- data/lib/metanorma/document/components/inline/em_raw_element.rb +2 -0
- data/lib/metanorma/document/components/inline/enum_comma_element.rb +2 -0
- data/lib/metanorma/document/components/inline/eref_element.rb +2 -0
- data/lib/metanorma/document/components/inline/fmt_admitted_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_annotation_body_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_annotation_end_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_annotation_start_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_concept_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_definition_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_fn_body_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_fn_label_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_footnote_container_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_identifier_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_name_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_preferred_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_sourcecode_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_stem_element.rb +10 -0
- data/lib/metanorma/document/components/inline/fmt_termsource_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_title_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_xref_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fmt_xref_label_element.rb +4 -0
- data/lib/metanorma/document/components/inline/fn_element.rb +2 -0
- data/lib/metanorma/document/components/inline/link_element.rb +2 -0
- data/lib/metanorma/document/components/inline/localized_string_element.rb +2 -0
- data/lib/metanorma/document/components/inline/localized_strings_element.rb +2 -0
- data/lib/metanorma/document/components/inline/location_element.rb +24 -0
- data/lib/metanorma/document/components/inline/math_element.rb +2 -0
- data/lib/metanorma/document/components/inline/name_with_id_element.rb +4 -0
- data/lib/metanorma/document/components/inline/rendered_display.rb +23 -0
- data/lib/metanorma/document/components/inline/rendered_math_element.rb +21 -0
- data/lib/metanorma/document/components/inline/semantic_content.rb +51 -0
- data/lib/metanorma/document/components/inline/semantic_math_element.rb +20 -0
- data/lib/metanorma/document/components/inline/semx_child_element.rb +2 -0
- data/lib/metanorma/document/components/inline/semx_element.rb +13 -1
- data/lib/metanorma/document/components/inline/small_cap_element.rb +2 -0
- data/lib/metanorma/document/components/inline/span_element.rb +10 -15
- data/lib/metanorma/document/components/inline/stem_inline_element.rb +7 -1
- data/lib/metanorma/document/components/inline/strong_raw_element.rb +2 -0
- data/lib/metanorma/document/components/inline/sub_element.rb +2 -0
- data/lib/metanorma/document/components/inline/sup_element.rb +2 -0
- data/lib/metanorma/document/components/inline/tab_element.rb +2 -0
- data/lib/metanorma/document/components/inline/title_with_annotation_element.rb +4 -0
- data/lib/metanorma/document/components/inline/tt_element.rb +2 -0
- data/lib/metanorma/document/components/inline/variant_title_element.rb +2 -0
- data/lib/metanorma/document/components/inline/vocabulary.rb +184 -0
- data/lib/metanorma/document/components/inline/xref_element.rb +10 -0
- data/lib/metanorma/document/components/inline.rb +12 -0
- data/lib/metanorma/document/components/multi_paragraph/quote_author_element.rb +20 -0
- data/lib/metanorma/document/components/multi_paragraph/quote_block.rb +0 -29
- data/lib/metanorma/document/components/multi_paragraph.rb +2 -0
- data/lib/metanorma/document/components/reference_elements/source_element.rb +0 -31
- data/lib/metanorma/document/components/reference_elements/source_modification.rb +21 -0
- data/lib/metanorma/document/components/reference_elements/source_origin.rb +28 -0
- data/lib/metanorma/document/components/reference_elements.rb +2 -2
- data/lib/metanorma/document/components/tables/col_element.rb +18 -0
- data/lib/metanorma/document/components/tables/col_group_element.rb +18 -0
- data/lib/metanorma/document/components/tables/table_block.rb +0 -22
- data/lib/metanorma/document/components/tables/table_body_section.rb +16 -0
- data/lib/metanorma/document/components/tables/table_foot_section.rb +16 -0
- data/lib/metanorma/document/components/tables/table_head_section.rb +16 -0
- data/lib/metanorma/document/components/tables/table_section.rb +0 -25
- data/lib/metanorma/document/components/tables.rb +5 -3
- data/lib/metanorma/document/relaton/address.rb +0 -27
- data/lib/metanorma/document/relaton/bib_item_locality.rb +3 -12
- data/lib/metanorma/document/relaton/copyright_association.rb +0 -10
- data/lib/metanorma/document/relaton/copyright_owner.rb +16 -0
- data/lib/metanorma/document/relaton/edition.rb +4 -7
- data/lib/metanorma/document/relaton/formatted_address.rb +29 -0
- data/lib/metanorma/document/relaton/logo_element.rb +18 -0
- data/lib/metanorma/document/relaton/organization.rb +0 -14
- data/lib/metanorma/document/relaton/phone.rb +3 -9
- data/lib/metanorma/document/relaton/place_type.rb +0 -13
- data/lib/metanorma/document/relaton/price_type.rb +3 -9
- data/lib/metanorma/document/relaton/region_element.rb +18 -0
- data/lib/metanorma/document/relaton.rb +6 -1
- data/lib/metanorma/document/version.rb +1 -1
- data/lib/metanorma/document.rb +2 -0
- data/lib/metanorma/html/asset_pipeline.rb +1 -0
- data/lib/metanorma/html/base_renderer.rb +261 -1008
- data/lib/metanorma/html/bipm_renderer.rb +15 -144
- data/lib/metanorma/html/cc_renderer.rb +1 -45
- data/lib/metanorma/html/component/base.rb +2 -7
- data/lib/metanorma/html/component/index_section.rb +41 -43
- data/lib/metanorma/html/drops/admonition_drop.rb +1 -4
- data/lib/metanorma/html/drops/biblio_entry_drop.rb +50 -0
- data/lib/metanorma/html/drops/block_element_drop.rb +7 -2
- data/lib/metanorma/html/drops/example_drop.rb +1 -4
- data/lib/metanorma/html/drops/figure_drop.rb +31 -22
- data/lib/metanorma/html/drops/footnote_drop.rb +1 -1
- data/lib/metanorma/html/drops/formula_drop.rb +45 -16
- data/lib/metanorma/html/drops/note_drop.rb +9 -7
- data/lib/metanorma/html/drops/sourcecode_drop.rb +12 -5
- data/lib/metanorma/html/drops.rb +2 -0
- data/lib/metanorma/html/generator.rb +2 -2
- data/lib/metanorma/html/icc_renderer.rb +0 -39
- data/lib/metanorma/html/iec_renderer.rb +1 -44
- data/lib/metanorma/html/ieee_renderer.rb +1 -45
- data/lib/metanorma/html/ietf_renderer.rb +1 -48
- data/lib/metanorma/html/iho_renderer.rb +1 -46
- data/lib/metanorma/html/iso_renderer.rb +290 -343
- data/lib/metanorma/html/itu_renderer.rb +1 -45
- data/lib/metanorma/html/ogc_renderer.rb +15 -76
- data/lib/metanorma/html/oiml_renderer.rb +18 -38
- data/lib/metanorma/html/pdfa_renderer.rb +0 -39
- data/lib/metanorma/html/renderers/block_renderer.rb +372 -0
- data/lib/metanorma/html/renderers/inline_renderer.rb +655 -0
- data/lib/metanorma/html/renderers/pubid_renderer.rb +69 -0
- data/lib/metanorma/html/renderers/section_renderer.rb +193 -0
- data/lib/metanorma/html/renderers.rb +8 -0
- data/lib/metanorma/html/ribose_renderer.rb +1 -45
- data/lib/metanorma/html/standard_renderer.rb +341 -229
- data/lib/metanorma/html/templates/_audio.html.liquid +1 -0
- data/lib/metanorma/html/templates/_biblio_entry.html.liquid +1 -0
- data/lib/metanorma/html/templates/_bipm_cover.html.liquid +27 -0
- data/lib/metanorma/html/templates/_boilerplate.html.liquid +1 -0
- data/lib/metanorma/html/templates/_bookmark.html.liquid +1 -0
- data/lib/metanorma/html/templates/_br.html.liquid +1 -0
- data/lib/metanorma/html/templates/_definition_list.html.liquid +6 -0
- data/lib/metanorma/html/templates/_element.html.liquid +1 -0
- data/lib/metanorma/html/templates/_fn_marker.html.liquid +1 -0
- data/lib/metanorma/html/templates/_footnotes.html.liquid +6 -6
- data/lib/metanorma/html/templates/_formula.html.liquid +1 -1
- data/lib/metanorma/html/templates/_header.html.liquid +1 -1
- data/lib/metanorma/html/templates/_heading.html.liquid +1 -0
- data/lib/metanorma/html/templates/_image.html.liquid +1 -0
- data/lib/metanorma/html/templates/_inline_span.html.liquid +1 -0
- data/lib/metanorma/html/templates/_iso_cover.html.liquid +1 -1
- data/lib/metanorma/html/templates/_link.html.liquid +1 -0
- data/lib/metanorma/html/templates/_list.html.liquid +3 -0
- data/lib/metanorma/html/templates/_list_item.html.liquid +1 -0
- data/lib/metanorma/html/templates/_main_content.html.liquid +1 -0
- data/lib/metanorma/html/templates/_math_container.html.liquid +1 -0
- data/lib/metanorma/html/templates/_paragraph.html.liquid +1 -0
- data/lib/metanorma/html/templates/_prefatory_section.html.liquid +1 -0
- data/lib/metanorma/html/templates/_pubid_identifier.html.liquid +1 -0
- data/lib/metanorma/html/templates/_quote.html.liquid +4 -0
- data/lib/metanorma/html/templates/_ref_date.html.liquid +1 -0
- data/lib/metanorma/html/templates/_ref_title.html.liquid +1 -0
- data/lib/metanorma/html/templates/_section.html.liquid +5 -0
- data/lib/metanorma/html/templates/_standard_cover.html.liquid +31 -0
- data/lib/metanorma/html/templates/_standard_doc_title.html.liquid +3 -0
- data/lib/metanorma/html/templates/_stem_span.html.liquid +1 -0
- data/lib/metanorma/html/templates/_table.html.liquid +9 -0
- data/lib/metanorma/html/templates/_term_domain.html.liquid +1 -0
- data/lib/metanorma/html/templates/_term_example.html.liquid +1 -0
- data/lib/metanorma/html/templates/_term_note.html.liquid +1 -0
- data/lib/metanorma/html/templates/_term_number.html.liquid +1 -0
- data/lib/metanorma/html/templates/_term_source.html.liquid +1 -0
- data/lib/metanorma/html/templates/_term_text_note.html.liquid +1 -0
- data/lib/metanorma/html/templates/_video.html.liquid +1 -0
- data/lib/metanorma/html/templates/_wrapped_preface.html.liquid +1 -0
- data/lib/metanorma/html/templates/document.html.liquid +4 -0
- data/lib/metanorma/html/theme.rb +180 -107
- data/lib/metanorma/html.rb +13 -0
- data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +0 -25
- data/lib/metanorma/ietf_document/metadata/pi_settings.rb +32 -0
- data/lib/metanorma/ietf_document/metadata.rb +2 -0
- data/lib/metanorma/iso_document/metadata/doctype_element.rb +20 -0
- data/lib/metanorma/iso_document/metadata/iso_bib_data_extension_type.rb +0 -48
- data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +0 -72
- data/lib/metanorma/iso_document/metadata/iso_document_status.rb +0 -30
- data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +4 -1
- data/lib/metanorma/iso_document/metadata/language_element.rb +18 -0
- data/lib/metanorma/iso_document/metadata/project_number.rb +22 -0
- data/lib/metanorma/iso_document/metadata/script_element.rb +18 -0
- data/lib/metanorma/iso_document/metadata/stage_element.rb +26 -0
- data/lib/metanorma/iso_document/metadata/stagename_element.rb +18 -0
- data/lib/metanorma/iso_document/metadata/structured_identifier.rb +0 -17
- data/lib/metanorma/iso_document/metadata/title_collection.rb +1 -0
- data/lib/metanorma/iso_document/metadata.rb +9 -4
- data/lib/metanorma/iso_document/terms/iso_term.rb +0 -13
- data/lib/metanorma/iso_document/terms/term_domain_element.rb +18 -0
- data/lib/metanorma/iso_document/terms.rb +1 -0
- data/lib/metanorma/itu_document/metadata/itu_bib_data_extension_type.rb +0 -37
- data/lib/metanorma/itu_document/metadata/meeting_date.rb +18 -0
- data/lib/metanorma/itu_document/metadata/meeting_element.rb +18 -0
- data/lib/metanorma/itu_document/metadata/study_period.rb +18 -0
- data/lib/metanorma/itu_document/metadata.rb +3 -4
- data/lib/metanorma/mirror/default_registry.rb +170 -0
- data/lib/metanorma/mirror/handler_registry.rb +60 -0
- data/lib/metanorma/mirror/handler_result.rb +37 -0
- data/lib/metanorma/mirror/handlers/admonition.rb +18 -0
- data/lib/metanorma/mirror/handlers/example.rb +21 -0
- data/lib/metanorma/mirror/handlers/figure.rb +53 -0
- data/lib/metanorma/mirror/handlers/formula.rb +35 -0
- data/lib/metanorma/mirror/handlers/inline/rich_html_renderer.rb +159 -0
- data/lib/metanorma/mirror/handlers/inline/text_extractor.rb +116 -0
- data/lib/metanorma/mirror/handlers/inline.rb +225 -0
- data/lib/metanorma/mirror/handlers/list.rb +110 -0
- data/lib/metanorma/mirror/handlers/note.rb +26 -0
- data/lib/metanorma/mirror/handlers/paragraph.rb +19 -0
- data/lib/metanorma/mirror/handlers/quote.rb +16 -0
- data/lib/metanorma/mirror/handlers/review.rb +19 -0
- data/lib/metanorma/mirror/handlers/section.rb +149 -0
- data/lib/metanorma/mirror/handlers/sourcecode.rb +27 -0
- data/lib/metanorma/mirror/handlers/structural.rb +68 -0
- data/lib/metanorma/mirror/handlers/table.rb +81 -0
- data/lib/metanorma/mirror/handlers/term.rb +100 -0
- data/lib/metanorma/mirror/handlers.rb +60 -0
- data/lib/metanorma/mirror/id_strategy/positional.rb +166 -0
- data/lib/metanorma/mirror/id_strategy/preserve.rb +12 -0
- data/lib/metanorma/mirror/id_strategy.rb +34 -0
- data/lib/metanorma/mirror/math_util.rb +53 -0
- data/lib/metanorma/mirror/metadata.rb +37 -0
- data/lib/metanorma/mirror/metanorma_to_mirror.rb +101 -0
- data/lib/metanorma/mirror/model/container.rb +47 -0
- data/lib/metanorma/mirror/model/factory.rb +52 -0
- data/lib/metanorma/mirror/model/guide.rb +25 -0
- data/lib/metanorma/mirror/model/leaf.rb +17 -0
- data/lib/metanorma/mirror/model/mark.rb +53 -0
- data/lib/metanorma/mirror/model/node.rb +47 -0
- data/lib/metanorma/mirror/model/soft_break.rb +33 -0
- data/lib/metanorma/mirror/model/text.rb +34 -0
- data/lib/metanorma/mirror/model.rb +16 -0
- data/lib/metanorma/mirror/output/builder.rb +39 -0
- data/lib/metanorma/mirror/output/formats/base_format.rb +90 -0
- data/lib/metanorma/mirror/output/formats/inline_format.rb +81 -0
- data/lib/metanorma/mirror/output/formats.rb +53 -0
- data/lib/metanorma/mirror/output/html_renderer.rb +95 -0
- data/lib/metanorma/mirror/output/html_renderers/block_renderers.rb +178 -0
- data/lib/metanorma/mirror/output/html_renderers/inline_renderer.rb +61 -0
- data/lib/metanorma/mirror/output/html_renderers/list_renderers.rb +96 -0
- data/lib/metanorma/mirror/output/html_renderers/mark_renderers.rb +64 -0
- data/lib/metanorma/mirror/output/html_renderers/section_renderers.rb +129 -0
- data/lib/metanorma/mirror/output/html_renderers/structural_renderers.rb +80 -0
- data/lib/metanorma/mirror/output/html_renderers/table_renderers.rb +87 -0
- data/lib/metanorma/mirror/output/html_renderers.rb +76 -0
- data/lib/metanorma/mirror/output/pipeline.rb +92 -0
- data/lib/metanorma/mirror/output/pipeline_context.rb +22 -0
- data/lib/metanorma/mirror/output.rb +14 -0
- data/lib/metanorma/mirror/rewriter.rb +121 -0
- data/lib/metanorma/mirror/safe_attr.rb +16 -0
- data/lib/metanorma/mirror/serialization/json_serializer.rb +25 -0
- data/lib/metanorma/mirror/serialization/yaml_serializer.rb +20 -0
- data/lib/metanorma/mirror/serialization.rb +10 -0
- data/lib/metanorma/mirror/transformer.rb +22 -0
- data/lib/metanorma/mirror.rb +32 -0
- data/lib/metanorma/standard_document/annotation.rb +37 -0
- data/lib/metanorma/standard_document/block_attributes.rb +15 -2
- data/lib/metanorma/standard_document/blocks/block_source.rb +0 -23
- data/lib/metanorma/standard_document/blocks/source_origin_element.rb +23 -0
- data/lib/metanorma/standard_document/blocks.rb +1 -1
- data/lib/metanorma/standard_document/terms/term_expression.rb +0 -31
- data/lib/metanorma/standard_document/terms/term_name_element.rb +29 -0
- data/lib/metanorma/standard_document/terms.rb +1 -0
- data/script/render_both.rb +18 -0
- metadata +262 -13
- data/.github/workflows/rake.yml +0 -21
- data/.github/workflows/release.yml +0 -25
- data/.github/workflows/roundtrip-samples.yml +0 -132
- data/.gitignore +0 -19
- data/.rspec +0 -3
- data/.rubocop.yml +0 -22
- data/Gemfile +0 -28
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/metanorma-document.gemspec +0 -35
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtConceptElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :text, :string, collection: true
|
|
7
11
|
attribute :semx, SemxElement, collection: true
|
|
8
12
|
attribute :eref, ErefElement, collection: true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtDefinitionElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :id, :string
|
|
7
11
|
attribute :semx, SemxElement, collection: true
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtFnBodyElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :id, :string
|
|
7
11
|
attribute :target, :string
|
|
8
12
|
attribute :reference, :string
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtFnLabelElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :text, :string, collection: true
|
|
7
11
|
attribute :span, SpanElement, collection: true
|
|
8
12
|
attribute :semx, SemxElement, collection: true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtFootnoteContainerElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :fmt_fn_body, FmtFnBodyElement, collection: true
|
|
7
11
|
|
|
8
12
|
xml do
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtNameElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :id, :string
|
|
7
11
|
attribute :text, :string, collection: true
|
|
8
12
|
attribute :span, SpanElement, collection: true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtPreferredElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :p, "Metanorma::Document::Components::Paragraphs::ParagraphBlock",
|
|
7
11
|
collection: true
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtSourcecodeElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :lang, :string
|
|
7
11
|
attribute :id, :string
|
|
8
12
|
attribute :semx_id, :string
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
7
|
+
# Rendered counterpart of `<stem>`. Produced by presentation XML
|
|
8
|
+
# transformation. Wraps a `<semx>` carrying the locale-rendered
|
|
9
|
+
# form of the math (e.g. decimal commas, thousands separators).
|
|
5
10
|
class FmtStemElement < Lutaml::Model::Serializable
|
|
11
|
+
include RenderedDisplay
|
|
12
|
+
|
|
6
13
|
attribute :stem_type, :string
|
|
14
|
+
attribute :text, :string, collection: true
|
|
7
15
|
attribute :semx, SemxElement, collection: true
|
|
8
16
|
|
|
9
17
|
xml do
|
|
10
18
|
element "fmt-stem"
|
|
19
|
+
mixed_content
|
|
11
20
|
map_attribute "type", to: :stem_type
|
|
21
|
+
map_content to: :text
|
|
12
22
|
map_element "semx", to: :semx
|
|
13
23
|
end
|
|
14
24
|
end
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtTermsourceElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :status, :string
|
|
7
11
|
attribute :type, :string
|
|
8
12
|
attribute :semx, SemxElement
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtTitleElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :depth, :string
|
|
7
11
|
attribute :id, :string
|
|
8
12
|
attribute :text, :string, collection: true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtXrefElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :target, :string
|
|
7
11
|
attribute :type, :string
|
|
8
12
|
attribute :text, :string, collection: true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
5
7
|
class FmtXrefLabelElement < Lutaml::Model::Serializable
|
|
8
|
+
include RenderedDisplay
|
|
9
|
+
|
|
6
10
|
attribute :container, :string
|
|
7
11
|
attribute :text, :string, collection: true
|
|
8
12
|
attribute :semx, SemxElement, collection: true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Inline
|
|
7
|
+
# A secondary target inside an `<xref>` for multi-target cross
|
|
8
|
+
# references (e.g. "see Figure 4, 5.1.6 and 5.1.7"). Carries the
|
|
9
|
+
# target id and the connective used to join it to the previous
|
|
10
|
+
# target.
|
|
11
|
+
class LocationElement < Lutaml::Model::Serializable
|
|
12
|
+
attribute :target, :string
|
|
13
|
+
attribute :connective, :string
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
element "location"
|
|
17
|
+
map_attribute "target", to: :target
|
|
18
|
+
map_attribute "connective", to: :connective
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
@@ -6,12 +8,14 @@ module Metanorma
|
|
|
6
8
|
attribute :id, :string
|
|
7
9
|
attribute :semx_id, :string
|
|
8
10
|
attribute :text, :string
|
|
11
|
+
attribute :stem, TextElements::StemElement, collection: true
|
|
9
12
|
|
|
10
13
|
xml do
|
|
11
14
|
element "name"
|
|
12
15
|
map_attribute "id", to: :id
|
|
13
16
|
map_attribute "semx-id", to: :semx_id
|
|
14
17
|
map_content to: :text
|
|
18
|
+
map_element "stem", to: :stem
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Inline
|
|
7
|
+
# Marker module for `fmt-*` element classes — the rendered
|
|
8
|
+
# counterparts of semantic elements. Including this module marks
|
|
9
|
+
# a class as a presentation-layer sibling (e.g. `FmtStemElement`
|
|
10
|
+
# is the rendered counterpart of `StemInlineElement`).
|
|
11
|
+
#
|
|
12
|
+
# Used by `SemanticContent#each_semantic_content` to filter out
|
|
13
|
+
# rendered siblings so consumers iterating semantic content don't
|
|
14
|
+
# see both forms of the same logical content.
|
|
15
|
+
#
|
|
16
|
+
# Adding a new `fmt-*` class means one `include RenderedDisplay`
|
|
17
|
+
# line — no edits to the filtering logic.
|
|
18
|
+
module RenderedDisplay
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Inline
|
|
7
|
+
# Math content inside an `<fmt-stem><semx>` rendered-display
|
|
8
|
+
# element. Represents the locale-rendered form of the math —
|
|
9
|
+
# decimal commas, thousands separators, locale-specific
|
|
10
|
+
# digit grouping.
|
|
11
|
+
#
|
|
12
|
+
# Subclass of `MathElement` so consumers that don't care about the
|
|
13
|
+
# distinction continue to work via the base class. Consumers that
|
|
14
|
+
# need to distinguish semantic from rendered forms use
|
|
15
|
+
# `math.is_a?(RenderedMathElement)` vs `math.is_a?(SemanticMathElement)`.
|
|
16
|
+
class RenderedMathElement < MathElement
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Inline
|
|
7
|
+
# Iterator that yields only the semantic (canonical) children of a
|
|
8
|
+
# mixed-content element, skipping any rendered-display (`fmt-*`)
|
|
9
|
+
# siblings.
|
|
10
|
+
#
|
|
11
|
+
# Background: in Metanorma presentation XML, every semantic
|
|
12
|
+
# element with locale-sensitive rendering has a `fmt-*` sibling
|
|
13
|
+
# (e.g. `<stem>` + `<fmt-stem>`). When both are present in the
|
|
14
|
+
# same parent, `each_mixed_content` yields both — duplicating
|
|
15
|
+
# the logical content.
|
|
16
|
+
#
|
|
17
|
+
# Usage:
|
|
18
|
+
#
|
|
19
|
+
# SemanticContent.each(paragraph) do |node|
|
|
20
|
+
# # yields semantic children only; fmt_* skipped
|
|
21
|
+
# end
|
|
22
|
+
#
|
|
23
|
+
# SemanticContent.each(paragraph).to_a # => Enumerator
|
|
24
|
+
#
|
|
25
|
+
# Consumers that want the rendered form access it directly via
|
|
26
|
+
# `node.fmt_*` attributes — no iterator needed.
|
|
27
|
+
module SemanticContent
|
|
28
|
+
class << self
|
|
29
|
+
def each(element, &block)
|
|
30
|
+
return enum_for(:each, element) unless block
|
|
31
|
+
|
|
32
|
+
element.each_mixed_content do |node|
|
|
33
|
+
next if rendered_display?(node)
|
|
34
|
+
|
|
35
|
+
yield node
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def rendered_display?(node)
|
|
42
|
+
return false unless node.is_a?(Lutaml::Model::Serializable)
|
|
43
|
+
|
|
44
|
+
node.is_a?(RenderedDisplay)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Inline
|
|
7
|
+
# Math content inside a semantic `<stem>` element. Represents the
|
|
8
|
+
# canonical form of the math — decimal periods, no locale-specific
|
|
9
|
+
# thousands separators.
|
|
10
|
+
#
|
|
11
|
+
# Subclass of `MathElement` so consumers that don't care about the
|
|
12
|
+
# distinction continue to work via the base class. Consumers that
|
|
13
|
+
# need to distinguish semantic from rendered forms use
|
|
14
|
+
# `math.is_a?(SemanticMathElement)` vs `math.is_a?(RenderedMathElement)`.
|
|
15
|
+
class SemanticMathElement < MathElement
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
7
|
+
# <semx> wraps a rendered-display slice of an inline element.
|
|
8
|
+
#
|
|
9
|
+
# Known limitation (BUGS.sts 06, filed upstream against
|
|
10
|
+
# lutaml-model): when this element is parsed nested inside
|
|
11
|
+
# another mixed_content parent, the direct text content of
|
|
12
|
+
# <semx> may be captured by the parent's text attribute rather
|
|
13
|
+
# than by SemxElement#text. Standalone parsing works correctly.
|
|
14
|
+
# See TODO.bugs/06-nested-mixed-content-text-ownership.md and
|
|
15
|
+
# https://github.com/lutaml/lutaml-model bug
|
|
16
|
+
# "nested-mixed-content-text-ownership".
|
|
5
17
|
class SemxElement < Lutaml::Model::Serializable
|
|
6
18
|
attribute :element_attr, :string
|
|
7
19
|
attribute :source, :string
|
|
@@ -11,7 +23,7 @@ module Metanorma
|
|
|
11
23
|
attribute :fmt_concept, "Metanorma::Document::Components::Inline::FmtConceptElement",
|
|
12
24
|
collection: true
|
|
13
25
|
attribute :asciimath, AsciimathElement, collection: true
|
|
14
|
-
attribute :math,
|
|
26
|
+
attribute :math, RenderedMathElement, collection: true
|
|
15
27
|
attribute :p, "Metanorma::Document::Components::Paragraphs::ParagraphBlock",
|
|
16
28
|
collection: true
|
|
17
29
|
attribute :semx, "Metanorma::Document::Components::Inline::SemxElement",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
7
|
+
# A `<span>` wraps arbitrary inline content for styling or
|
|
8
|
+
# classification. It accepts the full inline vocabulary — see
|
|
9
|
+
# `Inline::Vocabulary` for the rationale.
|
|
5
10
|
class SpanElement < Lutaml::Model::Serializable
|
|
11
|
+
include Inline::Vocabulary
|
|
12
|
+
|
|
6
13
|
attribute :class_attr, :string
|
|
7
14
|
attribute :style, :string
|
|
8
|
-
attribute :
|
|
9
|
-
|
|
10
|
-
attribute :span, SpanElement, collection: true
|
|
11
|
-
attribute :strong, "Metanorma::Document::Components::Inline::StrongRawElement",
|
|
12
|
-
collection: true
|
|
13
|
-
attribute :tab, TabElement, collection: true
|
|
14
|
-
attribute :sup, SupElement, collection: true
|
|
15
|
-
attribute :br, BrElement, collection: true
|
|
16
|
-
attribute :callout, "Metanorma::Document::Components::ReferenceElements::Callout",
|
|
15
|
+
attribute :callout,
|
|
16
|
+
Metanorma::Document::Components::ReferenceElements::Callout,
|
|
17
17
|
collection: true
|
|
18
18
|
|
|
19
19
|
xml do
|
|
@@ -22,13 +22,8 @@ module Metanorma
|
|
|
22
22
|
map_attribute "class", to: :class_attr
|
|
23
23
|
map_attribute "style", to: :style
|
|
24
24
|
map_content to: :text
|
|
25
|
-
map_element "semx", to: :semx
|
|
26
|
-
map_element "span", to: :span
|
|
27
|
-
map_element "strong", to: :strong
|
|
28
|
-
map_element "tab", to: :tab
|
|
29
|
-
map_element "sup", to: :sup
|
|
30
|
-
map_element "br", to: :br
|
|
31
25
|
map_element "callout", to: :callout
|
|
26
|
+
Vocabulary::VocabularyXmlMapping.apply_inline_mappings(self)
|
|
32
27
|
end
|
|
33
28
|
end
|
|
34
29
|
end
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
4
6
|
module Inline
|
|
7
|
+
# Semantic `<stem>` element carrying canonical math content.
|
|
8
|
+
# The `math` attribute contains `SemanticMathElement` instances
|
|
9
|
+
# — the canonical form (decimal periods, no locale separators).
|
|
10
|
+
# For the rendered form, see `FmtStemElement`.
|
|
5
11
|
class StemInlineElement < Lutaml::Model::Serializable
|
|
6
12
|
attribute :id, :string
|
|
7
13
|
attribute :block, :string
|
|
8
14
|
attribute :stem_type, :string
|
|
9
15
|
attribute :asciimath, AsciimathElement, collection: true
|
|
10
|
-
attribute :math,
|
|
16
|
+
attribute :math, SemanticMathElement, collection: true
|
|
11
17
|
|
|
12
18
|
xml do
|
|
13
19
|
element "stem"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Metanorma
|
|
2
4
|
module Document
|
|
3
5
|
module Components
|
|
@@ -20,6 +22,7 @@ module Metanorma
|
|
|
20
22
|
collection: true
|
|
21
23
|
attribute :smallcap, SmallCapElement, collection: true
|
|
22
24
|
attribute :br, BrElement, collection: true
|
|
25
|
+
attribute :stem, TextElements::StemElement, collection: true
|
|
23
26
|
attribute :xref, XrefElement, collection: true
|
|
24
27
|
attribute :eref, ErefElement, collection: true
|
|
25
28
|
attribute :link, LinkElement, collection: true
|
|
@@ -39,6 +42,7 @@ module Metanorma
|
|
|
39
42
|
map_element "strike", to: :strike
|
|
40
43
|
map_element "smallcap", to: :smallcap
|
|
41
44
|
map_element "br", to: :br
|
|
45
|
+
map_element "stem", to: :stem
|
|
42
46
|
map_element "xref", to: :xref
|
|
43
47
|
map_element "eref", to: :eref
|
|
44
48
|
map_element "link", to: :link
|