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,30 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Blocks
|
|
7
|
-
class RequirementBase < Lutaml::Model::Serializable
|
|
8
|
-
attribute :id, :string
|
|
9
|
-
attribute :model, :string
|
|
10
|
-
attribute :obligation, :string
|
|
11
|
-
attribute :type, :string
|
|
12
|
-
attribute :anchor, :string
|
|
13
|
-
attribute :subject, :string
|
|
14
|
-
attribute :classification, RequirementClassification, collection: true
|
|
15
|
-
attribute :description, RequirementDescription, collection: true
|
|
16
|
-
attribute :inherit, RequirementInherit, collection: true
|
|
17
|
-
attribute :requirement, "Metanorma::Document::Components::Blocks::RequirementModel",
|
|
18
|
-
collection: true
|
|
19
|
-
attribute :recommendation, "Metanorma::Document::Components::Blocks::RecommendationModel",
|
|
20
|
-
collection: true
|
|
21
|
-
attribute :permission, "Metanorma::Document::Components::Blocks::PermissionModel",
|
|
22
|
-
collection: true
|
|
23
|
-
attribute :example,
|
|
24
|
-
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
25
|
-
collection: true
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Blocks
|
|
7
|
-
class RequirementClassification < Lutaml::Model::Serializable
|
|
8
|
-
attribute :tag, :string
|
|
9
|
-
attribute :value, ClassificationValue
|
|
10
|
-
|
|
11
|
-
xml do
|
|
12
|
-
element "classification"
|
|
13
|
-
map_element "tag", to: :tag
|
|
14
|
-
map_element "value", to: :value
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Blocks
|
|
7
|
-
class RequirementDescription < Lutaml::Model::Serializable
|
|
8
|
-
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
9
|
-
collection: true
|
|
10
|
-
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
11
|
-
collection: true
|
|
12
|
-
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
13
|
-
collection: true
|
|
14
|
-
attribute :sourcecode,
|
|
15
|
-
Metanorma::Document::Components::AncillaryBlocks::SourcecodeBlock,
|
|
16
|
-
collection: true
|
|
17
|
-
attribute :table, Metanorma::Document::Components::Tables::TableBlock,
|
|
18
|
-
collection: true
|
|
19
|
-
attribute :example,
|
|
20
|
-
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
21
|
-
collection: true
|
|
22
|
-
attribute :note, Metanorma::Document::Components::Blocks::NoteBlock,
|
|
23
|
-
collection: true
|
|
24
|
-
attribute :figure,
|
|
25
|
-
Metanorma::Document::Components::AncillaryBlocks::FigureBlock,
|
|
26
|
-
collection: true
|
|
27
|
-
|
|
28
|
-
xml do
|
|
29
|
-
element "description"
|
|
30
|
-
map_element "p", to: :p
|
|
31
|
-
map_element "ul", to: :ul
|
|
32
|
-
map_element "ol", to: :ol
|
|
33
|
-
map_element "sourcecode", to: :sourcecode
|
|
34
|
-
map_element "table", to: :table
|
|
35
|
-
map_element "example", to: :example
|
|
36
|
-
map_element "note", to: :note
|
|
37
|
-
map_element "figure", to: :figure
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Blocks
|
|
7
|
-
class RequirementInherit < Lutaml::Model::Serializable
|
|
8
|
-
attribute :text, :string, collection: true
|
|
9
|
-
attribute :eref, Metanorma::Document::Components::Inline::ErefElement,
|
|
10
|
-
collection: true
|
|
11
|
-
attribute :xref, Metanorma::Document::Components::Inline::XrefElement,
|
|
12
|
-
collection: true
|
|
13
|
-
|
|
14
|
-
xml do
|
|
15
|
-
mixed_content
|
|
16
|
-
map_content to: :text
|
|
17
|
-
map_element "eref", to: :eref
|
|
18
|
-
map_element "xref", to: :xref
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
|
@@ -1,20 +0,0 @@
|
|
|
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,184 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Inline
|
|
7
|
-
# Shared vocabulary of inline child elements that may appear in any
|
|
8
|
-
# general-purpose inline-content container. Including this module
|
|
9
|
-
# in a `Lutaml::Model::Serializable` subclass declares every inline
|
|
10
|
-
# element type as a collection attribute, so that no inline child
|
|
11
|
-
# encountered during parsing is silently dropped.
|
|
12
|
-
#
|
|
13
|
-
# Use together with `VocabularyXmlMapping.apply_inline_mappings`
|
|
14
|
-
# inside the class's `xml do ... end` block.
|
|
15
|
-
#
|
|
16
|
-
# Restricted child sets (e.g. `XrefElement` with only `<location>`
|
|
17
|
-
# children) intentionally do NOT include this module — they have
|
|
18
|
-
# semantic reasons to exclude the general vocabulary.
|
|
19
|
-
module Vocabulary
|
|
20
|
-
def self.included(base)
|
|
21
|
-
declare_text_attributes_on(base)
|
|
22
|
-
declare_formatting_attributes_on(base)
|
|
23
|
-
declare_cross_reference_attributes_on(base)
|
|
24
|
-
declare_structural_attributes_on(base)
|
|
25
|
-
declare_rendered_display_attributes_on(base)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
class << self
|
|
29
|
-
def declare_text_attributes_on(base)
|
|
30
|
-
base.attribute :text, :string, collection: true
|
|
31
|
-
base.attribute :semx,
|
|
32
|
-
Metanorma::Document::Components::Inline::SemxElement,
|
|
33
|
-
collection: true
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def declare_formatting_attributes_on(base)
|
|
37
|
-
base.attribute :em,
|
|
38
|
-
Metanorma::Document::Components::Inline::EmRawElement,
|
|
39
|
-
collection: true
|
|
40
|
-
base.attribute :strong,
|
|
41
|
-
Metanorma::Document::Components::Inline::StrongRawElement,
|
|
42
|
-
collection: true
|
|
43
|
-
base.attribute :sub,
|
|
44
|
-
Metanorma::Document::Components::Inline::SubElement,
|
|
45
|
-
collection: true
|
|
46
|
-
base.attribute :sup,
|
|
47
|
-
Metanorma::Document::Components::Inline::SupElement,
|
|
48
|
-
collection: true
|
|
49
|
-
base.attribute :tt,
|
|
50
|
-
Metanorma::Document::Components::Inline::TtElement,
|
|
51
|
-
collection: true
|
|
52
|
-
base.attribute :underline,
|
|
53
|
-
Metanorma::Document::Components::TextElements::UnderlineElement,
|
|
54
|
-
collection: true
|
|
55
|
-
base.attribute :strike,
|
|
56
|
-
Metanorma::Document::Components::TextElements::StrikeElement,
|
|
57
|
-
collection: true
|
|
58
|
-
base.attribute :smallcap,
|
|
59
|
-
Metanorma::Document::Components::Inline::SmallCapElement,
|
|
60
|
-
collection: true
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def declare_cross_reference_attributes_on(base)
|
|
64
|
-
base.attribute :xref,
|
|
65
|
-
Metanorma::Document::Components::Inline::XrefElement,
|
|
66
|
-
collection: true
|
|
67
|
-
base.attribute :eref,
|
|
68
|
-
Metanorma::Document::Components::Inline::ErefElement,
|
|
69
|
-
collection: true
|
|
70
|
-
base.attribute :link,
|
|
71
|
-
Metanorma::Document::Components::Inline::LinkElement,
|
|
72
|
-
collection: true
|
|
73
|
-
base.attribute :span,
|
|
74
|
-
Metanorma::Document::Components::Inline::SpanElement,
|
|
75
|
-
collection: true
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def declare_structural_attributes_on(base)
|
|
79
|
-
base.attribute :stem,
|
|
80
|
-
Metanorma::Document::Components::Inline::StemInlineElement,
|
|
81
|
-
collection: true
|
|
82
|
-
base.attribute :concept,
|
|
83
|
-
Metanorma::Document::Components::Inline::ConceptElement,
|
|
84
|
-
collection: true
|
|
85
|
-
base.attribute :fn,
|
|
86
|
-
Metanorma::Document::Components::Inline::FnElement,
|
|
87
|
-
collection: true
|
|
88
|
-
base.attribute :bcp14,
|
|
89
|
-
Metanorma::Document::Components::Inline::Bcp14Element,
|
|
90
|
-
collection: true
|
|
91
|
-
base.attribute :br,
|
|
92
|
-
Metanorma::Document::Components::Inline::BrElement,
|
|
93
|
-
collection: true
|
|
94
|
-
base.attribute :tab,
|
|
95
|
-
Metanorma::Document::Components::Inline::TabElement,
|
|
96
|
-
collection: true
|
|
97
|
-
base.attribute :bookmark,
|
|
98
|
-
Metanorma::Document::Components::IdElements::Bookmark,
|
|
99
|
-
collection: true
|
|
100
|
-
base.attribute :image,
|
|
101
|
-
Metanorma::Document::Components::IdElements::Image,
|
|
102
|
-
collection: true
|
|
103
|
-
base.attribute :index,
|
|
104
|
-
Metanorma::Document::Components::EmptyElements::IndexElement,
|
|
105
|
-
collection: true
|
|
106
|
-
base.attribute :add, "Metanorma::Document::Elements::Add",
|
|
107
|
-
collection: true
|
|
108
|
-
base.attribute :del, "Metanorma::Document::Elements::Del",
|
|
109
|
-
collection: true
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def declare_rendered_display_attributes_on(base)
|
|
113
|
-
base.attribute :fmt_stem,
|
|
114
|
-
Metanorma::Document::Components::Inline::FmtStemElement,
|
|
115
|
-
collection: true
|
|
116
|
-
base.attribute :fmt_concept,
|
|
117
|
-
Metanorma::Document::Components::Inline::FmtConceptElement,
|
|
118
|
-
collection: true
|
|
119
|
-
base.attribute :fmt_fn_label,
|
|
120
|
-
Metanorma::Document::Components::Inline::FmtFnLabelElement,
|
|
121
|
-
collection: true
|
|
122
|
-
base.attribute :fmt_annotation_start,
|
|
123
|
-
Metanorma::Document::Components::Inline::FmtAnnotationStartElement,
|
|
124
|
-
collection: true
|
|
125
|
-
base.attribute :fmt_annotation_end,
|
|
126
|
-
Metanorma::Document::Components::Inline::FmtAnnotationEndElement,
|
|
127
|
-
collection: true
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
# Adds the `map_element` calls corresponding to every vocabulary
|
|
132
|
-
# attribute. Call inside an `xml do ... end` block:
|
|
133
|
-
#
|
|
134
|
-
# xml do
|
|
135
|
-
# element "span"
|
|
136
|
-
# mixed_content
|
|
137
|
-
# map_attribute "class", to: :class_attr
|
|
138
|
-
# map_content to: :text
|
|
139
|
-
# VocabularyXmlMapping.apply_inline_mappings(self)
|
|
140
|
-
# end
|
|
141
|
-
module VocabularyXmlMapping
|
|
142
|
-
INLINE_MAPPINGS = {
|
|
143
|
-
"semx" => :semx,
|
|
144
|
-
"em" => :em,
|
|
145
|
-
"strong" => :strong,
|
|
146
|
-
"sub" => :sub,
|
|
147
|
-
"sup" => :sup,
|
|
148
|
-
"tt" => :tt,
|
|
149
|
-
"underline" => :underline,
|
|
150
|
-
"strike" => :strike,
|
|
151
|
-
"smallcap" => :smallcap,
|
|
152
|
-
"br" => :br,
|
|
153
|
-
"tab" => :tab,
|
|
154
|
-
"xref" => :xref,
|
|
155
|
-
"eref" => :eref,
|
|
156
|
-
"link" => :link,
|
|
157
|
-
"span" => :span,
|
|
158
|
-
"stem" => :stem,
|
|
159
|
-
"concept" => :concept,
|
|
160
|
-
"fn" => :fn,
|
|
161
|
-
"bcp14" => :bcp14,
|
|
162
|
-
"bookmark" => :bookmark,
|
|
163
|
-
"image" => :image,
|
|
164
|
-
"index" => :index,
|
|
165
|
-
"add" => :add,
|
|
166
|
-
"del" => :del,
|
|
167
|
-
"fmt-stem" => :fmt_stem,
|
|
168
|
-
"fmt-concept" => :fmt_concept,
|
|
169
|
-
"fmt-fn-label" => :fmt_fn_label,
|
|
170
|
-
"fmt-annotation-start" => :fmt_annotation_start,
|
|
171
|
-
"fmt-annotation-end" => :fmt_annotation_end,
|
|
172
|
-
}.freeze
|
|
173
|
-
|
|
174
|
-
def self.apply_inline_mappings(mapping)
|
|
175
|
-
INLINE_MAPPINGS.each do |element_name, attr_name|
|
|
176
|
-
mapping.map_element(element_name, to: attr_name)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module MultiParagraph
|
|
7
|
-
class QuoteAuthorElement < Lutaml::Model::Serializable
|
|
8
|
-
attribute :id, :string
|
|
9
|
-
attribute :text, :string
|
|
10
|
-
|
|
11
|
-
xml do
|
|
12
|
-
element "author"
|
|
13
|
-
map_attribute "id", to: :id
|
|
14
|
-
map_content to: :text
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module ReferenceElements
|
|
7
|
-
class SourceModification < Lutaml::Model::Serializable
|
|
8
|
-
attribute :id, :string
|
|
9
|
-
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
10
|
-
collection: true
|
|
11
|
-
|
|
12
|
-
xml do
|
|
13
|
-
element "modification"
|
|
14
|
-
map_attribute "id", to: :id
|
|
15
|
-
map_element "p", to: :p
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
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
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Tables
|
|
7
|
-
class ColElement < Lutaml::Model::Serializable
|
|
8
|
-
attribute :width, :string
|
|
9
|
-
|
|
10
|
-
xml do
|
|
11
|
-
element "col"
|
|
12
|
-
map_attribute "width", to: :width
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Components
|
|
6
|
-
module Tables
|
|
7
|
-
class ColGroupElement < Lutaml::Model::Serializable
|
|
8
|
-
attribute :col, ColElement, collection: true
|
|
9
|
-
|
|
10
|
-
xml do
|
|
11
|
-
element "colgroup"
|
|
12
|
-
map_element "col", to: :col
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Relaton
|
|
6
|
-
class CopyrightOwner < Lutaml::Model::Serializable
|
|
7
|
-
attribute :organization, Organization
|
|
8
|
-
|
|
9
|
-
xml do
|
|
10
|
-
element "owner"
|
|
11
|
-
map_element "organization", to: :organization
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Relaton
|
|
6
|
-
class FormattedAddress < Lutaml::Model::Serializable
|
|
7
|
-
attribute :content, :string, collection: true
|
|
8
|
-
attribute :br, Metanorma::Document::Components::Inline::BrElement,
|
|
9
|
-
collection: true
|
|
10
|
-
|
|
11
|
-
xml do
|
|
12
|
-
element "formattedAddress"
|
|
13
|
-
mixed_content
|
|
14
|
-
map_content to: :content
|
|
15
|
-
map_element "br", to: :br
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def self.from_lines(lines)
|
|
19
|
-
new.tap do |fa|
|
|
20
|
-
fa.content = lines
|
|
21
|
-
fa.br = lines[1..].map do
|
|
22
|
-
Metanorma::Document::Components::Inline::BrElement.new
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Document
|
|
5
|
-
module Relaton
|
|
6
|
-
class LogoElement < Lutaml::Model::Serializable
|
|
7
|
-
attribute :type, :string
|
|
8
|
-
attribute :content, :string
|
|
9
|
-
|
|
10
|
-
xml do
|
|
11
|
-
element "logo"
|
|
12
|
-
map_attribute "type", to: :type
|
|
13
|
-
map_all_content to: :content
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|