metanorma-document 0.5.1 → 0.5.2.pre.alpha.1
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/README.adoc +81 -0
- data/Rakefile +3 -7
- data/data/themes/ogc.yaml +5 -0
- data/lib/metanorma/basic_document/ancillary_blocks/figure_block.rb +2 -2
- data/lib/metanorma/basic_document/multi_paragraph/admonition_block.rb +2 -2
- data/lib/metanorma/document/cli.rb +134 -0
- data/lib/metanorma/document/components/ancillary_blocks/figure_block.rb +5 -0
- data/lib/metanorma/document/components/ancillary_blocks/fmt_figure_element.rb +47 -0
- data/lib/metanorma/document/components/ancillary_blocks/formula_block.rb +2 -0
- data/lib/metanorma/document/components/ancillary_blocks/imagemap_element.rb +73 -0
- data/lib/metanorma/document/components/ancillary_blocks/literal_block.rb +2 -0
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +2 -0
- data/lib/metanorma/document/components/ancillary_blocks/svg_target_element.rb +27 -0
- data/lib/metanorma/document/components/ancillary_blocks/svgmap_element.rb +28 -0
- data/lib/metanorma/document/components/ancillary_blocks.rb +4 -0
- data/lib/metanorma/document/components/bib_data/bibliographic_item.rb +4 -0
- data/lib/metanorma/document/components/blocks/fmt_provision.rb +25 -0
- data/lib/metanorma/document/components/blocks/note_block.rb +8 -0
- data/lib/metanorma/document/components/blocks/permission_model.rb +9 -0
- data/lib/metanorma/document/components/blocks/recommendation_model.rb +9 -0
- data/lib/metanorma/document/components/blocks/requirement_base.rb +12 -0
- data/lib/metanorma/document/components/blocks/requirement_import.rb +23 -0
- data/lib/metanorma/document/components/blocks/requirement_measurement_target.rb +23 -0
- data/lib/metanorma/document/components/blocks/requirement_model.rb +9 -0
- data/lib/metanorma/document/components/blocks/requirement_specification.rb +23 -0
- data/lib/metanorma/document/components/blocks/requirement_verification.rb +23 -0
- data/lib/metanorma/document/components/blocks.rb +8 -0
- data/lib/metanorma/document/components/data_types/formatted_string.rb +9 -0
- data/lib/metanorma/document/components/id_elements/image.rb +4 -0
- data/lib/metanorma/document/components/inline/columnbreak_element.rb +17 -0
- data/lib/metanorma/document/components/inline/concept_element.rb +18 -0
- data/lib/metanorma/document/components/inline/date_element.rb +29 -0
- data/lib/metanorma/document/components/inline/display_text_element.rb +2 -0
- data/lib/metanorma/document/components/inline/em_raw_element.rb +6 -7
- data/lib/metanorma/document/components/inline/eref_element.rb +48 -22
- data/lib/metanorma/document/components/inline/eref_stack.rb +23 -0
- data/lib/metanorma/document/components/inline/error_message.rb +28 -0
- data/lib/metanorma/document/components/inline/fmt_date_element.rb +28 -0
- data/lib/metanorma/document/components/inline/fmt_date_inline_element.rb +26 -0
- data/lib/metanorma/document/components/inline/fmt_eref_element.rb +25 -0
- data/lib/metanorma/document/components/inline/fmt_origin_element.rb +24 -0
- data/lib/metanorma/document/components/inline/fmt_preferred_element.rb +3 -0
- data/lib/metanorma/document/components/inline/fmt_source_element.rb +31 -0
- data/lib/metanorma/document/components/inline/fn_element.rb +11 -0
- data/lib/metanorma/document/components/inline/link_element.rb +8 -0
- data/lib/metanorma/document/components/inline/name_with_id_element.rb +2 -0
- data/lib/metanorma/document/components/inline/refterm_element.rb +21 -0
- data/lib/metanorma/document/components/inline/semx_element.rb +22 -0
- data/lib/metanorma/document/components/inline/sourcelocality_stack_element.rb +27 -0
- data/lib/metanorma/document/components/inline/span_element.rb +2 -0
- data/lib/metanorma/document/components/inline/stem_inline_element.rb +2 -0
- data/lib/metanorma/document/components/inline/strong_raw_element.rb +6 -9
- data/lib/metanorma/document/components/inline/sub_element.rb +2 -0
- data/lib/metanorma/document/components/inline/termref_element.rb +24 -0
- data/lib/metanorma/document/components/inline/title_with_annotation_element.rb +10 -31
- data/lib/metanorma/document/components/inline/variant_title_element.rb +2 -0
- data/lib/metanorma/document/components/inline/vocabulary.rb +36 -0
- data/lib/metanorma/document/components/inline.rb +23 -0
- data/lib/metanorma/document/components/lists/dd_element.rb +6 -1
- data/lib/metanorma/document/components/lists/definition.rb +2 -0
- data/lib/metanorma/document/components/lists/definition_list.rb +3 -0
- data/lib/metanorma/document/components/lists/dt_element.rb +3 -0
- data/lib/metanorma/document/components/lists/fmt_list_element.rb +73 -0
- data/lib/metanorma/document/components/lists/list_item.rb +3 -0
- data/lib/metanorma/document/components/lists/ordered_list.rb +4 -2
- data/lib/metanorma/document/components/lists/unordered_list.rb +2 -0
- data/lib/metanorma/document/components/lists.rb +2 -0
- data/lib/metanorma/document/components/multi_paragraph/quote_block.rb +16 -0
- data/lib/metanorma/document/components/multi_paragraph/review_block.rb +2 -2
- data/lib/metanorma/document/components/paragraphs/paragraph_block.rb +15 -0
- data/lib/metanorma/document/components/reference_elements/citation.rb +7 -0
- data/lib/metanorma/document/components/reference_elements/source_element.rb +4 -0
- data/lib/metanorma/document/components/semantic/node.rb +46 -0
- data/lib/metanorma/document/components/semantic.rb +11 -0
- data/lib/metanorma/document/components/tables/header_table_cell.rb +1 -0
- data/lib/metanorma/document/components/tables/table_cell.rb +70 -44
- data/lib/metanorma/document/components/tables/text_table_cell.rb +1 -0
- data/lib/metanorma/document/components/tables/text_table_row.rb +2 -0
- data/lib/metanorma/document/components/text_elements/ruby_annotation_element.rb +26 -0
- data/lib/metanorma/document/components/text_elements/ruby_element.rb +41 -6
- data/lib/metanorma/document/components/text_elements/ruby_pronunciation_element.rb +25 -0
- data/lib/metanorma/document/components/text_elements/strike_element.rb +3 -0
- data/lib/metanorma/document/components/text_elements/underline_element.rb +3 -0
- data/lib/metanorma/document/components/text_elements.rb +2 -0
- data/lib/metanorma/document/components.rb +1 -0
- data/lib/metanorma/document/grammar_vocabulary.rb +109 -0
- data/lib/metanorma/document/mirror_seed.rb +253 -0
- data/lib/metanorma/document/mko/collection.rb +168 -0
- data/lib/metanorma/document/mko/exporter.rb +17 -0
- data/lib/metanorma/document/mko/project.rb +1110 -0
- data/lib/metanorma/document/mko.rb +122 -0
- data/lib/metanorma/document/model_access.rb +44 -0
- data/lib/metanorma/document/native_models.rb +319 -0
- data/lib/metanorma/document/plain_text.rb +39 -0
- data/lib/metanorma/document/relaton/version_info.rb +4 -0
- data/lib/metanorma/document/version.rb +1 -1
- data/lib/metanorma/document.rb +19 -26
- data/lib/metanorma/{collection → document_collection}/directive.rb +1 -1
- data/lib/metanorma/{collection → document_collection}/doc_container.rb +6 -2
- data/lib/metanorma/{collection → document_collection}/entry.rb +2 -2
- data/lib/metanorma/{collection → document_collection}/root.rb +2 -2
- data/lib/metanorma/document_collection.rb +10 -0
- data/lib/metanorma/html/base_renderer.rb +94 -25
- data/lib/metanorma/html/component/footnote_collector.rb +21 -20
- data/lib/metanorma/html/concerns/metadata_extraction.rb +8 -3
- data/lib/metanorma/html/concerns/presentation_validation.rb +1 -2
- data/lib/metanorma/html/concerns/text_extraction.rb +154 -35
- data/lib/metanorma/html/concerns.rb +19 -0
- data/lib/metanorma/html/drops/admonition_drop.rb +1 -1
- data/lib/metanorma/html/drops/footnote_drop.rb +1 -1
- data/lib/metanorma/html/drops/sourcecode_drop.rb +22 -4
- data/lib/metanorma/html/generator.rb +11 -187
- data/lib/metanorma/html/renderer_delegation.rb +2 -2
- data/lib/metanorma/html/renderers/block_renderer.rb +206 -46
- data/lib/metanorma/html/renderers/inline_renderer.rb +144 -17
- data/lib/metanorma/html/renderers/section_renderer.rb +12 -2
- data/lib/metanorma/html/renderers/semantic_renderer.rb +487 -0
- data/lib/metanorma/html/renderers.rb +2 -0
- data/lib/metanorma/html/standard_renderer.rb +732 -76
- data/lib/metanorma/html/templates/_agency_cover.html.liquid +30 -0
- data/lib/metanorma/html/templates/_columnbreak.html.liquid +1 -0
- data/lib/metanorma/html/templates/_cover.html.liquid +3 -0
- data/lib/metanorma/html/templates/_main_content.html.liquid +1 -1
- data/lib/metanorma/html/templates/_ruby.html.liquid +1 -0
- data/lib/metanorma/html/templates/_sourcecode.html.liquid +4 -3
- data/lib/metanorma/html/templates/_standard_cover.html.liquid +54 -3
- data/lib/metanorma/html.rb +30 -15
- data/tasks/flavors.rake +116 -0
- data/tasks/grammar.rake +28 -0
- data/tasks/roundtrip_samples.rake +48 -34
- metadata +121 -416
- data/frontend/dist/app.css +0 -1
- data/frontend/dist/app.iife.js +0 -24
- data/lib/metanorma/bipm_document/metadata/bipm_bib_data_extension_type.rb +0 -20
- data/lib/metanorma/bipm_document/metadata/bipm_bibliographic_item.rb +0 -17
- data/lib/metanorma/bipm_document/metadata/bipm_structured_identifier.rb +0 -21
- data/lib/metanorma/bipm_document/metadata/depiction_element.rb +0 -18
- data/lib/metanorma/bipm_document/metadata.rb +0 -15
- data/lib/metanorma/bipm_document/root.rb +0 -25
- data/lib/metanorma/bipm_document.rb +0 -8
- data/lib/metanorma/bsi_document/metadata/bsi_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/bsi_document/metadata/bsi_bibliographic_item.rb +0 -15
- data/lib/metanorma/bsi_document/metadata.rb +0 -12
- data/lib/metanorma/bsi_document/root.rb +0 -29
- data/lib/metanorma/bsi_document/sections/bsi_annex_section.rb +0 -25
- data/lib/metanorma/bsi_document/sections/bsi_clause_section.rb +0 -25
- data/lib/metanorma/bsi_document/sections/bsi_sections.rb +0 -27
- data/lib/metanorma/bsi_document/sections.rb +0 -11
- data/lib/metanorma/bsi_document.rb +0 -11
- data/lib/metanorma/cc_document/metadata/cc_bib_data_extension_type.rb +0 -12
- data/lib/metanorma/cc_document/metadata/cc_bibliographic_item.rb +0 -17
- data/lib/metanorma/cc_document/metadata.rb +0 -11
- data/lib/metanorma/cc_document/root.rb +0 -25
- data/lib/metanorma/cc_document.rb +0 -8
- data/lib/metanorma/collection.rb +0 -10
- data/lib/metanorma/csa_document/root.rb +0 -27
- data/lib/metanorma/csa_document.rb +0 -9
- data/lib/metanorma/gb_document/metadata/gb_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/gb_document/metadata/gb_bibliographic_item.rb +0 -15
- data/lib/metanorma/gb_document/metadata.rb +0 -12
- data/lib/metanorma/gb_document/root.rb +0 -29
- data/lib/metanorma/gb_document.rb +0 -10
- data/lib/metanorma/generic_document/root.rb +0 -31
- data/lib/metanorma/generic_document.rb +0 -7
- data/lib/metanorma/html/bipm_renderer.rb +0 -23
- data/lib/metanorma/html/cc_renderer.rb +0 -9
- data/lib/metanorma/html/csa_renderer.rb +0 -9
- data/lib/metanorma/html/flavor.rb +0 -50
- data/lib/metanorma/html/flavor_registry.rb +0 -49
- data/lib/metanorma/html/icc_renderer.rb +0 -10
- data/lib/metanorma/html/iec_renderer.rb +0 -9
- data/lib/metanorma/html/ieee_renderer.rb +0 -9
- data/lib/metanorma/html/ietf_renderer.rb +0 -9
- data/lib/metanorma/html/iho_renderer.rb +0 -9
- data/lib/metanorma/html/iso_renderer.rb +0 -535
- data/lib/metanorma/html/itu_renderer.rb +0 -9
- data/lib/metanorma/html/ogc_renderer.rb +0 -23
- data/lib/metanorma/html/pdfa_renderer.rb +0 -10
- data/lib/metanorma/html/ribose_renderer.rb +0 -9
- data/lib/metanorma/html/templates/_bipm_cover.html.liquid +0 -27
- data/lib/metanorma/html/templates/_iso_cover.html.liquid +0 -31
- data/lib/metanorma/html/templates/_iso_doc_title.html.liquid +0 -3
- data/lib/metanorma/iec_document/root.rb +0 -27
- data/lib/metanorma/iec_document.rb +0 -9
- data/lib/metanorma/ieee_document/metadata/ieee_bib_data_extension_type.rb +0 -18
- data/lib/metanorma/ieee_document/metadata/ieee_bibliographic_item.rb +0 -20
- data/lib/metanorma/ieee_document/metadata/ieee_structured_identifier.rb +0 -25
- data/lib/metanorma/ieee_document/metadata.rb +0 -14
- data/lib/metanorma/ieee_document/root.rb +0 -29
- data/lib/metanorma/ieee_document/sections/ieee_sections.rb +0 -31
- data/lib/metanorma/ieee_document/sections.rb +0 -9
- data/lib/metanorma/ieee_document.rb +0 -11
- data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +0 -31
- data/lib/metanorma/ietf_document/metadata/ietf_bibliographic_item.rb +0 -51
- data/lib/metanorma/ietf_document/metadata/ietf_editorial_group.rb +0 -17
- data/lib/metanorma/ietf_document/metadata/pi_settings.rb +0 -32
- data/lib/metanorma/ietf_document/metadata.rb +0 -16
- data/lib/metanorma/ietf_document/root.rb +0 -30
- data/lib/metanorma/ietf_document/sections/ietf_annex_section.rb +0 -26
- data/lib/metanorma/ietf_document/sections/ietf_clause_section.rb +0 -26
- data/lib/metanorma/ietf_document/sections/ietf_content_section.rb +0 -25
- data/lib/metanorma/ietf_document/sections/ietf_sections.rb +0 -35
- data/lib/metanorma/ietf_document/sections.rb +0 -12
- data/lib/metanorma/ietf_document.rb +0 -11
- data/lib/metanorma/iho_document/metadata/iho_bib_data_extension_type.rb +0 -23
- data/lib/metanorma/iho_document/metadata/iho_bibliographic_item.rb +0 -20
- data/lib/metanorma/iho_document/metadata/iho_editorial_group.rb +0 -19
- data/lib/metanorma/iho_document/metadata/iho_series.rb +0 -22
- data/lib/metanorma/iho_document/metadata/iho_sub_group.rb +0 -18
- data/lib/metanorma/iho_document/metadata.rb +0 -15
- data/lib/metanorma/iho_document/root.rb +0 -25
- data/lib/metanorma/iho_document.rb +0 -8
- data/lib/metanorma/iso_document/annotation_container.rb +0 -7
- data/lib/metanorma/iso_document/blocks/iso_admonition_block.rb +0 -27
- data/lib/metanorma/iso_document/blocks/iso_admonition_type.rb +0 -25
- data/lib/metanorma/iso_document/blocks.rb +0 -12
- data/lib/metanorma/iso_document/boilerplate.rb +0 -7
- data/lib/metanorma/iso_document/metadata/abstract_title.rb +0 -36
- data/lib/metanorma/iso_document/metadata/doc_identifier.rb +0 -26
- data/lib/metanorma/iso_document/metadata/doctype_element.rb +0 -20
- data/lib/metanorma/iso_document/metadata/ics.rb +0 -19
- data/lib/metanorma/iso_document/metadata/iec_document_category.rb +0 -23
- data/lib/metanorma/iso_document/metadata/iso_bib_data_extension_type.rb +0 -38
- data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +0 -103
- data/lib/metanorma/iso_document/metadata/iso_document_id.rb +0 -46
- data/lib/metanorma/iso_document/metadata/iso_document_stage_codes.rb +0 -26
- data/lib/metanorma/iso_document/metadata/iso_document_status.rb +0 -26
- data/lib/metanorma/iso_document/metadata/iso_document_substage_codes.rb +0 -26
- data/lib/metanorma/iso_document/metadata/iso_document_type.rb +0 -25
- data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +0 -61
- data/lib/metanorma/iso_document/metadata/iso_project_group.rb +0 -32
- data/lib/metanorma/iso_document/metadata/iso_sub_group.rb +0 -38
- data/lib/metanorma/iso_document/metadata/language_element.rb +0 -18
- data/lib/metanorma/iso_document/metadata/metanorma_extension.rb +0 -9
- 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/metadata/structured_identifier.rb +0 -16
- data/lib/metanorma/iso_document/metadata/title_amd.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_amendment_prefix.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_collection.rb +0 -47
- data/lib/metanorma/iso_document/metadata/title_full.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_intro.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_main.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_part.rb +0 -12
- data/lib/metanorma/iso_document/metadata/title_part_prefix.rb +0 -12
- data/lib/metanorma/iso_document/metadata.rb +0 -44
- data/lib/metanorma/iso_document/root.rb +0 -26
- data/lib/metanorma/iso_document/sections/colophon.rb +0 -3
- data/lib/metanorma/iso_document/sections/iso_abstract_section.rb +0 -15
- data/lib/metanorma/iso_document/sections/iso_amendment_clause.rb +0 -24
- data/lib/metanorma/iso_document/sections/iso_annex_section.rb +0 -50
- data/lib/metanorma/iso_document/sections/iso_clause_section.rb +0 -49
- data/lib/metanorma/iso_document/sections/iso_foreword_section.rb +0 -33
- data/lib/metanorma/iso_document/sections/iso_preface.rb +0 -51
- data/lib/metanorma/iso_document/sections/iso_sections.rb +0 -51
- data/lib/metanorma/iso_document/sections/iso_terms_section.rb +0 -76
- data/lib/metanorma/iso_document/sections.rb +0 -17
- data/lib/metanorma/iso_document/terms/iso_term.rb +0 -71
- data/lib/metanorma/iso_document/terms/iso_term_collection.rb +0 -20
- data/lib/metanorma/iso_document/terms/term_definition.rb +0 -30
- data/lib/metanorma/iso_document/terms/term_designation.rb +0 -44
- data/lib/metanorma/iso_document/terms/term_domain_element.rb +0 -18
- data/lib/metanorma/iso_document/terms/term_example.rb +0 -40
- data/lib/metanorma/iso_document/terms/term_expression.rb +0 -10
- data/lib/metanorma/iso_document/terms/term_note.rb +0 -42
- data/lib/metanorma/iso_document/terms/term_origin.rb +0 -4
- data/lib/metanorma/iso_document/terms/term_source.rb +0 -21
- data/lib/metanorma/iso_document/terms/verbal_definition.rb +0 -42
- data/lib/metanorma/iso_document/terms.rb +0 -21
- data/lib/metanorma/iso_document.rb +0 -15
- data/lib/metanorma/itu_document/metadata/itu_bib_data_extension_type.rb +0 -26
- data/lib/metanorma/itu_document/metadata/itu_bibliographic_item.rb +0 -21
- data/lib/metanorma/itu_document/metadata/itu_series.rb +0 -22
- data/lib/metanorma/itu_document/metadata/itu_structured_identifier.rb +0 -23
- 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/itu_document/metadata.rb +0 -18
- data/lib/metanorma/itu_document/root.rb +0 -25
- data/lib/metanorma/itu_document.rb +0 -8
- data/lib/metanorma/jis_document/metadata/jis_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/jis_document/metadata/jis_bibliographic_item.rb +0 -15
- data/lib/metanorma/jis_document/metadata.rb +0 -12
- data/lib/metanorma/jis_document/root.rb +0 -29
- data/lib/metanorma/jis_document/sections/jis_annex_section.rb +0 -20
- data/lib/metanorma/jis_document/sections.rb +0 -9
- data/lib/metanorma/jis_document.rb +0 -11
- data/lib/metanorma/m3d_document/metadata/m3d_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/m3d_document/metadata/m3d_bibliographic_item.rb +0 -15
- data/lib/metanorma/m3d_document/metadata.rb +0 -12
- data/lib/metanorma/m3d_document/root.rb +0 -29
- data/lib/metanorma/m3d_document.rb +0 -10
- data/lib/metanorma/mirror/default_registry.rb +0 -191
- 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/catalog.rb +0 -52
- data/lib/metanorma/mirror/handlers/inline/rich_html_renderer.rb +0 -158
- data/lib/metanorma/mirror/handlers/inline/text_extractor.rb +0 -116
- data/lib/metanorma/mirror/handlers/inline.rb +0 -226
- 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/model/container.rb +0 -47
- data/lib/metanorma/mirror/model/factory.rb +0 -52
- data/lib/metanorma/mirror/model/guide.rb +0 -26
- 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 -142
- data/lib/metanorma/mirror/output/formats.rb +0 -53
- data/lib/metanorma/mirror/output/pipeline.rb +0 -93
- data/lib/metanorma/mirror/output/pipeline_context.rb +0 -22
- data/lib/metanorma/mirror/output.rb +0 -12
- data/lib/metanorma/mirror/rewriter.rb +0 -123
- 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 -110
- data/lib/metanorma/mirror.rb +0 -31
- data/lib/metanorma/nist_document/metadata/nist_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/nist_document/metadata/nist_bibliographic_item.rb +0 -15
- data/lib/metanorma/nist_document/metadata.rb +0 -12
- data/lib/metanorma/nist_document/root.rb +0 -29
- data/lib/metanorma/nist_document/sections/errata.rb +0 -16
- data/lib/metanorma/nist_document/sections/errata_clause.rb +0 -20
- data/lib/metanorma/nist_document/sections/errata_row.rb +0 -22
- data/lib/metanorma/nist_document/sections/nist_preface.rb +0 -30
- data/lib/metanorma/nist_document/sections.rb +0 -12
- data/lib/metanorma/nist_document.rb +0 -11
- data/lib/metanorma/ogc_document/metadata/ogc_bib_data_extension_type.rb +0 -12
- data/lib/metanorma/ogc_document/metadata/ogc_bibliographic_item.rb +0 -19
- data/lib/metanorma/ogc_document/metadata.rb +0 -12
- data/lib/metanorma/ogc_document/root.rb +0 -25
- data/lib/metanorma/ogc_document.rb +0 -8
- data/lib/metanorma/plateau_document/metadata/plateau_bibliographic_item.rb +0 -13
- data/lib/metanorma/plateau_document/metadata.rb +0 -10
- data/lib/metanorma/plateau_document/root.rb +0 -29
- data/lib/metanorma/plateau_document.rb +0 -10
- data/lib/metanorma/registers/setup.rb +0 -166
- data/lib/metanorma/registers.rb +0 -7
- data/lib/metanorma/ribose_document/metadata/ribose_bib_data_extension_type.rb +0 -20
- data/lib/metanorma/ribose_document/metadata/ribose_bibliographic_item.rb +0 -18
- data/lib/metanorma/ribose_document/metadata.rb +0 -12
- data/lib/metanorma/ribose_document/root.rb +0 -26
- data/lib/metanorma/ribose_document.rb +0 -8
- data/lib/metanorma/standard_document/annotation_container.rb +0 -39
- data/lib/metanorma/standard_document/block_attributes.rb +0 -281
- data/lib/metanorma/standard_document/blocks/amend_block.rb +0 -50
- data/lib/metanorma/standard_document/blocks/amend_content_block.rb +0 -35
- data/lib/metanorma/standard_document/blocks/auto_number.rb +0 -20
- data/lib/metanorma/standard_document/blocks/block_source.rb +0 -22
- data/lib/metanorma/standard_document/blocks/change_type.rb +0 -21
- data/lib/metanorma/standard_document/blocks/element_name.rb +0 -22
- data/lib/metanorma/standard_document/blocks/form.rb +0 -38
- data/lib/metanorma/standard_document/blocks/image_map_area_type.rb +0 -24
- data/lib/metanorma/standard_document/blocks/image_map_area_type_type.rb +0 -21
- data/lib/metanorma/standard_document/blocks/image_map_block.rb +0 -32
- data/lib/metanorma/standard_document/blocks/image_map_coords.rb +0 -19
- data/lib/metanorma/standard_document/blocks/image_map_radius.rb +0 -19
- data/lib/metanorma/standard_document/blocks/multilingual_rendering_type.rb +0 -21
- data/lib/metanorma/standard_document/blocks/passthrough.rb +0 -3
- data/lib/metanorma/standard_document/blocks/requirement_model.rb +0 -20
- data/lib/metanorma/standard_document/blocks/source_origin_element.rb +0 -23
- data/lib/metanorma/standard_document/blocks/standard_admonition_block.rb +0 -32
- data/lib/metanorma/standard_document/blocks/standard_block.rb +0 -28
- data/lib/metanorma/standard_document/blocks/standard_block_no_notes.rb +0 -34
- data/lib/metanorma/standard_document/blocks/standard_example_block.rb +0 -30
- data/lib/metanorma/standard_document/blocks/standard_figure_block.rb +0 -32
- data/lib/metanorma/standard_document/blocks/standard_formula_block.rb +0 -30
- data/lib/metanorma/standard_document/blocks/standard_note_block.rb +0 -64
- data/lib/metanorma/standard_document/blocks/standard_paragraph_block.rb +0 -25
- data/lib/metanorma/standard_document/blocks/standard_quote_block.rb +0 -29
- data/lib/metanorma/standard_document/blocks/standard_sourcecode_block.rb +0 -32
- data/lib/metanorma/standard_document/blocks/standard_table_block.rb +0 -39
- data/lib/metanorma/standard_document/blocks/svg_map_block.rb +0 -23
- data/lib/metanorma/standard_document/blocks/svg_target_type.rb +0 -20
- data/lib/metanorma/standard_document/blocks/table_col.rb +0 -16
- data/lib/metanorma/standard_document/blocks/to_c.rb +0 -17
- data/lib/metanorma/standard_document/blocks.rb +0 -60
- data/lib/metanorma/standard_document/boilerplate.rb +0 -32
- data/lib/metanorma/standard_document/elements/add.rb +0 -3
- data/lib/metanorma/standard_document/elements/del.rb +0 -3
- data/lib/metanorma/standard_document/elements/form_input.rb +0 -27
- data/lib/metanorma/standard_document/elements/input.rb +0 -12
- data/lib/metanorma/standard_document/elements/input_type.rb +0 -27
- data/lib/metanorma/standard_document/elements/label.rb +0 -19
- data/lib/metanorma/standard_document/elements/option.rb +0 -27
- data/lib/metanorma/standard_document/elements/orientation_type.rb +0 -27
- data/lib/metanorma/standard_document/elements/select.rb +0 -32
- data/lib/metanorma/standard_document/elements/standard_page_break_element.rb +0 -22
- data/lib/metanorma/standard_document/elements/textarea.rb +0 -25
- data/lib/metanorma/standard_document/elements.rb +0 -20
- data/lib/metanorma/standard_document/lists/standard_definition.rb +0 -24
- data/lib/metanorma/standard_document/lists/standard_definition_list.rb +0 -30
- data/lib/metanorma/standard_document/lists/standard_definition_term.rb +0 -27
- data/lib/metanorma/standard_document/lists/standard_unordered_list.rb +0 -28
- data/lib/metanorma/standard_document/lists/unordered_checkable_list_item.rb +0 -26
- data/lib/metanorma/standard_document/lists.rb +0 -17
- data/lib/metanorma/standard_document/metadata/editorial_group_type.rb +0 -25
- data/lib/metanorma/standard_document/metadata/ics_type.rb +0 -26
- data/lib/metanorma/standard_document/metadata/metanorma_extension.rb +0 -26
- data/lib/metanorma/standard_document/metadata/presentation_metadata.rb +0 -107
- data/lib/metanorma/standard_document/metadata/semantic_metadata.rb +0 -18
- data/lib/metanorma/standard_document/metadata/standard_bib_data.rb +0 -25
- data/lib/metanorma/standard_document/metadata/standard_bib_data_extension_type.rb +0 -37
- data/lib/metanorma/standard_document/metadata/structured_identifier_type.rb +0 -48
- data/lib/metanorma/standard_document/metadata/technical_committee_type.rb +0 -27
- data/lib/metanorma/standard_document/metadata/unitsml/amount_of_substance.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/base_quantity.rb +0 -34
- data/lib/metanorma/standard_document/metadata/unitsml/dimension.rb +0 -39
- data/lib/metanorma/standard_document/metadata/unitsml/dimension_set.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/electric_current.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/enumerated_root_unit.rb +0 -23
- data/lib/metanorma/standard_document/metadata/unitsml/length.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/luminous_intensity.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/mass.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/namespace.rb +0 -17
- data/lib/metanorma/standard_document/metadata/unitsml/plane_angle.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/prefix.rb +0 -30
- data/lib/metanorma/standard_document/metadata/unitsml/prefix_name.rb +0 -21
- data/lib/metanorma/standard_document/metadata/unitsml/prefix_set.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/prefix_symbol.rb +0 -21
- data/lib/metanorma/standard_document/metadata/unitsml/quantity.rb +0 -28
- data/lib/metanorma/standard_document/metadata/unitsml/quantity_name.rb +0 -21
- data/lib/metanorma/standard_document/metadata/unitsml/quantity_set.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/root_units.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/thermodynamic_temperature.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/time.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/unit.rb +0 -32
- data/lib/metanorma/standard_document/metadata/unitsml/unit_name.rb +0 -21
- data/lib/metanorma/standard_document/metadata/unitsml/unit_set.rb +0 -19
- data/lib/metanorma/standard_document/metadata/unitsml/unit_symbol.rb +0 -36
- data/lib/metanorma/standard_document/metadata/unitsml/unit_system.rb +0 -23
- data/lib/metanorma/standard_document/metadata/unitsml/unitsml_root.rb +0 -28
- data/lib/metanorma/standard_document/metadata/unitsml.rb +0 -39
- data/lib/metanorma/standard_document/metadata.rb +0 -23
- data/lib/metanorma/standard_document/namespace.rb +0 -11
- data/lib/metanorma/standard_document/refs/reference_to_term.rb +0 -26
- data/lib/metanorma/standard_document/refs/reference_to_termbase.rb +0 -27
- data/lib/metanorma/standard_document/refs/standoc_locality_stack.rb +0 -24
- data/lib/metanorma/standard_document/refs/standoc_reference_to_citation_element.rb +0 -27
- data/lib/metanorma/standard_document/refs/standoc_reference_to_id_element.rb +0 -36
- data/lib/metanorma/standard_document/refs/xref_case_type.rb +0 -27
- data/lib/metanorma/standard_document/refs/xref_connective_type.rb +0 -27
- data/lib/metanorma/standard_document/refs/xref_target_type.rb +0 -25
- data/lib/metanorma/standard_document/refs.rb +0 -18
- data/lib/metanorma/standard_document/root.rb +0 -10
- data/lib/metanorma/standard_document/root_attributes.rb +0 -78
- data/lib/metanorma/standard_document/sections/abstract.rb +0 -19
- data/lib/metanorma/standard_document/sections/acknowledgements.rb +0 -19
- data/lib/metanorma/standard_document/sections/annex_section.rb +0 -69
- data/lib/metanorma/standard_document/sections/bibliography_section.rb +0 -20
- data/lib/metanorma/standard_document/sections/boilerplate_type.rb +0 -32
- data/lib/metanorma/standard_document/sections/clause_hierarchical_section.rb +0 -32
- data/lib/metanorma/standard_document/sections/clause_section.rb +0 -91
- data/lib/metanorma/standard_document/sections/colophon.rb +0 -16
- data/lib/metanorma/standard_document/sections/definition_section.rb +0 -72
- data/lib/metanorma/standard_document/sections/floating_section_title.rb +0 -23
- data/lib/metanorma/standard_document/sections/floating_title.rb +0 -27
- data/lib/metanorma/standard_document/sections/foreword.rb +0 -19
- data/lib/metanorma/standard_document/sections/introduction.rb +0 -20
- data/lib/metanorma/standard_document/sections/misc_container.rb +0 -31
- data/lib/metanorma/standard_document/sections/normative_type.rb +0 -29
- data/lib/metanorma/standard_document/sections/preface.rb +0 -36
- data/lib/metanorma/standard_document/sections/sections.rb +0 -47
- data/lib/metanorma/standard_document/sections/standard_content_section.rb +0 -41
- data/lib/metanorma/standard_document/sections/standard_hierarchical_section.rb +0 -30
- data/lib/metanorma/standard_document/sections/standard_references_section.rb +0 -74
- data/lib/metanorma/standard_document/sections/standard_section.rb +0 -39
- data/lib/metanorma/standard_document/sections/terms_section.rb +0 -61
- data/lib/metanorma/standard_document/sections.rb +0 -34
- data/lib/metanorma/standard_document/standard_document_type.rb +0 -15
- data/lib/metanorma/standard_document/terms/abbreviation_type.rb +0 -27
- data/lib/metanorma/standard_document/terms/concept.rb +0 -42
- data/lib/metanorma/standard_document/terms/definition_collection.rb +0 -24
- data/lib/metanorma/standard_document/terms/designation.rb +0 -31
- data/lib/metanorma/standard_document/terms/expression_designation.rb +0 -38
- data/lib/metanorma/standard_document/terms/expression_type.rb +0 -27
- data/lib/metanorma/standard_document/terms/grammar_gender.rb +0 -27
- data/lib/metanorma/standard_document/terms/grammar_info.rb +0 -36
- data/lib/metanorma/standard_document/terms/graphical_symbol_designation.rb +0 -25
- data/lib/metanorma/standard_document/terms/letter_symbol_designation.rb +0 -27
- data/lib/metanorma/standard_document/terms/non_verbal_representation.rb +0 -33
- data/lib/metanorma/standard_document/terms/related_term.rb +0 -31
- data/lib/metanorma/standard_document/terms/related_term_type.rb +0 -28
- data/lib/metanorma/standard_document/terms/term.rb +0 -66
- data/lib/metanorma/standard_document/terms/term_collection.rb +0 -24
- data/lib/metanorma/standard_document/terms/term_definition.rb +0 -29
- data/lib/metanorma/standard_document/terms/term_expression.rb +0 -20
- data/lib/metanorma/standard_document/terms/term_name_element.rb +0 -29
- data/lib/metanorma/standard_document/terms/term_source.rb +0 -29
- data/lib/metanorma/standard_document/terms/term_source_status.rb +0 -29
- data/lib/metanorma/standard_document/terms/term_source_type.rb +0 -21
- data/lib/metanorma/standard_document/terms/verbal_expression.rb +0 -35
- data/lib/metanorma/standard_document/terms.rb +0 -33
- data/lib/metanorma/standard_document.rb +0 -27
- data/lib/metanorma/un_document/blocks/un_admonition_block.rb +0 -86
- data/lib/metanorma/un_document/blocks.rb +0 -9
- data/lib/metanorma/un_document/metadata/un_bib_data_extension_type.rb +0 -10
- data/lib/metanorma/un_document/metadata/un_bibliographic_item.rb +0 -15
- data/lib/metanorma/un_document/metadata.rb +0 -12
- data/lib/metanorma/un_document/root.rb +0 -37
- data/lib/metanorma/un_document/sections/un_abstract_section.rb +0 -48
- data/lib/metanorma/un_document/sections/un_preface.rb +0 -40
- data/lib/metanorma/un_document/sections/un_sections.rb +0 -24
- data/lib/metanorma/un_document/sections.rb +0 -11
- data/lib/metanorma/un_document/un_text_element.rb +0 -116
- data/lib/metanorma/un_document.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1061de30d6a7a96ae887b65148f640cc87bf1fd6f56ba02b2aba6c40c2c5dc8
|
|
4
|
+
data.tar.gz: 6453bebc29bc6d4d868893dd29b97b05fd994cf1b11e871a1a5f43548e73a40f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ead74957bf07e7f4eb5fd953f5d2e88df1b19e32131fd79204cbef869c9ee6dab1b7f3aadc623329e927033f713c7acad7a74d927f1c92b4e4db95f2ee387b33
|
|
7
|
+
data.tar.gz: 9ab9972291ae08de7dc279e1dcaabba877363081ba34d09a32797b500197750514f723773c849d70f54b29621b5cfd0db01d0471395acf6de982c8c9b729f3ad
|
data/README.adoc
CHANGED
|
@@ -354,6 +354,87 @@ metanorma-document to-mirror document.presentation.xml \
|
|
|
354
354
|
--id-strategy positional \
|
|
355
355
|
--title "My Document"
|
|
356
356
|
|
|
357
|
+
== Native object-model decomposition
|
|
358
|
+
|
|
359
|
+
`Metanorma::Document::NativeModels` decomposes a typed document model
|
|
360
|
+
into the native object models of the Metanorma ecosystem — the owning
|
|
361
|
+
gems' own classes and serializations, never re-flattened into a parallel
|
|
362
|
+
schema:
|
|
363
|
+
|
|
364
|
+
[source,ruby]
|
|
365
|
+
require "metanorma/document"
|
|
366
|
+
|
|
367
|
+
model = Metanorma::Iso::Document::Root.from_xml(xml)
|
|
368
|
+
|
|
369
|
+
Metanorma::Document::NativeModels.glossarist_concepts(model)
|
|
370
|
+
# => [Glossarist::Concept] — term entries as native concepts (to_json)
|
|
371
|
+
|
|
372
|
+
Metanorma::Document::NativeModels.relaton_bibdata(model)
|
|
373
|
+
# => Relaton::Bib::ItemData — the bibliographic record as native Relaton
|
|
374
|
+
|
|
375
|
+
Metanorma::Document::NativeModels.relaton_bibliography(model)
|
|
376
|
+
# => [BibliographyEntry] — every cited document as a native Relaton item
|
|
377
|
+
# plus a native Pubid::Identifier parse (what citation edges resolve to)
|
|
378
|
+
|
|
379
|
+
Metanorma::Document::NativeModels.pubid_identifiers(model)
|
|
380
|
+
# => [{ original:, type:, primary:, pubid: }] — native pubid parses
|
|
381
|
+
|
|
382
|
+
This is a model-layer capability available to any consumer; MKO below is
|
|
383
|
+
one of them.
|
|
384
|
+
|
|
385
|
+
== Machine serialization (MKO)
|
|
386
|
+
|
|
387
|
+
*Metanorma Knowledge Objects* (MN 116) is the machine-first output
|
|
388
|
+
format: a derived bundle of typed, addressable knowledge objects
|
|
389
|
+
projected from the document model — like a rendering, never a source
|
|
390
|
+
format.
|
|
391
|
+
|
|
392
|
+
[source,ruby]
|
|
393
|
+
require "metanorma/mko"
|
|
394
|
+
|
|
395
|
+
Metanorma::Mko.export(xml_or_model, to: dir, presentation_xml: nil, zip: false)
|
|
396
|
+
# => <short>.mko/ bundle: manifest.json, document.json, units.jsonl,
|
|
397
|
+
# edges.jsonl, bibdata.json, bibliography.jsonl, identifiers.json,
|
|
398
|
+
# glossary.json
|
|
399
|
+
|
|
400
|
+
Collections export as document families — every member document as
|
|
401
|
+
its own bundle plus one small collection bundle (collection.json and
|
|
402
|
+
the doc:<member> part_of doc:<family> membership edges):
|
|
403
|
+
|
|
404
|
+
[source,ruby]
|
|
405
|
+
Metanorma::Mko::Collection.export("collection.yml", to: dir)
|
|
406
|
+
|
|
407
|
+
Figure bytes are emitted as hash-addressed, manifest-verified bundle
|
|
408
|
+
assets (data URIs from the model, or `assets_from:` paths). Language
|
|
409
|
+
editions align by stable anchors:
|
|
410
|
+
|
|
411
|
+
[source,ruby]
|
|
412
|
+
Metanorma::Mko::Alignment.export(bundle_en, bundle_fr)
|
|
413
|
+
# => alignment.jsonl of variant_of unit edges
|
|
414
|
+
|
|
415
|
+
The wire contract ships as generated JSON Schema (the schema classes
|
|
416
|
+
are the single source of truth):
|
|
417
|
+
|
|
418
|
+
[source,ruby]
|
|
419
|
+
Metanorma::Mko.json_schemas # => { "unit" => …, "collection" => …, "excerpt" => … }
|
|
420
|
+
|
|
421
|
+
The bundle carries: typed units (clause, term, table, figure, formula,
|
|
422
|
+
note, example, sourcecode, requirement, reference) with typed payloads;
|
|
423
|
+
the edge graph (part_of containment, cites from reference and term units,
|
|
424
|
+
defines, class_of, and document-level relations with Relaton types
|
|
425
|
+
verbatim); and the native object-model components (Relaton bibdata and
|
|
426
|
+
bibliography, Glossarist concepts, pubid parses). Semantic anchors are
|
|
427
|
+
preferred over GUIDs; unit ids are content-hash stable, and repeated
|
|
428
|
+
exports are byte-identical.
|
|
429
|
+
|
|
430
|
+
The walk dispatches on class/attribute declarations only — zero flavor
|
|
431
|
+
knowledge; one format serves every flavor. `Mko.renderer_for(document)`
|
|
432
|
+
follows the `Html::Generator` pattern (flavor entries may override;
|
|
433
|
+
otherwise the harness exporter serves any model tree). From the CLI:
|
|
434
|
+
|
|
435
|
+
[source,bash]
|
|
436
|
+
metanorma compile document.adoc -x mko # writes <short>.mko/
|
|
437
|
+
|
|
357
438
|
== Documentation
|
|
358
439
|
|
|
359
440
|
Detailed architecture documentation is in the `docs/` directory:
|
data/Rakefile
CHANGED
|
@@ -5,13 +5,9 @@ require "rspec/core/rake_task"
|
|
|
5
5
|
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
|
8
|
-
# Fast gate: the full suite minus the
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
# suite locally with `rake spec`.
|
|
12
|
-
RSpec::Core::RakeTask.new(:spec_fast) do |t|
|
|
13
|
-
t.exclude_pattern = "spec/metanorma/iso_document/roundtrip/**"
|
|
14
|
-
end
|
|
8
|
+
# Fast gate: the full suite minus the multi-MB-fixture specs; the
|
|
9
|
+
# per-flavor roundtrips moved to the flavor gems (Phase 5).
|
|
10
|
+
RSpec::Core::RakeTask.new(:spec_fast)
|
|
15
11
|
|
|
16
12
|
require "rubocop/rake_task"
|
|
17
13
|
|
data/data/themes/ogc.yaml
CHANGED
|
@@ -23,7 +23,7 @@ module Metanorma
|
|
|
23
23
|
|
|
24
24
|
# The semantic category of the figure. This is to allow different classes of figure (e.g. _Plate_,
|
|
25
25
|
# _Chart_, _Diagram_) to be auto-numbered and captioned differently.
|
|
26
|
-
attribute :
|
|
26
|
+
attribute :class_attr, :string
|
|
27
27
|
|
|
28
28
|
# The image file to be included in the figure as its main content.
|
|
29
29
|
attribute :image, Metanorma::BasicDocument::IdElements::Image
|
|
@@ -52,7 +52,7 @@ module Metanorma
|
|
|
52
52
|
map_attribute "unnumbered", to: :unnumbered
|
|
53
53
|
map_attribute "subsequence", to: :subsequence
|
|
54
54
|
map_element "name", to: :name
|
|
55
|
-
map_attribute "class", to: :
|
|
55
|
+
map_attribute "class", to: :class_attr
|
|
56
56
|
map_element "image", to: :image
|
|
57
57
|
map_element "video", to: :video
|
|
58
58
|
map_element "audio", to: :audio
|
|
@@ -18,7 +18,7 @@ module Metanorma
|
|
|
18
18
|
# Subclass of admonition allowing different runs of admonitions to be labelled
|
|
19
19
|
# and auto-numbered differently, even if they are of the same type.
|
|
20
20
|
# Typically is a subclass of an admonition type.
|
|
21
|
-
attribute :
|
|
21
|
+
attribute :class_attr, :string
|
|
22
22
|
|
|
23
23
|
# Location where the content of the admonition is accessible as an external document.
|
|
24
24
|
attribute :uri, Metanorma::Document::Components::DataTypes::Uri
|
|
@@ -27,7 +27,7 @@ module Metanorma
|
|
|
27
27
|
element "admonition"
|
|
28
28
|
map_attribute "type", to: :type
|
|
29
29
|
map_element "name", to: :name
|
|
30
|
-
map_attribute "class", to: :
|
|
30
|
+
map_attribute "class", to: :class_attr
|
|
31
31
|
map_element "uri", to: :uri
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "optparse"
|
|
4
|
+
require "json"
|
|
4
5
|
require "fileutils"
|
|
5
6
|
|
|
6
7
|
module Metanorma
|
|
@@ -24,6 +25,14 @@ module Metanorma
|
|
|
24
25
|
keyword_init: true,
|
|
25
26
|
)
|
|
26
27
|
|
|
28
|
+
ValidateOptions = Struct.new(
|
|
29
|
+
:xml_path,
|
|
30
|
+
:output,
|
|
31
|
+
:flavor,
|
|
32
|
+
:model_parse,
|
|
33
|
+
keyword_init: true,
|
|
34
|
+
)
|
|
35
|
+
|
|
27
36
|
def self.run(argv)
|
|
28
37
|
command = argv.shift
|
|
29
38
|
case command
|
|
@@ -31,6 +40,8 @@ module Metanorma
|
|
|
31
40
|
to_mirror(argv)
|
|
32
41
|
when "to-html"
|
|
33
42
|
to_html(argv)
|
|
43
|
+
when "validate"
|
|
44
|
+
validate(argv)
|
|
34
45
|
when nil, "-h", "--help"
|
|
35
46
|
puts usage
|
|
36
47
|
else
|
|
@@ -110,6 +121,127 @@ module Metanorma
|
|
|
110
121
|
end
|
|
111
122
|
end
|
|
112
123
|
|
|
124
|
+
def self.validate(argv)
|
|
125
|
+
options = parse_validate_options(argv)
|
|
126
|
+
checks = []
|
|
127
|
+
checks << check_encoding(options)
|
|
128
|
+
checks << check_wellformed(options)
|
|
129
|
+
checks << check_document_kind(options)
|
|
130
|
+
checks << check_model_parse(options) if options.model_parse
|
|
131
|
+
|
|
132
|
+
report = {
|
|
133
|
+
"file" => options.xml_path,
|
|
134
|
+
"valid" => checks.all? { |c| c["status"] == "pass" },
|
|
135
|
+
"checks" => checks,
|
|
136
|
+
}
|
|
137
|
+
payload = JSON.pretty_generate(report)
|
|
138
|
+
if options.output
|
|
139
|
+
File.write(options.output, payload)
|
|
140
|
+
else
|
|
141
|
+
puts payload
|
|
142
|
+
end
|
|
143
|
+
report["valid"] ? 0 : 1
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def self.parse_validate_options(argv)
|
|
147
|
+
opts = ValidateOptions.new(model_parse: false)
|
|
148
|
+
parser = OptionParser.new do |o|
|
|
149
|
+
o.on("--out FILE") { |v| opts.output = v }
|
|
150
|
+
o.on("--flavor NAME") { |v| opts.flavor = v }
|
|
151
|
+
o.on("--model-parse") { opts.model_parse = true }
|
|
152
|
+
end
|
|
153
|
+
parser.parse!(argv)
|
|
154
|
+
opts.xml_path = argv.shift
|
|
155
|
+
raise Error, "Usage: metanorma-document validate FILE [--out FILE] [--flavor NAME] [--model-parse]" if opts.xml_path.nil?
|
|
156
|
+
|
|
157
|
+
opts
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Byte-level UTF-8 validity, streamed in chunks: no full-document
|
|
161
|
+
# materialization for the common valid case.
|
|
162
|
+
def self.check_encoding(options)
|
|
163
|
+
result = { "check" => "encoding", "status" => "pass" }
|
|
164
|
+
base = 0
|
|
165
|
+
carry = +""
|
|
166
|
+
File.open(options.xml_path, "rb") do |f|
|
|
167
|
+
while (bytes = f.read(1 << 20))
|
|
168
|
+
chunk = carry + bytes
|
|
169
|
+
# Keep a potential partial multibyte sequence for the next
|
|
170
|
+
# round; a complete chunk must validate cleanly.
|
|
171
|
+
cut = chunk.bytesize - 3
|
|
172
|
+
cut = 0 if cut.negative?
|
|
173
|
+
rest = chunk.byteslice(0, cut)
|
|
174
|
+
rest.force_encoding("UTF-8")
|
|
175
|
+
unless rest.valid_encoding?
|
|
176
|
+
result["status"] = "fail"
|
|
177
|
+
result["error"] = "invalid UTF-8 byte sequence"
|
|
178
|
+
result["byte"] = base
|
|
179
|
+
return result
|
|
180
|
+
end
|
|
181
|
+
base += rest.bytesize
|
|
182
|
+
carry = chunk.byteslice(cut, chunk.bytesize - cut) || +""
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
carry.force_encoding("UTF-8")
|
|
186
|
+
unless carry.empty? || carry.valid_encoding?
|
|
187
|
+
result["status"] = "fail"
|
|
188
|
+
result["error"] = "invalid UTF-8 byte sequence (tail)"
|
|
189
|
+
result["byte"] = base
|
|
190
|
+
return result
|
|
191
|
+
end
|
|
192
|
+
result
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Well-formedness via the moxml/leptris parser (the fast engine;
|
|
196
|
+
# never the XSLT snapshot machinery).
|
|
197
|
+
def self.check_wellformed(options)
|
|
198
|
+
result = { "check" => "wellformed", "status" => "pass" }
|
|
199
|
+
begin
|
|
200
|
+
require "moxml"
|
|
201
|
+
doc = Moxml.new.parse(File.read(options.xml_path))
|
|
202
|
+
result["root"] = doc.root&.name
|
|
203
|
+
rescue StandardError => e
|
|
204
|
+
result["status"] = "fail"
|
|
205
|
+
result["error"] = e.message.to_s[0, 300]
|
|
206
|
+
end
|
|
207
|
+
result
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Presentation vs semantic root detection (presentation inputs
|
|
211
|
+
# are the render contract; semantic roots need the compile).
|
|
212
|
+
def self.check_document_kind(options)
|
|
213
|
+
result = { "check" => "document_kind", "status" => "pass" }
|
|
214
|
+
begin
|
|
215
|
+
require "moxml"
|
|
216
|
+
doc = Moxml.new.parse(File.read(options.xml_path))
|
|
217
|
+
root = doc.root
|
|
218
|
+
type = nil
|
|
219
|
+
root&.attributes&.each { |k, v| type = v if k == "type" }
|
|
220
|
+
result["kind"] = type || "unspecified"
|
|
221
|
+
result["root"] = root&.name
|
|
222
|
+
rescue StandardError => e
|
|
223
|
+
result["status"] = "fail"
|
|
224
|
+
result["error"] = e.message.to_s[0, 300]
|
|
225
|
+
end
|
|
226
|
+
result
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Full model parse through the flavor registry (catch-all fast
|
|
230
|
+
# path): model-level contract violations surface here.
|
|
231
|
+
def self.check_model_parse(options)
|
|
232
|
+
result = { "check" => "model_parse", "status" => "pass" }
|
|
233
|
+
begin
|
|
234
|
+
require "metanorma/html"
|
|
235
|
+
flavor = options.flavor&.to_sym
|
|
236
|
+
renderer = Metanorma::Html::StandardRenderer.new(flavor: flavor)
|
|
237
|
+
renderer.parse(File.read(options.xml_path))
|
|
238
|
+
rescue StandardError => e
|
|
239
|
+
result["status"] = "fail"
|
|
240
|
+
result["error"] = "#{e.class}: #{e.message}"[0, 300]
|
|
241
|
+
end
|
|
242
|
+
result
|
|
243
|
+
end
|
|
244
|
+
|
|
113
245
|
def self.to_html(argv)
|
|
114
246
|
options = parse_to_html_options(argv)
|
|
115
247
|
execute_to_html(options)
|
|
@@ -159,6 +291,8 @@ module Metanorma
|
|
|
159
291
|
Commands:
|
|
160
292
|
to-mirror Convert presentation XML to mirror JSON
|
|
161
293
|
to-html Render presentation XML to standalone HTML
|
|
294
|
+
validate Standalone diagnostics: encoding, well-formedness,
|
|
295
|
+
document kind, optional model parse (JSON report)
|
|
162
296
|
|
|
163
297
|
Run `metanorma-document <command> --help` for command-specific options.
|
|
164
298
|
USAGE
|
|
@@ -81,6 +81,10 @@ module Metanorma
|
|
|
81
81
|
map "name", to: :name
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
attribute :fmt_figure,
|
|
85
|
+
"Metanorma::Document::Components::AncillaryBlocks::FmtFigureElement",
|
|
86
|
+
collection: true
|
|
87
|
+
|
|
84
88
|
xml do
|
|
85
89
|
element "figure"
|
|
86
90
|
map_attribute "id", to: :id
|
|
@@ -105,6 +109,7 @@ module Metanorma
|
|
|
105
109
|
map_element "key", to: :key
|
|
106
110
|
map_element "fn", to: :footnotes
|
|
107
111
|
map_element "note", to: :note
|
|
112
|
+
map_element "fmt-figure", to: :fmt_figure
|
|
108
113
|
map_element "fmt-name", to: :fmt_name
|
|
109
114
|
map_element "fmt-xref-label", to: :fmt_xref_label
|
|
110
115
|
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module AncillaryBlocks
|
|
7
|
+
# Rendered counterpart of `<figure>`: the presentation-layer
|
|
8
|
+
# figure container. The overlay allows arbitrary rendered
|
|
9
|
+
# blocks; the model carries the figure-rendering vocabulary
|
|
10
|
+
# (caption, image, notes, examples) that presentation XML
|
|
11
|
+
# emits.
|
|
12
|
+
class FmtFigureElement < Lutaml::Model::Serializable
|
|
13
|
+
include Metanorma::Document::Components::Inline::RenderedDisplay
|
|
14
|
+
|
|
15
|
+
attribute :id, :string
|
|
16
|
+
attribute :anchor, :string
|
|
17
|
+
attribute :semx_id, :string
|
|
18
|
+
attribute :name, Metanorma::Document::Components::Inline::NameWithIdElement
|
|
19
|
+
attribute :image, Metanorma::Document::Components::IdElements::Image
|
|
20
|
+
attribute :note, Metanorma::Document::Components::Blocks::NoteBlock,
|
|
21
|
+
collection: true
|
|
22
|
+
attribute :example,
|
|
23
|
+
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
24
|
+
collection: true
|
|
25
|
+
attribute :text, :string, collection: true
|
|
26
|
+
attribute :semx,
|
|
27
|
+
Metanorma::Document::Components::Inline::SemxElement,
|
|
28
|
+
collection: true
|
|
29
|
+
|
|
30
|
+
xml do
|
|
31
|
+
element "fmt-figure"
|
|
32
|
+
mixed_content
|
|
33
|
+
map_attribute "id", to: :id
|
|
34
|
+
map_attribute "anchor", to: :anchor
|
|
35
|
+
map_attribute "semx-id", to: :semx_id
|
|
36
|
+
map_element "name", to: :name
|
|
37
|
+
map_element "image", to: :image
|
|
38
|
+
map_element "note", to: :note
|
|
39
|
+
map_element "example", to: :example
|
|
40
|
+
map_content to: :text
|
|
41
|
+
map_element "semx", to: :semx
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -24,6 +24,7 @@ module Metanorma
|
|
|
24
24
|
|
|
25
25
|
attribute :anchor, :string
|
|
26
26
|
attribute :semx_id, :string
|
|
27
|
+
attribute :original_id, :string
|
|
27
28
|
attribute :autonum, :string
|
|
28
29
|
attribute :displayorder, :integer
|
|
29
30
|
|
|
@@ -63,6 +64,7 @@ module Metanorma
|
|
|
63
64
|
map_attribute "id", to: :id
|
|
64
65
|
map_attribute "anchor", to: :anchor
|
|
65
66
|
map_attribute "semx-id", to: :semx_id
|
|
67
|
+
map_attribute "original-id", to: :original_id
|
|
66
68
|
map_attribute "autonum", to: :autonum
|
|
67
69
|
map_attribute "displayorder", to: :displayorder
|
|
68
70
|
map_element "stem", to: :stem
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module AncillaryBlocks
|
|
7
|
+
# One hyperlinked area of an image map: a shape (rect, circle,
|
|
8
|
+
# ellipse, poly), the link it carries, and its geometry as
|
|
9
|
+
# coordinate points (plus a radius for circle areas).
|
|
10
|
+
class ImagemapAreaElement < Lutaml::Model::Serializable
|
|
11
|
+
attribute :area_type, :string
|
|
12
|
+
attribute :xref, Metanorma::Document::Components::Inline::XrefElement
|
|
13
|
+
attribute :link, Metanorma::Document::Components::Inline::LinkElement
|
|
14
|
+
attribute :eref, Metanorma::Document::Components::Inline::ErefElement
|
|
15
|
+
attribute :coords, "Metanorma::Document::Components::AncillaryBlocks::CoordsElement", collection: true
|
|
16
|
+
attribute :radius, "Metanorma::Document::Components::AncillaryBlocks::RadiusElement"
|
|
17
|
+
|
|
18
|
+
xml do
|
|
19
|
+
element "area"
|
|
20
|
+
map_attribute "type", to: :area_type
|
|
21
|
+
map_element "xref", to: :xref
|
|
22
|
+
map_element "link", to: :link
|
|
23
|
+
map_element "eref", to: :eref
|
|
24
|
+
map_element "coords", to: :coords
|
|
25
|
+
map_element "radius", to: :radius
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# A coordinate point of an image map area shape.
|
|
30
|
+
class CoordsElement < Lutaml::Model::Serializable
|
|
31
|
+
attribute :x, :float
|
|
32
|
+
attribute :y, :float
|
|
33
|
+
|
|
34
|
+
xml do
|
|
35
|
+
element "coords"
|
|
36
|
+
map_attribute "x", to: :x
|
|
37
|
+
map_attribute "y", to: :y
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# The centre (and optional extent) of a circle image map area.
|
|
42
|
+
class RadiusElement < Lutaml::Model::Serializable
|
|
43
|
+
attribute :x, :float
|
|
44
|
+
attribute :y, :float
|
|
45
|
+
|
|
46
|
+
xml do
|
|
47
|
+
element "radius"
|
|
48
|
+
map_attribute "x", to: :x
|
|
49
|
+
map_attribute "y", to: :y
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Wrapper around an image figure, specifying an image map:
|
|
54
|
+
# areas of the image that are hyperlinked.
|
|
55
|
+
class ImagemapElement < Lutaml::Model::Serializable
|
|
56
|
+
attribute :id, :string
|
|
57
|
+
attribute :class_attr, :string
|
|
58
|
+
attribute :figure, Metanorma::Document::Components::AncillaryBlocks::FigureBlock,
|
|
59
|
+
collection: true
|
|
60
|
+
attribute :area, "Metanorma::Document::Components::AncillaryBlocks::ImagemapAreaElement", collection: true
|
|
61
|
+
|
|
62
|
+
xml do
|
|
63
|
+
element "imagemap"
|
|
64
|
+
map_attribute "id", to: :id
|
|
65
|
+
map_attribute "class", to: :class_attr
|
|
66
|
+
map_element "figure", to: :figure
|
|
67
|
+
map_element "area", to: :area
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -11,6 +11,7 @@ module Metanorma
|
|
|
11
11
|
# semantically.
|
|
12
12
|
class LiteralBlock < Lutaml::Model::Serializable
|
|
13
13
|
attribute :id, :string
|
|
14
|
+
attribute :anchor, :string
|
|
14
15
|
attribute :alt, :string
|
|
15
16
|
attribute :align, :string
|
|
16
17
|
attribute :name, Metanorma::Document::Components::TextElements::TextElement,
|
|
@@ -20,6 +21,7 @@ module Metanorma
|
|
|
20
21
|
xml do
|
|
21
22
|
element "pre"
|
|
22
23
|
map_attribute "id", to: :id
|
|
24
|
+
map_attribute "anchor", to: :anchor
|
|
23
25
|
map_attribute "alt", to: :alt
|
|
24
26
|
map_attribute "align", to: :align
|
|
25
27
|
map_element "name", to: :name
|
|
@@ -6,6 +6,7 @@ module Metanorma
|
|
|
6
6
|
module AncillaryBlocks
|
|
7
7
|
class SourcecodeBlock < Metanorma::Document::Components::Blocks::BasicBlockNoNotes
|
|
8
8
|
attribute :name, Metanorma::Document::Components::Inline::NameWithIdElement
|
|
9
|
+
attribute :fmt_name, Metanorma::Document::Components::Inline::FmtNameElement
|
|
9
10
|
attribute :unnumbered, :boolean
|
|
10
11
|
attribute :anchor, :string
|
|
11
12
|
attribute :subsequence, :string
|
|
@@ -40,6 +41,7 @@ module Metanorma
|
|
|
40
41
|
map_attribute "id", to: :id
|
|
41
42
|
map_attribute "anchor", to: :anchor
|
|
42
43
|
map_element "name", to: :name
|
|
44
|
+
map_element "fmt-name", to: :fmt_name
|
|
43
45
|
map_attribute "unnumbered", to: :unnumbered
|
|
44
46
|
map_attribute "subsequence", to: :subsequence
|
|
45
47
|
map_attribute "filename", to: :filename
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module AncillaryBlocks
|
|
7
|
+
# A cross-reference overwriting an SVG file's own hyperlink, so
|
|
8
|
+
# the SVG can link to anchors within the document. `href` names
|
|
9
|
+
# the link in the SVG file to overwrite.
|
|
10
|
+
class SvgTargetElement < Lutaml::Model::Serializable
|
|
11
|
+
attribute :href, :string
|
|
12
|
+
attribute :xref, Metanorma::Document::Components::Inline::XrefElement
|
|
13
|
+
attribute :link, Metanorma::Document::Components::Inline::LinkElement
|
|
14
|
+
attribute :eref, Metanorma::Document::Components::Inline::ErefElement
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
element "target"
|
|
18
|
+
map_attribute "href", to: :href
|
|
19
|
+
map_element "xref", to: :xref
|
|
20
|
+
map_element "link", to: :link
|
|
21
|
+
map_element "eref", to: :eref
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module AncillaryBlocks
|
|
7
|
+
# Wrapper around an SVG figure, to update its hyperlinks with
|
|
8
|
+
# (potentially document-specific) links, so that the SVG can
|
|
9
|
+
# hyperlink to anchors within the document.
|
|
10
|
+
class SvgmapElement < Lutaml::Model::Serializable
|
|
11
|
+
attribute :id, :string
|
|
12
|
+
attribute :class_attr, :string
|
|
13
|
+
attribute :figure, Metanorma::Document::Components::AncillaryBlocks::FigureBlock,
|
|
14
|
+
collection: true
|
|
15
|
+
attribute :target, "Metanorma::Document::Components::AncillaryBlocks::SvgTargetElement", collection: true
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
element "svgmap"
|
|
19
|
+
map_attribute "id", to: :id
|
|
20
|
+
map_attribute "class", to: :class_attr
|
|
21
|
+
map_element "figure", to: :figure
|
|
22
|
+
map_element "target", to: :target
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -8,6 +8,10 @@ module Metanorma
|
|
|
8
8
|
"#{__dir__}/ancillary_blocks/callout_annotation"
|
|
9
9
|
autoload :ExampleBlock, "#{__dir__}/ancillary_blocks/example_block"
|
|
10
10
|
autoload :FigureBlock, "#{__dir__}/ancillary_blocks/figure_block"
|
|
11
|
+
autoload :FmtFigureElement, "#{__dir__}/ancillary_blocks/fmt_figure_element"
|
|
12
|
+
autoload :SvgmapElement, "#{__dir__}/ancillary_blocks/svgmap_element"
|
|
13
|
+
autoload :SvgTargetElement, "#{__dir__}/ancillary_blocks/svg_target_element"
|
|
14
|
+
autoload :ImagemapElement, "#{__dir__}/ancillary_blocks/imagemap_element"
|
|
11
15
|
autoload :FormulaBlock, "#{__dir__}/ancillary_blocks/formula_block"
|
|
12
16
|
autoload :KeyElement, "#{__dir__}/ancillary_blocks/key_element"
|
|
13
17
|
autoload :LiteralBlock, "#{__dir__}/ancillary_blocks/literal_block"
|
|
@@ -7,6 +7,8 @@ module Metanorma
|
|
|
7
7
|
# Description of a bibliographic resource.
|
|
8
8
|
class BibliographicItem < Lutaml::Model::Serializable
|
|
9
9
|
attribute :id, :string
|
|
10
|
+
attribute :hidden, :boolean
|
|
11
|
+
attribute :suppress_identifier, :boolean
|
|
10
12
|
attribute :type, Metanorma::Document::Relaton::BibItemType
|
|
11
13
|
attribute :fetched, Metanorma::Document::Relaton::DateTime
|
|
12
14
|
attribute :title, Metanorma::Document::Relaton::TypedTitleString,
|
|
@@ -65,6 +67,8 @@ module Metanorma
|
|
|
65
67
|
xml do
|
|
66
68
|
element "bibitem"
|
|
67
69
|
map_attribute "id", to: :id
|
|
70
|
+
map_attribute "hidden", to: :hidden
|
|
71
|
+
map_attribute "suppress_identifier", to: :suppress_identifier
|
|
68
72
|
map_attribute "type", to: :type_attr
|
|
69
73
|
map_attribute "anchor", to: :anchor
|
|
70
74
|
map_attribute "semx-id", to: :semx_id
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Blocks
|
|
7
|
+
# Presentation-layer rendering of a requirement: the fully
|
|
8
|
+
# formatted block content emitted alongside the semantic requirement.
|
|
9
|
+
class FmtProvision < RequirementDescription
|
|
10
|
+
xml do
|
|
11
|
+
element "fmt-provision"
|
|
12
|
+
map_element "p", to: :p
|
|
13
|
+
map_element "ul", to: :ul
|
|
14
|
+
map_element "ol", to: :ol
|
|
15
|
+
map_element "sourcecode", to: :sourcecode
|
|
16
|
+
map_element "table", to: :table
|
|
17
|
+
map_element "example", to: :example
|
|
18
|
+
map_element "note", to: :note
|
|
19
|
+
map_element "figure", to: :figure
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|