metanorma-document 0.2.8 → 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/note_block.rb +1 -1
- 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 +3 -1
- 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 +3 -1
- 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/lists/unordered_list.rb +2 -2
- data/lib/metanorma/document/components/multi_paragraph/admonition_block.rb +5 -2
- 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/paragraphs/paragraph_block.rb +2 -2
- 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 +291 -321
- 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/ietf_document/sections/ietf_annex_section.rb +1 -1
- data/lib/metanorma/ietf_document/sections/ietf_clause_section.rb +1 -1
- data/lib/metanorma/ietf_document/sections/ietf_content_section.rb +1 -1
- data/lib/metanorma/iso_document/metadata/doc_identifier.rb +1 -1
- 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/sections/iso_terms_section.rb +4 -3
- 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/term_example.rb +2 -1
- data/lib/metanorma/iso_document/terms/term_note.rb +2 -1
- data/lib/metanorma/iso_document/terms/verbal_definition.rb +2 -1
- data/lib/metanorma/iso_document/terms.rb +1 -0
- data/lib/metanorma/iso_document.rb +0 -1
- 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/jis_document/sections/jis_annex_section.rb +1 -1
- 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/annotation_container.rb +25 -2
- data/lib/metanorma/standard_document/block_attributes.rb +15 -2
- data/lib/metanorma/standard_document/blocks/amend_content_block.rb +21 -3
- 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/standard_block_no_notes.rb +2 -2
- data/lib/metanorma/standard_document/blocks.rb +1 -1
- data/lib/metanorma/standard_document/boilerplate.rb +20 -2
- data/lib/metanorma/standard_document/sections/annex_section.rb +2 -2
- data/lib/metanorma/standard_document/sections/clause_hierarchical_section.rb +1 -1
- data/lib/metanorma/standard_document/sections/clause_section.rb +2 -2
- data/lib/metanorma/standard_document/sections/definition_section.rb +2 -2
- data/lib/metanorma/standard_document/sections/standard_content_section.rb +2 -2
- data/lib/metanorma/standard_document/sections/standard_hierarchical_section.rb +1 -1
- data/lib/metanorma/standard_document/sections/standard_references_section.rb +2 -2
- data/lib/metanorma/standard_document/sections/standard_section.rb +1 -1
- data/lib/metanorma/standard_document/sections/terms_section.rb +2 -2
- 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 -14
- 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/lib/metanorma/iso_document/raw_paragraph.rb +0 -23
- data/metanorma-document.gemspec +0 -35
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IetfDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class PiSettings < Lutaml::Model::Serializable
|
|
7
|
+
attribute :toc, :string
|
|
8
|
+
attribute :tocdepth, :string
|
|
9
|
+
attribute :symrefs, :string
|
|
10
|
+
attribute :sortrefs, :string
|
|
11
|
+
attribute :compact, :string
|
|
12
|
+
attribute :subcompact, :string
|
|
13
|
+
attribute :strict, :string
|
|
14
|
+
attribute :comments, :string
|
|
15
|
+
attribute :notedraftinprogress, :string
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
element "pi"
|
|
19
|
+
map_element "toc", to: :toc
|
|
20
|
+
map_element "tocdepth", to: :tocdepth
|
|
21
|
+
map_element "symrefs", to: :symrefs
|
|
22
|
+
map_element "sortrefs", to: :sortrefs
|
|
23
|
+
map_element "compact", to: :compact
|
|
24
|
+
map_element "subcompact", to: :subcompact
|
|
25
|
+
map_element "strict", to: :strict
|
|
26
|
+
map_element "comments", to: :comments
|
|
27
|
+
map_element "notedraftinprogress", to: :notedraftinprogress
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -9,6 +9,8 @@ module Metanorma
|
|
|
9
9
|
"metanorma/ietf_document/metadata/ietf_bibliographic_item"
|
|
10
10
|
autoload :IetfEditorialGroup,
|
|
11
11
|
"metanorma/ietf_document/metadata/ietf_editorial_group"
|
|
12
|
+
autoload :PiSettings,
|
|
13
|
+
"metanorma/ietf_document/metadata/pi_settings"
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
16
|
end
|
|
@@ -6,7 +6,7 @@ module Metanorma
|
|
|
6
6
|
class IetfAnnexSection < Metanorma::StandardDocument::Sections::AnnexSection
|
|
7
7
|
# IETF-specific attributes
|
|
8
8
|
attribute :numbered, :string
|
|
9
|
-
attribute :remove_in_rfc, :
|
|
9
|
+
attribute :remove_in_rfc, :boolean
|
|
10
10
|
|
|
11
11
|
# Sub-clauses within IETF annex use IetfClauseSection
|
|
12
12
|
attribute :clause, IetfClauseSection, collection: true
|
|
@@ -6,7 +6,7 @@ module Metanorma
|
|
|
6
6
|
class IetfClauseSection < Metanorma::StandardDocument::Sections::ClauseSection
|
|
7
7
|
# IETF-specific attributes
|
|
8
8
|
attribute :numbered, :string
|
|
9
|
-
attribute :remove_in_rfc, :
|
|
9
|
+
attribute :remove_in_rfc, :boolean
|
|
10
10
|
|
|
11
11
|
# Recursive IETF sub-clauses
|
|
12
12
|
attribute :clause, IetfClauseSection, collection: true
|
|
@@ -5,7 +5,7 @@ module Metanorma
|
|
|
5
5
|
module Sections
|
|
6
6
|
class IetfContentSection < Metanorma::StandardDocument::Sections::ContentSection
|
|
7
7
|
attribute :numbered, :string
|
|
8
|
-
attribute :remove_in_rfc, :
|
|
8
|
+
attribute :remove_in_rfc, :boolean
|
|
9
9
|
|
|
10
10
|
# Recursive IETF sub-clauses
|
|
11
11
|
attribute :subsection, IetfContentSection, collection: true
|
|
@@ -7,7 +7,7 @@ module Metanorma
|
|
|
7
7
|
# Used for the multiple <docidentifier> elements in bibdata/bibitem.
|
|
8
8
|
class DocIdentifier < Lutaml::Model::Serializable
|
|
9
9
|
attribute :type, :string
|
|
10
|
-
attribute :primary, :
|
|
10
|
+
attribute :primary, :boolean
|
|
11
11
|
attribute :scope, :string
|
|
12
12
|
attribute :language, :string
|
|
13
13
|
attribute :value, :string
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class DoctypeElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :language, :string
|
|
8
|
+
attribute :abbreviation, :string
|
|
9
|
+
attribute :value, :string
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element "doctype"
|
|
13
|
+
map_attribute "language", to: :language, render_empty: true
|
|
14
|
+
map_attribute "abbreviation", to: :abbreviation
|
|
15
|
+
map_content to: :value
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -3,66 +3,18 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module IsoDocument
|
|
5
5
|
module Metadata
|
|
6
|
-
# Extension point for bibliographical definitions of ISO/IEC documents.
|
|
7
|
-
# Document type element with language attribute.
|
|
8
|
-
class DoctypeElement < Lutaml::Model::Serializable
|
|
9
|
-
attribute :language, :string
|
|
10
|
-
attribute :abbreviation, :string
|
|
11
|
-
attribute :value, :string
|
|
12
|
-
|
|
13
|
-
xml do
|
|
14
|
-
element "doctype"
|
|
15
|
-
map_attribute "language", to: :language, render_empty: true
|
|
16
|
-
map_attribute "abbreviation", to: :abbreviation
|
|
17
|
-
map_content to: :value
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Stage name element with abbreviation attribute.
|
|
22
|
-
class StagenameElement < Lutaml::Model::Serializable
|
|
23
|
-
attribute :abbreviation, :string
|
|
24
|
-
attribute :value, :string
|
|
25
|
-
|
|
26
|
-
xml do
|
|
27
|
-
element "stagename"
|
|
28
|
-
map_attribute "abbreviation", to: :abbreviation
|
|
29
|
-
map_content to: :value
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
6
|
class IsoBibDataExtensionType < Lutaml::Model::Serializable
|
|
34
|
-
# The document is a horizontal standard.
|
|
35
7
|
attribute :horizontal, :boolean
|
|
36
|
-
|
|
37
|
-
# Editorial groups associated with the production of the document.
|
|
38
8
|
attribute :editorial_group, IsoProjectGroup
|
|
39
|
-
|
|
40
|
-
# Name of the publication stage of the document.
|
|
41
9
|
attribute :stage_name, :string
|
|
42
|
-
|
|
43
|
-
# Category of IEC Standard applicable.
|
|
44
10
|
attribute :category, :string
|
|
45
|
-
|
|
46
|
-
# Type of document being updated by this document, if it is an amendment or technical corrigendum.
|
|
47
11
|
attribute :updates_document_type, :string
|
|
48
12
|
attribute :semx_id, :string
|
|
49
|
-
|
|
50
|
-
# Document type (e.g. "international-standard").
|
|
51
13
|
attribute :doctype, DoctypeElement, collection: true
|
|
52
|
-
|
|
53
|
-
# Document flavor (e.g. "iso").
|
|
54
14
|
attribute :flavor, :string
|
|
55
|
-
|
|
56
|
-
# ICS classification codes.
|
|
57
15
|
attribute :ics, Ics, collection: true
|
|
58
|
-
|
|
59
|
-
# Structured identifier (project number, part).
|
|
60
16
|
attribute :structuredidentifier, StructuredIdentifier
|
|
61
|
-
|
|
62
|
-
# Name of the publication stage.
|
|
63
17
|
attribute :stagename, StagenameElement
|
|
64
|
-
|
|
65
|
-
# Sub-document type.
|
|
66
18
|
attribute :subdoctype, :string
|
|
67
19
|
|
|
68
20
|
xml do
|
|
@@ -3,101 +3,34 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module IsoDocument
|
|
5
5
|
module Metadata
|
|
6
|
-
# The bibliographical description of an ISO/IEC document.
|
|
7
|
-
# Language element with current attribute.
|
|
8
|
-
class LanguageElement < Lutaml::Model::Serializable
|
|
9
|
-
attribute :current, :string
|
|
10
|
-
attribute :value, :string
|
|
11
|
-
|
|
12
|
-
xml do
|
|
13
|
-
element "language"
|
|
14
|
-
map_attribute "current", to: :current
|
|
15
|
-
map_content to: :value
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# Script element with current attribute.
|
|
20
|
-
class ScriptElement < Lutaml::Model::Serializable
|
|
21
|
-
attribute :current, :string
|
|
22
|
-
attribute :value, :string
|
|
23
|
-
|
|
24
|
-
xml do
|
|
25
|
-
element "script"
|
|
26
|
-
map_attribute "current", to: :current
|
|
27
|
-
map_content to: :value
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
6
|
class IsoBibliographicItem < Lutaml::Model::Serializable
|
|
32
|
-
# Identifier of the document.
|
|
33
7
|
attribute :doc_identifier, DocIdentifier, collection: true
|
|
34
|
-
|
|
35
|
-
# Collection of all title elements, grouped by language via consolidation mapping.
|
|
36
|
-
# Access: titles.items (raw), titles.per_language (grouped), titles.for_language("en")
|
|
37
8
|
attribute :titles, AbstractTitle, collection: TitleCollection
|
|
38
|
-
|
|
39
|
-
# Type of the document.
|
|
40
9
|
attribute :type, :string
|
|
41
|
-
|
|
42
|
-
# Fetched date
|
|
43
10
|
attribute :fetched, Metanorma::Document::Relaton::DateTime
|
|
44
|
-
|
|
45
|
-
# URIs associated with the document.
|
|
46
11
|
attribute :uri, Metanorma::Document::Relaton::TypedUri, collection: true
|
|
47
|
-
|
|
48
|
-
# Link/source
|
|
49
12
|
attribute :source, :string, collection: true
|
|
50
|
-
|
|
51
|
-
# Document number
|
|
52
13
|
attribute :docnumber, :string
|
|
53
|
-
|
|
54
|
-
# Contributors
|
|
55
14
|
attribute :contributor, Metanorma::Document::Relaton::ContributionInfo,
|
|
56
15
|
collection: true
|
|
57
|
-
|
|
58
|
-
# Edition
|
|
59
16
|
attribute :edition, Metanorma::Document::Relaton::Edition,
|
|
60
17
|
collection: true
|
|
61
|
-
|
|
62
|
-
# Version
|
|
63
18
|
attribute :version, Metanorma::Document::Relaton::VersionInfo
|
|
64
|
-
|
|
65
|
-
# Notes
|
|
66
19
|
attribute :note, Metanorma::Document::Relaton::TypedNote,
|
|
67
20
|
collection: true
|
|
68
|
-
|
|
69
|
-
# Language codes
|
|
70
21
|
attribute :language, LanguageElement, collection: true
|
|
71
|
-
|
|
72
|
-
# Script codes
|
|
73
22
|
attribute :script, ScriptElement, collection: true
|
|
74
|
-
|
|
75
|
-
# Abstract of the document.
|
|
76
23
|
attribute :abstract, Metanorma::Document::Components::DataTypes::FormattedString,
|
|
77
24
|
collection: true
|
|
78
|
-
|
|
79
|
-
# Publication status of the document.
|
|
80
25
|
attribute :status, IsoDocumentStatus
|
|
81
|
-
|
|
82
|
-
# Copyright information
|
|
83
26
|
attribute :copyright, Metanorma::Document::Relaton::CopyrightAssociation,
|
|
84
27
|
collection: true
|
|
85
|
-
|
|
86
|
-
# Relations to other documents
|
|
87
28
|
attribute :relation, Metanorma::Document::Relaton::DocumentRelation,
|
|
88
29
|
collection: true
|
|
89
|
-
|
|
90
|
-
# Formatted reference
|
|
91
30
|
attribute :formattedref, Metanorma::Document::Components::DataTypes::FormattedString
|
|
92
|
-
|
|
93
|
-
# Dates
|
|
94
31
|
attribute :date, Metanorma::Document::Relaton::BibliographicDate,
|
|
95
32
|
collection: true
|
|
96
|
-
|
|
97
|
-
# Place of publication
|
|
98
33
|
attribute :place, :string, collection: true
|
|
99
|
-
|
|
100
|
-
# Extension point of the bibliographical description.
|
|
101
34
|
attribute :ext, IsoBibDataExtensionType
|
|
102
35
|
attribute :keyword, Metanorma::Document::Relaton::KeywordType,
|
|
103
36
|
collection: true
|
|
@@ -105,8 +38,6 @@ module Metanorma
|
|
|
105
38
|
collection: true
|
|
106
39
|
attribute :editorialgroup, Metanorma::StandardDocument::Metadata::EditorialGroupType
|
|
107
40
|
attribute :semx_id, :string
|
|
108
|
-
|
|
109
|
-
# Schema version (used by collection/entry bibdata, e.g. "v1.2.9").
|
|
110
41
|
attribute :schema_version, :string
|
|
111
42
|
|
|
112
43
|
xml do
|
|
@@ -150,8 +81,6 @@ module Metanorma
|
|
|
150
81
|
map "ext", to: :ext
|
|
151
82
|
end
|
|
152
83
|
|
|
153
|
-
# Returns the title for a given language (defaults to English)
|
|
154
|
-
# Uses consolidation-mapped per_language grouping for efficiency
|
|
155
84
|
def title_for(language = "en")
|
|
156
85
|
return nil unless titles
|
|
157
86
|
|
|
@@ -165,7 +94,6 @@ module Metanorma
|
|
|
165
94
|
end
|
|
166
95
|
end
|
|
167
96
|
|
|
168
|
-
# Primary title (English by default)
|
|
169
97
|
def title
|
|
170
98
|
@title ||= title_for("en")
|
|
171
99
|
end
|
|
@@ -3,41 +3,11 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module IsoDocument
|
|
5
5
|
module Metadata
|
|
6
|
-
# Publication status of an ISO/IEC document.
|
|
7
|
-
# Stage element in presentation XML: <stage abbreviation="..." language="..." type="...">value</stage>
|
|
8
|
-
class StageElement < Lutaml::Model::Serializable
|
|
9
|
-
attribute :abbreviation, :string
|
|
10
|
-
attribute :language, :string
|
|
11
|
-
attribute :type, :string
|
|
12
|
-
attribute :value, :string, collection: true
|
|
13
|
-
attribute :br, Metanorma::Document::Components::Inline::BrElement,
|
|
14
|
-
collection: true
|
|
15
|
-
|
|
16
|
-
xml do
|
|
17
|
-
element "stage"
|
|
18
|
-
mixed_content
|
|
19
|
-
map_attribute "abbreviation", to: :abbreviation
|
|
20
|
-
map_attribute "language", to: :language, render_empty: true
|
|
21
|
-
map_attribute "type", to: :type
|
|
22
|
-
map_content to: :value
|
|
23
|
-
map_element "br", to: :br
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
6
|
class IsoDocumentStatus < Lutaml::Model::Serializable
|
|
28
|
-
# Publication stage of the ISO/IEC document, expressed as an International Harmonized Stage Code.
|
|
29
7
|
attribute :stage, StageElement, collection: true
|
|
30
|
-
|
|
31
|
-
# Standard abbreviation of the publication stage.
|
|
32
8
|
attribute :stage_abbreviation, :string
|
|
33
|
-
|
|
34
|
-
# Substage code for the ISO/IEC document.
|
|
35
9
|
attribute :substage, IsoDocumentSubstageCodes
|
|
36
|
-
|
|
37
|
-
# Standard abbreviation of the publication substage.
|
|
38
10
|
attribute :substage_abbreviation, :string
|
|
39
|
-
|
|
40
|
-
# Number of the iteration of the publication stage that the document is in.
|
|
41
11
|
attribute :iteration, :integer
|
|
42
12
|
attribute :semx_id, :string
|
|
43
13
|
|
|
@@ -32,6 +32,9 @@ module Metanorma
|
|
|
32
32
|
attribute :title_amendment_prefix, AbstractTitle
|
|
33
33
|
attribute :semx_id, :string
|
|
34
34
|
|
|
35
|
+
# Fallback for plain titles without structured parts
|
|
36
|
+
attribute :content, :string
|
|
37
|
+
|
|
35
38
|
# Compose all parts into a single title string
|
|
36
39
|
def to_s
|
|
37
40
|
parts = []
|
|
@@ -50,7 +53,7 @@ module Metanorma
|
|
|
50
53
|
end
|
|
51
54
|
return parts.join(" — ") unless parts.empty?
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
content.to_s
|
|
54
57
|
end
|
|
55
58
|
end
|
|
56
59
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class LanguageElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :current, :string
|
|
8
|
+
attribute :value, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "language"
|
|
12
|
+
map_attribute "current", to: :current
|
|
13
|
+
map_content to: :value
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class ProjectNumber < Lutaml::Model::Serializable
|
|
7
|
+
attribute :part, :string
|
|
8
|
+
attribute :amendment, :string
|
|
9
|
+
attribute :origyr, :string
|
|
10
|
+
attribute :value, :string
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element "project-number"
|
|
14
|
+
map_attribute "part", to: :part
|
|
15
|
+
map_attribute "amendment", to: :amendment
|
|
16
|
+
map_attribute "origyr", to: :origyr
|
|
17
|
+
map_content to: :value
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class ScriptElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :current, :string
|
|
8
|
+
attribute :value, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "script"
|
|
12
|
+
map_attribute "current", to: :current
|
|
13
|
+
map_content to: :value
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class StageElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :abbreviation, :string
|
|
8
|
+
attribute :language, :string
|
|
9
|
+
attribute :type, :string
|
|
10
|
+
attribute :value, :string, collection: true
|
|
11
|
+
attribute :br, Metanorma::Document::Components::Inline::BrElement,
|
|
12
|
+
collection: true
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
element "stage"
|
|
16
|
+
mixed_content
|
|
17
|
+
map_attribute "abbreviation", to: :abbreviation
|
|
18
|
+
map_attribute "language", to: :language, render_empty: true
|
|
19
|
+
map_attribute "type", to: :type
|
|
20
|
+
map_content to: :value
|
|
21
|
+
map_element "br", to: :br
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class StagenameElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :abbreviation, :string
|
|
8
|
+
attribute :value, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "stagename"
|
|
12
|
+
map_attribute "abbreviation", to: :abbreviation
|
|
13
|
+
map_content to: :value
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -3,23 +3,6 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module IsoDocument
|
|
5
5
|
module Metadata
|
|
6
|
-
# Project number with optional part attribute.
|
|
7
|
-
class ProjectNumber < Lutaml::Model::Serializable
|
|
8
|
-
attribute :part, :string
|
|
9
|
-
attribute :amendment, :string
|
|
10
|
-
attribute :origyr, :string
|
|
11
|
-
attribute :value, :string
|
|
12
|
-
|
|
13
|
-
xml do
|
|
14
|
-
element "project-number"
|
|
15
|
-
map_attribute "part", to: :part
|
|
16
|
-
map_attribute "amendment", to: :amendment
|
|
17
|
-
map_attribute "origyr", to: :origyr
|
|
18
|
-
map_content to: :value
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# Structured identifier for an ISO document (project number, part, etc).
|
|
23
6
|
class StructuredIdentifier < Lutaml::Model::Serializable
|
|
24
7
|
attribute :project_number, ProjectNumber
|
|
25
8
|
|
|
@@ -5,6 +5,7 @@ module Metanorma
|
|
|
5
5
|
module Metadata
|
|
6
6
|
autoload :AbstractTitle, "#{__dir__}/metadata/abstract_title"
|
|
7
7
|
autoload :DocIdentifier, "#{__dir__}/metadata/doc_identifier"
|
|
8
|
+
autoload :DoctypeElement, "#{__dir__}/metadata/doctype_element"
|
|
8
9
|
autoload :IecDocumentCategory, "#{__dir__}/metadata/iec_document_category"
|
|
9
10
|
autoload :IsoBibDataExtensionType,
|
|
10
11
|
"#{__dir__}/metadata/iso_bib_data_extension_type"
|
|
@@ -21,6 +22,14 @@ module Metanorma
|
|
|
21
22
|
autoload :TitleCollection, "#{__dir__}/metadata/title_collection"
|
|
22
23
|
autoload :IsoProjectGroup, "#{__dir__}/metadata/iso_project_group"
|
|
23
24
|
autoload :IsoSubGroup, "#{__dir__}/metadata/iso_sub_group"
|
|
25
|
+
autoload :LanguageElement, "#{__dir__}/metadata/language_element"
|
|
26
|
+
autoload :MetanormaExtension, "#{__dir__}/metadata/metanorma_extension"
|
|
27
|
+
autoload :ProjectNumber, "#{__dir__}/metadata/project_number"
|
|
28
|
+
autoload :ScriptElement, "#{__dir__}/metadata/script_element"
|
|
29
|
+
autoload :StagenameElement, "#{__dir__}/metadata/stagename_element"
|
|
30
|
+
autoload :StageElement, "#{__dir__}/metadata/stage_element"
|
|
31
|
+
autoload :StructuredIdentifier,
|
|
32
|
+
"#{__dir__}/metadata/structured_identifier"
|
|
24
33
|
autoload :TitleFull, "#{__dir__}/metadata/title_full"
|
|
25
34
|
autoload :TitleIntro, "#{__dir__}/metadata/title_intro"
|
|
26
35
|
autoload :TitleMain, "#{__dir__}/metadata/title_main"
|
|
@@ -30,10 +39,6 @@ module Metanorma
|
|
|
30
39
|
autoload :TitleAmendmentPrefix,
|
|
31
40
|
"#{__dir__}/metadata/title_amendment_prefix"
|
|
32
41
|
autoload :Ics, "#{__dir__}/metadata/ics"
|
|
33
|
-
autoload :StructuredIdentifier,
|
|
34
|
-
"#{__dir__}/metadata/structured_identifier"
|
|
35
|
-
autoload :ProjectNumber, "#{__dir__}/metadata/structured_identifier"
|
|
36
|
-
autoload :MetanormaExtension, "#{__dir__}/metadata/metanorma_extension"
|
|
37
42
|
end
|
|
38
43
|
end
|
|
39
44
|
end
|
|
@@ -12,12 +12,13 @@ module Metanorma
|
|
|
12
12
|
attribute :type, :string
|
|
13
13
|
attribute :number, :string
|
|
14
14
|
attribute :obligation, :string
|
|
15
|
-
attribute :inline_header, :
|
|
16
|
-
attribute :unnumbered, :
|
|
15
|
+
attribute :inline_header, :boolean
|
|
16
|
+
attribute :unnumbered, :boolean
|
|
17
17
|
attribute :toc, :string
|
|
18
18
|
attribute :class_attr, :string
|
|
19
19
|
attribute :title, Metanorma::Document::Components::Inline::TitleWithAnnotationElement
|
|
20
|
-
attribute :p,
|
|
20
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
21
|
+
collection: true
|
|
21
22
|
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
22
23
|
collection: true
|
|
23
24
|
attribute :term, Metanorma::IsoDocument::Terms::IsoTerm,
|
|
@@ -3,19 +3,6 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module IsoDocument
|
|
5
5
|
module Terms
|
|
6
|
-
# Domain element with id attribute.
|
|
7
|
-
class TermDomainElement < Lutaml::Model::Serializable
|
|
8
|
-
attribute :id, :string
|
|
9
|
-
attribute :text, :string
|
|
10
|
-
|
|
11
|
-
xml do
|
|
12
|
-
element "domain"
|
|
13
|
-
map_attribute "id", to: :id
|
|
14
|
-
map_content to: :text
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Term subclause specific to ISO/IEC documents.
|
|
19
6
|
class IsoTerm < Lutaml::Model::Serializable
|
|
20
7
|
attribute :id, :string
|
|
21
8
|
attribute :anchor, :string
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module IsoDocument
|
|
5
|
+
module Terms
|
|
6
|
+
class TermDomainElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :id, :string
|
|
8
|
+
attribute :text, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "domain"
|
|
12
|
+
map_attribute "id", to: :id
|
|
13
|
+
map_content to: :text
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -8,7 +8,8 @@ module Metanorma
|
|
|
8
8
|
attribute :id, :string
|
|
9
9
|
attribute :semx_id, :string
|
|
10
10
|
attribute :autonum, :string
|
|
11
|
-
attribute :p,
|
|
11
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
12
|
+
collection: true
|
|
12
13
|
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
13
14
|
collection: true
|
|
14
15
|
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
@@ -9,7 +9,8 @@ module Metanorma
|
|
|
9
9
|
attribute :anchor, :string
|
|
10
10
|
attribute :semx_id, :string
|
|
11
11
|
attribute :autonum, :string
|
|
12
|
-
attribute :p,
|
|
12
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
13
|
+
collection: true
|
|
13
14
|
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
14
15
|
collection: true
|
|
15
16
|
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
@@ -7,7 +7,8 @@ module Metanorma
|
|
|
7
7
|
class VerbalDefinition < Lutaml::Model::Serializable
|
|
8
8
|
attribute :id, :string
|
|
9
9
|
attribute :semx_id, :string
|
|
10
|
-
attribute :p,
|
|
10
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
11
|
+
collection: true
|
|
11
12
|
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
12
13
|
collection: true
|
|
13
14
|
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
@@ -7,6 +7,7 @@ module Metanorma
|
|
|
7
7
|
"#{__dir__}/terms/iso_term_collection"
|
|
8
8
|
autoload :IsoTerm, "#{__dir__}/terms/iso_term"
|
|
9
9
|
autoload :TermDesignation, "#{__dir__}/terms/term_designation"
|
|
10
|
+
autoload :TermDomainElement, "#{__dir__}/terms/term_domain_element"
|
|
10
11
|
autoload :TermExpression, "#{__dir__}/terms/term_expression"
|
|
11
12
|
autoload :TermDefinition, "#{__dir__}/terms/term_definition"
|
|
12
13
|
autoload :VerbalDefinition, "#{__dir__}/terms/verbal_definition"
|
|
@@ -6,7 +6,6 @@ module Metanorma
|
|
|
6
6
|
autoload :Blocks, "metanorma/iso_document/blocks"
|
|
7
7
|
autoload :Boilerplate, "metanorma/iso_document/boilerplate"
|
|
8
8
|
autoload :Metadata, "metanorma/iso_document/metadata"
|
|
9
|
-
autoload :RawParagraph, "metanorma/iso_document/raw_paragraph"
|
|
10
9
|
autoload :Root, "metanorma/iso_document/root"
|
|
11
10
|
autoload :Sections, "metanorma/iso_document/sections"
|
|
12
11
|
autoload :Terms, "metanorma/iso_document/terms"
|