metanorma-document 0.2.12 → 0.2.13
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/.github/workflows/rake.yml +21 -0
- data/.github/workflows/release.yml +25 -0
- data/.github/workflows/roundtrip-samples.yml +132 -0
- data/.gitignore +19 -0
- data/.rspec +3 -0
- data/.rubocop.yml +22 -0
- data/.rubocop_todo.yml +66 -164
- data/CHANGELOG.md +1 -0
- data/Gemfile +32 -0
- data/README.adoc +0 -144
- data/Rakefile +2 -14
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/data/javascripts/components/mn-lightbox.js +2 -18
- data/data/javascripts/components/mn-shortcuts.js +0 -2
- data/data/javascripts/core/mn-navigation.js +0 -8
- data/data/javascripts/core/mn-theme.js +9 -9
- data/data/logos/pdfa-logo.svg +94 -31
- data/data/stylesheets/base/_layout.css +0 -3
- data/data/stylesheets/base/_reset.css +3 -3
- data/data/stylesheets/base/_typography.css +5 -0
- data/data/stylesheets/components/bibliography.css +3 -3
- data/data/stylesheets/components/cover.css +1 -3
- data/data/stylesheets/components/figure.css +1 -13
- data/data/stylesheets/components/footnote.css +5 -65
- data/data/stylesheets/components/formula.css +0 -44
- data/data/stylesheets/components/header.css +2 -17
- data/data/stylesheets/components/inline.css +1 -1
- data/data/stylesheets/components/table.css +2 -15
- data/data/stylesheets/components/term.css +1 -0
- data/lib/metanorma/bipm_document/metadata/bipm_bibliographic_item.rb +14 -0
- data/lib/metanorma/bipm_document/metadata.rb +1 -1
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +65 -0
- data/lib/metanorma/document/components/ancillary_blocks.rb +0 -4
- data/lib/metanorma/document/components/bib_data/bib_data.rb +0 -7
- data/lib/metanorma/document/components/blocks/requirement_model.rb +131 -0
- data/lib/metanorma/document/components/blocks.rb +7 -8
- data/lib/metanorma/document/components/id_elements/image.rb +0 -2
- data/lib/metanorma/document/components/inline/asciimath_element.rb +0 -2
- data/lib/metanorma/document/components/inline/attribution_element.rb +0 -2
- data/lib/metanorma/document/components/inline/bcp14_element.rb +0 -2
- data/lib/metanorma/document/components/inline/biblio_tag_element.rb +0 -2
- data/lib/metanorma/document/components/inline/br_element.rb +0 -2
- data/lib/metanorma/document/components/inline/comma_element.rb +0 -2
- data/lib/metanorma/document/components/inline/concept_element.rb +0 -2
- data/lib/metanorma/document/components/inline/display_text_element.rb +0 -2
- data/lib/metanorma/document/components/inline/em_raw_element.rb +0 -2
- data/lib/metanorma/document/components/inline/enum_comma_element.rb +0 -2
- data/lib/metanorma/document/components/inline/eref_element.rb +0 -2
- data/lib/metanorma/document/components/inline/fmt_admitted_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_annotation_body_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_annotation_end_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_annotation_start_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_concept_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_definition_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_fn_body_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_fn_label_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_footnote_container_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_identifier_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_name_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_preferred_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_sourcecode_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_stem_element.rb +0 -10
- data/lib/metanorma/document/components/inline/fmt_termsource_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_title_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_xref_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fmt_xref_label_element.rb +0 -4
- data/lib/metanorma/document/components/inline/fn_element.rb +0 -2
- data/lib/metanorma/document/components/inline/link_element.rb +0 -2
- data/lib/metanorma/document/components/inline/localized_string_element.rb +0 -2
- data/lib/metanorma/document/components/inline/localized_strings_element.rb +0 -2
- data/lib/metanorma/document/components/inline/math_element.rb +0 -2
- data/lib/metanorma/document/components/inline/name_with_id_element.rb +0 -4
- data/lib/metanorma/document/components/inline/semx_child_element.rb +0 -2
- data/lib/metanorma/document/components/inline/semx_element.rb +1 -13
- data/lib/metanorma/document/components/inline/small_cap_element.rb +0 -2
- data/lib/metanorma/document/components/inline/span_element.rb +15 -10
- data/lib/metanorma/document/components/inline/stem_inline_element.rb +1 -7
- data/lib/metanorma/document/components/inline/strong_raw_element.rb +0 -2
- data/lib/metanorma/document/components/inline/sub_element.rb +0 -2
- data/lib/metanorma/document/components/inline/sup_element.rb +0 -2
- data/lib/metanorma/document/components/inline/tab_element.rb +0 -2
- data/lib/metanorma/document/components/inline/title_with_annotation_element.rb +0 -4
- data/lib/metanorma/document/components/inline/tt_element.rb +0 -2
- data/lib/metanorma/document/components/inline/variant_title_element.rb +0 -2
- data/lib/metanorma/document/components/inline/xref_element.rb +0 -10
- data/lib/metanorma/document/components/inline.rb +0 -12
- data/lib/metanorma/document/components/multi_paragraph/quote_block.rb +29 -0
- data/lib/metanorma/document/components/multi_paragraph.rb +0 -2
- data/lib/metanorma/document/components/reference_elements/source_element.rb +31 -0
- data/lib/metanorma/document/components/reference_elements.rb +2 -2
- data/lib/metanorma/document/components/tables/table_block.rb +22 -0
- data/lib/metanorma/document/components/tables/table_section.rb +25 -0
- data/lib/metanorma/document/components/tables.rb +3 -5
- data/lib/metanorma/document/relaton/address.rb +27 -0
- data/lib/metanorma/document/relaton/bib_item_locality.rb +12 -3
- data/lib/metanorma/document/relaton/copyright_association.rb +10 -0
- data/lib/metanorma/document/relaton/edition.rb +7 -4
- data/lib/metanorma/document/relaton/organization.rb +14 -0
- data/lib/metanorma/document/relaton/phone.rb +9 -3
- data/lib/metanorma/document/relaton/place_type.rb +13 -0
- data/lib/metanorma/document/relaton/price_type.rb +9 -3
- data/lib/metanorma/document/relaton.rb +1 -6
- data/lib/metanorma/document/version.rb +1 -1
- data/lib/metanorma/document.rb +0 -2
- data/lib/metanorma/html/asset_pipeline.rb +0 -1
- data/lib/metanorma/html/base_renderer.rb +1008 -261
- data/lib/metanorma/html/bipm_renderer.rb +144 -15
- data/lib/metanorma/html/cc_renderer.rb +45 -1
- data/lib/metanorma/html/component/base.rb +7 -2
- data/lib/metanorma/html/component/index_section.rb +43 -41
- data/lib/metanorma/html/drops/admonition_drop.rb +4 -1
- data/lib/metanorma/html/drops/block_element_drop.rb +2 -7
- data/lib/metanorma/html/drops/example_drop.rb +4 -1
- data/lib/metanorma/html/drops/figure_drop.rb +22 -31
- data/lib/metanorma/html/drops/footnote_drop.rb +1 -1
- data/lib/metanorma/html/drops/formula_drop.rb +16 -45
- data/lib/metanorma/html/drops/note_drop.rb +7 -9
- data/lib/metanorma/html/drops/sourcecode_drop.rb +5 -12
- data/lib/metanorma/html/drops.rb +0 -2
- data/lib/metanorma/html/generator.rb +2 -2
- data/lib/metanorma/html/icc_renderer.rb +39 -0
- data/lib/metanorma/html/iec_renderer.rb +44 -1
- data/lib/metanorma/html/ieee_renderer.rb +45 -1
- data/lib/metanorma/html/ietf_renderer.rb +48 -1
- data/lib/metanorma/html/iho_renderer.rb +46 -1
- data/lib/metanorma/html/iso_renderer.rb +343 -290
- data/lib/metanorma/html/itu_renderer.rb +45 -1
- data/lib/metanorma/html/ogc_renderer.rb +76 -15
- data/lib/metanorma/html/oiml_renderer.rb +38 -18
- data/lib/metanorma/html/pdfa_renderer.rb +39 -0
- data/lib/metanorma/html/ribose_renderer.rb +45 -1
- data/lib/metanorma/html/standard_renderer.rb +229 -341
- 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/_iso_cover.html.liquid +1 -1
- data/lib/metanorma/html/templates/document.html.liquid +0 -4
- data/lib/metanorma/html/theme.rb +107 -180
- data/lib/metanorma/html.rb +3 -14
- data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +25 -0
- data/lib/metanorma/ietf_document/metadata.rb +0 -2
- data/lib/metanorma/iso_document/metadata/iso_bib_data_extension_type.rb +48 -0
- data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +72 -0
- data/lib/metanorma/iso_document/metadata/iso_document_status.rb +30 -0
- data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +1 -4
- data/lib/metanorma/iso_document/metadata/structured_identifier.rb +17 -0
- data/lib/metanorma/iso_document/metadata/title_collection.rb +0 -1
- data/lib/metanorma/iso_document/metadata.rb +4 -9
- data/lib/metanorma/iso_document/terms/iso_term.rb +13 -0
- data/lib/metanorma/iso_document/terms.rb +0 -1
- data/lib/metanorma/itu_document/metadata/itu_bib_data_extension_type.rb +37 -0
- data/lib/metanorma/itu_document/metadata.rb +4 -3
- data/lib/metanorma/standard_document/block_attributes.rb +9 -5
- data/lib/metanorma/standard_document/blocks/block_source.rb +23 -0
- data/lib/metanorma/standard_document/blocks.rb +1 -1
- data/lib/metanorma/standard_document/terms/term_expression.rb +31 -0
- data/lib/metanorma/standard_document/terms.rb +0 -1
- data/metanorma-document.gemspec +35 -0
- metadata +13 -262
- data/CLAUDE.md +0 -26
- data/TODO.finalize/01-split-multi-class-files.md +0 -8
- data/TODO.finalize/02-remove-data-dist-iso-document-frontend.md +0 -6
- data/TODO.finalize/03-align-frontend-iife-and-gha-build.md +0 -11
- data/TODO.finalize/04-theme-per-flavor-config-driven.md +0 -9
- data/TODO.finalize/05-migrate-all-html-to-liquid.md +0 -16
- data/TODO.finalize/06-integrate-pubid-library.md +0 -16
- data/TODO.finalize/07-replace-relaton-models-with-relaton-bib.md +0 -39
- data/TODO.finalize/08-refactor-renderer-architecture.md +0 -25
- data/TODO.finalize/09-eliminate-code-smells.md +0 -14
- data/TODO.finalize/10-comprehensive-spec-coverage.md +0 -24
- data/TODO.finalize/11-config-driven-flavor-metadata.md +0 -20
- data/TODO.finalize/12-add-frozen-string-literal.md +0 -6
- data/TODO.finalize/13-extract-composition-from-god-class.md +0 -96
- data/TODO.finalize/14-config-driven-section-ordering.md +0 -31
- data/TODO.finalize/15-theme-directories-per-flavor.md +0 -46
- data/TODO.finalize/16-theme-lutaml-model-schema.md +0 -44
- data/data/javascripts/components/mn-footnotes.js +0 -68
- data/data/logos/oiml-logo-full-dark.svg +0 -1
- data/data/logos/oiml-logo-full-light.svg +0 -1
- data/data/logos/oiml-logo-icon-dark.svg +0 -1
- data/data/logos/oiml-logo-icon-light.svg +0 -1
- data/data/logos/oiml-logo.svg +0 -1
- data/data/themes/bipm.yaml +0 -60
- data/data/themes/cc.yaml +0 -43
- data/data/themes/icc.yaml +0 -39
- data/data/themes/iec.yaml +0 -44
- data/data/themes/ieee.yaml +0 -43
- data/data/themes/ietf.yaml +0 -45
- data/data/themes/iho.yaml +0 -46
- data/data/themes/iso.yaml +0 -40
- data/data/themes/itu.yaml +0 -45
- data/data/themes/ogc.yaml +0 -51
- data/data/themes/oiml.yaml +0 -56
- data/data/themes/pdfa.yaml +0 -44
- data/data/themes/ribose.yaml +0 -43
- data/exe/metanorma-document +0 -11
- data/frontend/e2e/sample-html.test.ts +0 -256
- data/frontend/index.html +0 -12
- data/frontend/package-lock.json +0 -4725
- data/frontend/package.json +0 -32
- data/frontend/postcss.config.js +0 -6
- data/frontend/src/App.vue +0 -79
- data/frontend/src/app.ts +0 -21
- data/frontend/src/components/AppSidebar.vue +0 -77
- data/frontend/src/components/DocumentReader.vue +0 -180
- data/frontend/src/components/MirrorRenderer.vue +0 -23
- data/frontend/src/components/ReadingProgressBar.vue +0 -29
- data/frontend/src/components/TextRenderer.vue +0 -131
- data/frontend/src/components/TocItem.vue +0 -57
- data/frontend/src/components/TopBar.vue +0 -49
- data/frontend/src/components/__tests__/MirrorRenderer.test.ts +0 -178
- data/frontend/src/components/blocks/AdmonitionBlock.vue +0 -74
- data/frontend/src/components/blocks/ClauseBlock.vue +0 -53
- data/frontend/src/components/blocks/ExampleBlock.vue +0 -21
- data/frontend/src/components/blocks/FallbackBlock.vue +0 -18
- data/frontend/src/components/blocks/FigureBlock.vue +0 -26
- data/frontend/src/components/blocks/FootnotesBlock.vue +0 -25
- data/frontend/src/components/blocks/ListBlocks.vue +0 -62
- data/frontend/src/components/blocks/NoteBlock.vue +0 -21
- data/frontend/src/components/blocks/ParagraphBlock.vue +0 -25
- data/frontend/src/components/blocks/QuoteBlock.vue +0 -25
- data/frontend/src/components/blocks/ReviewBlock.vue +0 -39
- data/frontend/src/components/blocks/SourcecodeBlock.vue +0 -52
- data/frontend/src/components/blocks/TableBlock.vue +0 -48
- data/frontend/src/components/blocks/index.ts +0 -36
- data/frontend/src/stores/__tests__/documentStore.fixture.test.ts +0 -272
- data/frontend/src/stores/__tests__/documentStore.test.ts +0 -143
- data/frontend/src/stores/__tests__/ebookStore.test.ts +0 -145
- data/frontend/src/stores/__tests__/uiStore.test.ts +0 -42
- data/frontend/src/stores/documentStore.ts +0 -153
- data/frontend/src/stores/ebookStore.ts +0 -179
- data/frontend/src/stores/uiStore.ts +0 -32
- data/frontend/src/styles.css +0 -156
- data/frontend/src/types/__tests__/rendering-contract.test.ts +0 -172
- data/frontend/src/types/rendering-contract.ts +0 -209
- data/frontend/src/utils/__tests__/typeMetadata.test.ts +0 -102
- data/frontend/src/utils/typeMetadata.ts +0 -121
- data/frontend/tailwind.config.js +0 -18
- data/frontend/test/fixtures/iso-document.json +0 -271
- data/frontend/tmp/debug_e2e.cjs +0 -46
- data/frontend/tsconfig.json +0 -25
- data/frontend/tsconfig.node.json +0 -11
- data/frontend/vite.config.ts +0 -37
- data/frontend/vitest.e2e.config.ts +0 -9
- data/lib/metanorma/bipm_document/metadata/depiction_element.rb +0 -18
- data/lib/metanorma/document/cli.rb +0 -116
- data/lib/metanorma/document/components/ancillary_blocks/callout_annotation.rb +0 -27
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb +0 -18
- data/lib/metanorma/document/components/blocks/classification_value.rb +0 -21
- data/lib/metanorma/document/components/blocks/permission_model.rb +0 -28
- data/lib/metanorma/document/components/blocks/recommendation_model.rb +0 -28
- data/lib/metanorma/document/components/blocks/requirement_base.rb +0 -30
- data/lib/metanorma/document/components/blocks/requirement_classification.rb +0 -20
- data/lib/metanorma/document/components/blocks/requirement_description.rb +0 -43
- data/lib/metanorma/document/components/blocks/requirement_inherit.rb +0 -24
- data/lib/metanorma/document/components/inline/location_element.rb +0 -24
- data/lib/metanorma/document/components/inline/rendered_display.rb +0 -23
- data/lib/metanorma/document/components/inline/rendered_math_element.rb +0 -21
- data/lib/metanorma/document/components/inline/semantic_content.rb +0 -51
- data/lib/metanorma/document/components/inline/semantic_math_element.rb +0 -20
- data/lib/metanorma/document/components/inline/vocabulary.rb +0 -184
- data/lib/metanorma/document/components/multi_paragraph/quote_author_element.rb +0 -20
- data/lib/metanorma/document/components/reference_elements/source_modification.rb +0 -21
- data/lib/metanorma/document/components/reference_elements/source_origin.rb +0 -28
- data/lib/metanorma/document/components/tables/col_element.rb +0 -18
- data/lib/metanorma/document/components/tables/col_group_element.rb +0 -18
- data/lib/metanorma/document/components/tables/table_body_section.rb +0 -16
- data/lib/metanorma/document/components/tables/table_foot_section.rb +0 -16
- data/lib/metanorma/document/components/tables/table_head_section.rb +0 -16
- data/lib/metanorma/document/relaton/copyright_owner.rb +0 -16
- data/lib/metanorma/document/relaton/formatted_address.rb +0 -29
- data/lib/metanorma/document/relaton/logo_element.rb +0 -18
- data/lib/metanorma/document/relaton/region_element.rb +0 -18
- data/lib/metanorma/html/drops/biblio_entry_drop.rb +0 -50
- data/lib/metanorma/html/renderers/block_renderer.rb +0 -372
- data/lib/metanorma/html/renderers/inline_renderer.rb +0 -655
- data/lib/metanorma/html/renderers/pubid_renderer.rb +0 -69
- data/lib/metanorma/html/renderers/section_renderer.rb +0 -193
- data/lib/metanorma/html/renderers.rb +0 -8
- data/lib/metanorma/html/templates/_audio.html.liquid +0 -1
- data/lib/metanorma/html/templates/_biblio_entry.html.liquid +0 -1
- data/lib/metanorma/html/templates/_bipm_cover.html.liquid +0 -27
- data/lib/metanorma/html/templates/_boilerplate.html.liquid +0 -1
- data/lib/metanorma/html/templates/_bookmark.html.liquid +0 -1
- data/lib/metanorma/html/templates/_br.html.liquid +0 -1
- data/lib/metanorma/html/templates/_definition_list.html.liquid +0 -6
- data/lib/metanorma/html/templates/_element.html.liquid +0 -1
- data/lib/metanorma/html/templates/_fn_marker.html.liquid +0 -1
- data/lib/metanorma/html/templates/_heading.html.liquid +0 -1
- data/lib/metanorma/html/templates/_image.html.liquid +0 -1
- data/lib/metanorma/html/templates/_inline_span.html.liquid +0 -1
- data/lib/metanorma/html/templates/_link.html.liquid +0 -1
- data/lib/metanorma/html/templates/_list.html.liquid +0 -3
- data/lib/metanorma/html/templates/_list_item.html.liquid +0 -1
- data/lib/metanorma/html/templates/_main_content.html.liquid +0 -1
- data/lib/metanorma/html/templates/_math_container.html.liquid +0 -1
- data/lib/metanorma/html/templates/_paragraph.html.liquid +0 -1
- data/lib/metanorma/html/templates/_prefatory_section.html.liquid +0 -1
- data/lib/metanorma/html/templates/_pubid_identifier.html.liquid +0 -1
- data/lib/metanorma/html/templates/_quote.html.liquid +0 -4
- data/lib/metanorma/html/templates/_ref_date.html.liquid +0 -1
- data/lib/metanorma/html/templates/_ref_title.html.liquid +0 -1
- data/lib/metanorma/html/templates/_section.html.liquid +0 -5
- data/lib/metanorma/html/templates/_standard_cover.html.liquid +0 -31
- data/lib/metanorma/html/templates/_standard_doc_title.html.liquid +0 -3
- data/lib/metanorma/html/templates/_stem_span.html.liquid +0 -1
- data/lib/metanorma/html/templates/_table.html.liquid +0 -9
- data/lib/metanorma/html/templates/_term_domain.html.liquid +0 -1
- data/lib/metanorma/html/templates/_term_example.html.liquid +0 -1
- data/lib/metanorma/html/templates/_term_note.html.liquid +0 -1
- data/lib/metanorma/html/templates/_term_number.html.liquid +0 -1
- data/lib/metanorma/html/templates/_term_source.html.liquid +0 -1
- data/lib/metanorma/html/templates/_term_text_note.html.liquid +0 -1
- data/lib/metanorma/html/templates/_video.html.liquid +0 -1
- data/lib/metanorma/html/templates/_wrapped_preface.html.liquid +0 -1
- data/lib/metanorma/ietf_document/metadata/pi_settings.rb +0 -32
- data/lib/metanorma/iso_document/metadata/doctype_element.rb +0 -20
- data/lib/metanorma/iso_document/metadata/language_element.rb +0 -18
- data/lib/metanorma/iso_document/metadata/project_number.rb +0 -22
- data/lib/metanorma/iso_document/metadata/script_element.rb +0 -18
- data/lib/metanorma/iso_document/metadata/stage_element.rb +0 -26
- data/lib/metanorma/iso_document/metadata/stagename_element.rb +0 -18
- data/lib/metanorma/iso_document/terms/term_domain_element.rb +0 -18
- data/lib/metanorma/itu_document/metadata/meeting_date.rb +0 -18
- data/lib/metanorma/itu_document/metadata/meeting_element.rb +0 -18
- data/lib/metanorma/itu_document/metadata/study_period.rb +0 -18
- data/lib/metanorma/mirror/default_registry.rb +0 -170
- data/lib/metanorma/mirror/handler_registry.rb +0 -60
- data/lib/metanorma/mirror/handler_result.rb +0 -37
- data/lib/metanorma/mirror/handlers/admonition.rb +0 -18
- data/lib/metanorma/mirror/handlers/example.rb +0 -21
- data/lib/metanorma/mirror/handlers/figure.rb +0 -53
- data/lib/metanorma/mirror/handlers/formula.rb +0 -35
- data/lib/metanorma/mirror/handlers/inline/rich_html_renderer.rb +0 -159
- data/lib/metanorma/mirror/handlers/inline/text_extractor.rb +0 -116
- data/lib/metanorma/mirror/handlers/inline.rb +0 -225
- data/lib/metanorma/mirror/handlers/list.rb +0 -110
- data/lib/metanorma/mirror/handlers/note.rb +0 -26
- data/lib/metanorma/mirror/handlers/paragraph.rb +0 -19
- data/lib/metanorma/mirror/handlers/quote.rb +0 -16
- data/lib/metanorma/mirror/handlers/review.rb +0 -19
- data/lib/metanorma/mirror/handlers/section.rb +0 -149
- data/lib/metanorma/mirror/handlers/sourcecode.rb +0 -27
- data/lib/metanorma/mirror/handlers/structural.rb +0 -68
- data/lib/metanorma/mirror/handlers/table.rb +0 -81
- data/lib/metanorma/mirror/handlers/term.rb +0 -100
- data/lib/metanorma/mirror/handlers.rb +0 -60
- data/lib/metanorma/mirror/id_strategy/positional.rb +0 -166
- data/lib/metanorma/mirror/id_strategy/preserve.rb +0 -12
- data/lib/metanorma/mirror/id_strategy.rb +0 -34
- data/lib/metanorma/mirror/math_util.rb +0 -53
- data/lib/metanorma/mirror/metadata.rb +0 -37
- data/lib/metanorma/mirror/metanorma_to_mirror.rb +0 -101
- data/lib/metanorma/mirror/model/container.rb +0 -47
- data/lib/metanorma/mirror/model/factory.rb +0 -52
- data/lib/metanorma/mirror/model/guide.rb +0 -25
- data/lib/metanorma/mirror/model/leaf.rb +0 -17
- data/lib/metanorma/mirror/model/mark.rb +0 -53
- data/lib/metanorma/mirror/model/node.rb +0 -47
- data/lib/metanorma/mirror/model/soft_break.rb +0 -33
- data/lib/metanorma/mirror/model/text.rb +0 -34
- data/lib/metanorma/mirror/model.rb +0 -16
- data/lib/metanorma/mirror/output/builder.rb +0 -39
- data/lib/metanorma/mirror/output/formats/base_format.rb +0 -90
- data/lib/metanorma/mirror/output/formats/inline_format.rb +0 -81
- data/lib/metanorma/mirror/output/formats.rb +0 -53
- data/lib/metanorma/mirror/output/html_renderer.rb +0 -95
- data/lib/metanorma/mirror/output/html_renderers/block_renderers.rb +0 -178
- data/lib/metanorma/mirror/output/html_renderers/inline_renderer.rb +0 -61
- data/lib/metanorma/mirror/output/html_renderers/list_renderers.rb +0 -96
- data/lib/metanorma/mirror/output/html_renderers/mark_renderers.rb +0 -64
- data/lib/metanorma/mirror/output/html_renderers/section_renderers.rb +0 -129
- data/lib/metanorma/mirror/output/html_renderers/structural_renderers.rb +0 -80
- data/lib/metanorma/mirror/output/html_renderers/table_renderers.rb +0 -87
- data/lib/metanorma/mirror/output/html_renderers.rb +0 -76
- data/lib/metanorma/mirror/output/pipeline.rb +0 -92
- data/lib/metanorma/mirror/output/pipeline_context.rb +0 -22
- data/lib/metanorma/mirror/output.rb +0 -14
- data/lib/metanorma/mirror/rewriter.rb +0 -121
- data/lib/metanorma/mirror/safe_attr.rb +0 -16
- data/lib/metanorma/mirror/serialization/json_serializer.rb +0 -25
- data/lib/metanorma/mirror/serialization/yaml_serializer.rb +0 -20
- data/lib/metanorma/mirror/serialization.rb +0 -10
- data/lib/metanorma/mirror/transformer.rb +0 -22
- data/lib/metanorma/mirror.rb +0 -32
- data/lib/metanorma/standard_document/annotation.rb +0 -37
- data/lib/metanorma/standard_document/blocks/source_origin_element.rb +0 -23
- data/lib/metanorma/standard_document/terms/term_name_element.rb +0 -29
- data/script/render_both.rb +0 -18
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtFnLabelElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :text, :string, collection: true
|
|
11
7
|
attribute :span, SpanElement, collection: true
|
|
12
8
|
attribute :semx, SemxElement, collection: true
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtFootnoteContainerElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :fmt_fn_body, FmtFnBodyElement, collection: true
|
|
11
7
|
|
|
12
8
|
xml do
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtNameElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :id, :string
|
|
11
7
|
attribute :text, :string, collection: true
|
|
12
8
|
attribute :span, SpanElement, collection: true
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtPreferredElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :p, "Metanorma::Document::Components::Paragraphs::ParagraphBlock",
|
|
11
7
|
collection: true
|
|
12
8
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtSourcecodeElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :lang, :string
|
|
11
7
|
attribute :id, :string
|
|
12
8
|
attribute :semx_id, :string
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
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).
|
|
10
5
|
class FmtStemElement < Lutaml::Model::Serializable
|
|
11
|
-
include RenderedDisplay
|
|
12
|
-
|
|
13
6
|
attribute :stem_type, :string
|
|
14
|
-
attribute :text, :string, collection: true
|
|
15
7
|
attribute :semx, SemxElement, collection: true
|
|
16
8
|
|
|
17
9
|
xml do
|
|
18
10
|
element "fmt-stem"
|
|
19
|
-
mixed_content
|
|
20
11
|
map_attribute "type", to: :stem_type
|
|
21
|
-
map_content to: :text
|
|
22
12
|
map_element "semx", to: :semx
|
|
23
13
|
end
|
|
24
14
|
end
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtTermsourceElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :status, :string
|
|
11
7
|
attribute :type, :string
|
|
12
8
|
attribute :semx, SemxElement
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtTitleElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :depth, :string
|
|
11
7
|
attribute :id, :string
|
|
12
8
|
attribute :text, :string, collection: true
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtXrefElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :target, :string
|
|
11
7
|
attribute :type, :string
|
|
12
8
|
attribute :text, :string, collection: true
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
5
|
class FmtXrefLabelElement < Lutaml::Model::Serializable
|
|
8
|
-
include RenderedDisplay
|
|
9
|
-
|
|
10
6
|
attribute :container, :string
|
|
11
7
|
attribute :text, :string, collection: true
|
|
12
8
|
attribute :semx, SemxElement, collection: true
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
@@ -8,14 +6,12 @@ module Metanorma
|
|
|
8
6
|
attribute :id, :string
|
|
9
7
|
attribute :semx_id, :string
|
|
10
8
|
attribute :text, :string
|
|
11
|
-
attribute :stem, TextElements::StemElement, collection: true
|
|
12
9
|
|
|
13
10
|
xml do
|
|
14
11
|
element "name"
|
|
15
12
|
map_attribute "id", to: :id
|
|
16
13
|
map_attribute "semx-id", to: :semx_id
|
|
17
14
|
map_content to: :text
|
|
18
|
-
map_element "stem", to: :stem
|
|
19
15
|
end
|
|
20
16
|
end
|
|
21
17
|
end
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
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".
|
|
17
5
|
class SemxElement < Lutaml::Model::Serializable
|
|
18
6
|
attribute :element_attr, :string
|
|
19
7
|
attribute :source, :string
|
|
@@ -23,7 +11,7 @@ module Metanorma
|
|
|
23
11
|
attribute :fmt_concept, "Metanorma::Document::Components::Inline::FmtConceptElement",
|
|
24
12
|
collection: true
|
|
25
13
|
attribute :asciimath, AsciimathElement, collection: true
|
|
26
|
-
attribute :math,
|
|
14
|
+
attribute :math, MathElement, collection: true
|
|
27
15
|
attribute :p, "Metanorma::Document::Components::Paragraphs::ParagraphBlock",
|
|
28
16
|
collection: true
|
|
29
17
|
attribute :semx, "Metanorma::Document::Components::Inline::SemxElement",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
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.
|
|
10
5
|
class SpanElement < Lutaml::Model::Serializable
|
|
11
|
-
include Inline::Vocabulary
|
|
12
|
-
|
|
13
6
|
attribute :class_attr, :string
|
|
14
7
|
attribute :style, :string
|
|
15
|
-
attribute :
|
|
16
|
-
|
|
8
|
+
attribute :text, :string, collection: true
|
|
9
|
+
attribute :semx, SemxElement, collection: true
|
|
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",
|
|
17
17
|
collection: true
|
|
18
18
|
|
|
19
19
|
xml do
|
|
@@ -22,8 +22,13 @@ 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
|
|
25
31
|
map_element "callout", to: :callout
|
|
26
|
-
Vocabulary::VocabularyXmlMapping.apply_inline_mappings(self)
|
|
27
32
|
end
|
|
28
33
|
end
|
|
29
34
|
end
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
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`.
|
|
11
5
|
class StemInlineElement < Lutaml::Model::Serializable
|
|
12
6
|
attribute :id, :string
|
|
13
7
|
attribute :block, :string
|
|
14
8
|
attribute :stem_type, :string
|
|
15
9
|
attribute :asciimath, AsciimathElement, collection: true
|
|
16
|
-
attribute :math,
|
|
10
|
+
attribute :math, MathElement, collection: true
|
|
17
11
|
|
|
18
12
|
xml do
|
|
19
13
|
element "stem"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
@@ -22,7 +20,6 @@ module Metanorma
|
|
|
22
20
|
collection: true
|
|
23
21
|
attribute :smallcap, SmallCapElement, collection: true
|
|
24
22
|
attribute :br, BrElement, collection: true
|
|
25
|
-
attribute :stem, TextElements::StemElement, collection: true
|
|
26
23
|
attribute :xref, XrefElement, collection: true
|
|
27
24
|
attribute :eref, ErefElement, collection: true
|
|
28
25
|
attribute :link, LinkElement, collection: true
|
|
@@ -42,7 +39,6 @@ module Metanorma
|
|
|
42
39
|
map_element "strike", to: :strike
|
|
43
40
|
map_element "smallcap", to: :smallcap
|
|
44
41
|
map_element "br", to: :br
|
|
45
|
-
map_element "stem", to: :stem
|
|
46
42
|
map_element "xref", to: :xref
|
|
47
43
|
map_element "eref", to: :eref
|
|
48
44
|
map_element "link", to: :link
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
module Metanorma
|
|
4
2
|
module Document
|
|
5
3
|
module Components
|
|
6
4
|
module Inline
|
|
7
|
-
# A cross-reference to another part of the document.
|
|
8
|
-
#
|
|
9
|
-
# Multi-target cross-references carry one or more `<location>`
|
|
10
|
-
# children — secondary targets joined by connectives
|
|
11
|
-
# (e.g. "see Figure 4, 5.1.6 and 5.1.7"). The primary target is
|
|
12
|
-
# in the `target` attribute; secondary targets are in `location`.
|
|
13
5
|
class XrefElement < Lutaml::Model::Serializable
|
|
14
6
|
attribute :id, :string
|
|
15
7
|
attribute :target, :string
|
|
@@ -20,7 +12,6 @@ module Metanorma
|
|
|
20
12
|
attribute :nopage, :string
|
|
21
13
|
attribute :alt, :string
|
|
22
14
|
attribute :text, :string, collection: true
|
|
23
|
-
attribute :location, LocationElement, collection: true
|
|
24
15
|
|
|
25
16
|
xml do
|
|
26
17
|
element "xref"
|
|
@@ -33,7 +24,6 @@ module Metanorma
|
|
|
33
24
|
map_attribute "nopage", to: :nopage
|
|
34
25
|
map_attribute "alt", to: :alt
|
|
35
26
|
map_content to: :text
|
|
36
|
-
map_element "location", to: :location
|
|
37
27
|
end
|
|
38
28
|
end
|
|
39
29
|
end
|
|
@@ -94,18 +94,6 @@ module Metanorma
|
|
|
94
94
|
"metanorma/document/components/inline/display_text_element"
|
|
95
95
|
autoload :Bcp14Element,
|
|
96
96
|
"metanorma/document/components/inline/bcp14_element"
|
|
97
|
-
autoload :Vocabulary,
|
|
98
|
-
"metanorma/document/components/inline/vocabulary"
|
|
99
|
-
autoload :RenderedDisplay,
|
|
100
|
-
"metanorma/document/components/inline/rendered_display"
|
|
101
|
-
autoload :SemanticContent,
|
|
102
|
-
"metanorma/document/components/inline/semantic_content"
|
|
103
|
-
autoload :LocationElement,
|
|
104
|
-
"metanorma/document/components/inline/location_element"
|
|
105
|
-
autoload :SemanticMathElement,
|
|
106
|
-
"metanorma/document/components/inline/semantic_math_element"
|
|
107
|
-
autoload :RenderedMathElement,
|
|
108
|
-
"metanorma/document/components/inline/rendered_math_element"
|
|
109
97
|
end
|
|
110
98
|
end
|
|
111
99
|
end
|
|
@@ -4,17 +4,46 @@ module Metanorma
|
|
|
4
4
|
module Document
|
|
5
5
|
module Components
|
|
6
6
|
module MultiParagraph
|
|
7
|
+
# Author element inside a quote: <author id="...">text</author>
|
|
8
|
+
class QuoteAuthorElement < Lutaml::Model::Serializable
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :text, :string
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element "author"
|
|
14
|
+
map_attribute "id", to: :id
|
|
15
|
+
map_content to: :text
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Block quotation, containing extensive textual content originally authored outside of the current
|
|
20
|
+
# document.
|
|
7
21
|
class QuoteBlock < ParagraphsBlock
|
|
22
|
+
# Bibliographic citation for the quotation.
|
|
8
23
|
attribute :source, Metanorma::Document::Components::ReferenceElements::ReferenceToCitationElement
|
|
24
|
+
|
|
25
|
+
# Author of the quotation. The `author` attribute of the quotation is redundant with the citation,
|
|
26
|
+
# since it restates information about the author that should be recoverable from the citation itself.
|
|
27
|
+
# It is included for convenience, in case processing the citation to extract the author is prohibitive
|
|
28
|
+
# for rendering tools.
|
|
9
29
|
attribute :author, QuoteAuthorElement
|
|
30
|
+
|
|
31
|
+
# Paragraphs within the quote.
|
|
10
32
|
attribute :paragraphs,
|
|
11
33
|
Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
12
34
|
collection: true
|
|
35
|
+
|
|
36
|
+
# Unordered lists within the quote.
|
|
13
37
|
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
14
38
|
collection: true
|
|
39
|
+
|
|
40
|
+
# Ordered lists within the quote.
|
|
15
41
|
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
16
42
|
collection: true
|
|
43
|
+
|
|
44
|
+
# Attribution for the quotation (presentation XML).
|
|
17
45
|
attribute :attribution, "Metanorma::Document::Components::Inline::AttributionElement"
|
|
46
|
+
|
|
18
47
|
attribute :json_type, :string
|
|
19
48
|
|
|
20
49
|
def json_type
|
|
@@ -8,8 +8,6 @@ module Metanorma
|
|
|
8
8
|
autoload :AdmonitionType, "#{__dir__}/multi_paragraph/admonition_type"
|
|
9
9
|
autoload :ParagraphsBlock, "#{__dir__}/multi_paragraph/paragraphs_block"
|
|
10
10
|
autoload :QuoteBlock, "#{__dir__}/multi_paragraph/quote_block"
|
|
11
|
-
autoload :QuoteAuthorElement,
|
|
12
|
-
"#{__dir__}/multi_paragraph/quote_author_element"
|
|
13
11
|
autoload :ReviewBlock, "#{__dir__}/multi_paragraph/review_block"
|
|
14
12
|
end
|
|
15
13
|
end
|
|
@@ -4,6 +4,37 @@ module Metanorma
|
|
|
4
4
|
module Document
|
|
5
5
|
module Components
|
|
6
6
|
module ReferenceElements
|
|
7
|
+
class SourceOrigin < Lutaml::Model::Serializable
|
|
8
|
+
attribute :bibitemid, :string
|
|
9
|
+
attribute :type, :string
|
|
10
|
+
attribute :citeas, :string
|
|
11
|
+
attribute :locality_stack, Metanorma::Document::Relaton::LocalityStack,
|
|
12
|
+
collection: true
|
|
13
|
+
attribute :display_text,
|
|
14
|
+
Metanorma::Document::Components::Inline::DisplayTextElement
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
element "origin"
|
|
18
|
+
map_attribute "bibitemid", to: :bibitemid
|
|
19
|
+
map_attribute "type", to: :type
|
|
20
|
+
map_attribute "citeas", to: :citeas
|
|
21
|
+
map_element "localityStack", to: :locality_stack
|
|
22
|
+
map_element "display-text", to: :display_text
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class SourceModification < Lutaml::Model::Serializable
|
|
27
|
+
attribute :id, :string
|
|
28
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
29
|
+
collection: true
|
|
30
|
+
|
|
31
|
+
xml do
|
|
32
|
+
element "modification"
|
|
33
|
+
map_attribute "id", to: :id
|
|
34
|
+
map_element "p", to: :p
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
7
38
|
class SourceElement < Lutaml::Model::Serializable
|
|
8
39
|
attribute :id, :string
|
|
9
40
|
attribute :status, :string
|
|
@@ -24,9 +24,9 @@ module Metanorma
|
|
|
24
24
|
autoload :SourceElement,
|
|
25
25
|
"#{__dir__}/reference_elements/source_element"
|
|
26
26
|
autoload :SourceModification,
|
|
27
|
-
"#{__dir__}/reference_elements/
|
|
27
|
+
"#{__dir__}/reference_elements/source_element"
|
|
28
28
|
autoload :SourceOrigin,
|
|
29
|
-
"#{__dir__}/reference_elements/
|
|
29
|
+
"#{__dir__}/reference_elements/source_element"
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -4,6 +4,27 @@ module Metanorma
|
|
|
4
4
|
module Document
|
|
5
5
|
module Components
|
|
6
6
|
module Tables
|
|
7
|
+
# Column element within colgroup.
|
|
8
|
+
class ColElement < Lutaml::Model::Serializable
|
|
9
|
+
attribute :width, :string
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element "col"
|
|
13
|
+
map_attribute "width", to: :width
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Column group element for table column width specifications.
|
|
18
|
+
class ColGroupElement < Lutaml::Model::Serializable
|
|
19
|
+
attribute :col, ColElement, collection: true
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
element "colgroup"
|
|
23
|
+
map_element "col", to: :col
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Tabular arrangement of text
|
|
7
28
|
class TableBlock < Metanorma::Document::Components::Blocks::BasicBlock
|
|
8
29
|
attribute :id, :string
|
|
9
30
|
attribute :anchor, :string
|
|
@@ -31,6 +52,7 @@ module Metanorma
|
|
|
31
52
|
collection: true
|
|
32
53
|
attribute :colgroup, ColGroupElement
|
|
33
54
|
|
|
55
|
+
# Presentation-specific elements
|
|
34
56
|
attribute :fmt_name, Metanorma::Document::Components::Inline::FmtNameElement
|
|
35
57
|
attribute :fmt_xref_label,
|
|
36
58
|
Metanorma::Document::Components::Inline::FmtXrefLabelElement, collection: true
|
|
@@ -4,6 +4,7 @@ module Metanorma
|
|
|
4
4
|
module Document
|
|
5
5
|
module Components
|
|
6
6
|
module Tables
|
|
7
|
+
# Base class for table sections (thead, tbody, tfoot) wrapping rows.
|
|
7
8
|
class TableSection < Lutaml::Model::Serializable
|
|
8
9
|
attribute :tr, TextTableRow, collection: true
|
|
9
10
|
|
|
@@ -11,6 +12,30 @@ module Metanorma
|
|
|
11
12
|
map_element "tr", to: :tr
|
|
12
13
|
end
|
|
13
14
|
end
|
|
15
|
+
|
|
16
|
+
# Table header section wrapping <thead> rows.
|
|
17
|
+
class TableHeadSection < TableSection
|
|
18
|
+
xml do
|
|
19
|
+
element "thead"
|
|
20
|
+
map_element "tr", to: :tr
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Table body section wrapping <tbody> rows.
|
|
25
|
+
class TableBodySection < TableSection
|
|
26
|
+
xml do
|
|
27
|
+
element "tbody"
|
|
28
|
+
map_element "tr", to: :tr
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Table footer section wrapping <tfoot> rows.
|
|
33
|
+
class TableFootSection < TableSection
|
|
34
|
+
xml do
|
|
35
|
+
element "tfoot"
|
|
36
|
+
map_element "tr", to: :tr
|
|
37
|
+
end
|
|
38
|
+
end
|
|
14
39
|
end
|
|
15
40
|
end
|
|
16
41
|
end
|
|
@@ -4,15 +4,13 @@ module Metanorma
|
|
|
4
4
|
module Document
|
|
5
5
|
module Components
|
|
6
6
|
module Tables
|
|
7
|
-
autoload :ColElement, "#{__dir__}/tables/col_element"
|
|
8
|
-
autoload :ColGroupElement, "#{__dir__}/tables/col_group_element"
|
|
9
7
|
autoload :HeaderTableCell, "#{__dir__}/tables/header_table_cell"
|
|
10
8
|
autoload :ParagraphTableCell, "#{__dir__}/tables/paragraph_table_cell"
|
|
11
9
|
autoload :TableBlock, "#{__dir__}/tables/table_block"
|
|
12
10
|
autoload :TableCell, "#{__dir__}/tables/table_cell"
|
|
13
|
-
autoload :TableHeadSection, "#{__dir__}/tables/
|
|
14
|
-
autoload :TableBodySection, "#{__dir__}/tables/
|
|
15
|
-
autoload :TableFootSection, "#{__dir__}/tables/
|
|
11
|
+
autoload :TableHeadSection, "#{__dir__}/tables/table_section"
|
|
12
|
+
autoload :TableBodySection, "#{__dir__}/tables/table_section"
|
|
13
|
+
autoload :TableFootSection, "#{__dir__}/tables/table_section"
|
|
16
14
|
autoload :TableSection, "#{__dir__}/tables/table_section"
|
|
17
15
|
autoload :TextAlignment, "#{__dir__}/tables/text_alignment"
|
|
18
16
|
autoload :TextTableCell, "#{__dir__}/tables/text_table_cell"
|