metanorma-document 0.2.5 → 0.2.7
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 +321 -45
- data/Gemfile +2 -0
- data/lib/metanorma/basic_document/ancillary_blocks/figure_block.rb +3 -1
- data/lib/metanorma/basic_document/blocks/basic_block.rb +5 -1
- data/lib/metanorma/basic_document/blocks/note_block.rb +5 -0
- data/lib/metanorma/basic_document/blocks.rb +3 -24
- data/lib/metanorma/basic_document/lists/list.rb +2 -1
- data/lib/metanorma/basic_document/lists/list_item.rb +17 -0
- data/lib/metanorma/basic_document/lists.rb +1 -0
- data/lib/metanorma/basic_document/paragraphs/paragraph_with_footnote.rb +3 -1
- data/lib/metanorma/basic_document/reference_elements/callout.rb +1 -1
- data/lib/metanorma/basic_document/reference_elements/footnote.rb +1 -1
- data/lib/metanorma/basic_document/text_elements/mathml.rb +1 -1
- data/lib/metanorma/bipm_document/root.rb +10 -50
- data/lib/metanorma/bipm_document.rb +0 -2
- data/lib/metanorma/bsi_document/metadata/bsi_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/bsi_document/metadata/bsi_bibliographic_item.rb +15 -0
- data/lib/metanorma/bsi_document/metadata.rb +12 -0
- data/lib/metanorma/bsi_document/root.rb +29 -0
- data/lib/metanorma/bsi_document/sections/bsi_annex_section.rb +25 -0
- data/lib/metanorma/bsi_document/sections/bsi_clause_section.rb +25 -0
- data/lib/metanorma/bsi_document/sections/bsi_sections.rb +27 -0
- data/lib/metanorma/bsi_document/sections.rb +11 -0
- data/lib/metanorma/bsi_document.rb +11 -0
- data/lib/metanorma/cc_document/root.rb +10 -50
- data/lib/metanorma/cc_document.rb +0 -2
- data/lib/metanorma/collection.rb +0 -2
- data/lib/metanorma/document/components/ancillary_blocks/example_block.rb +3 -3
- data/lib/metanorma/document/components/ancillary_blocks/figure_block.rb +2 -0
- data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +2 -0
- data/lib/metanorma/document/components/blocks/passthrough.rb +21 -0
- data/lib/metanorma/document/components/blocks/requirement_model.rb +159 -0
- data/lib/metanorma/document/components/blocks.rb +10 -0
- data/lib/metanorma/document/components/contrib_metadata/contribution_element_metadata.rb +3 -1
- data/lib/metanorma/document/components/id_elements/image.rb +2 -0
- data/lib/metanorma/document/components/inline/xref_element.rb +8 -0
- data/lib/metanorma/document/components/lists/definition_list.rb +6 -0
- data/lib/metanorma/document/components/lists/list_item.rb +1 -1
- data/lib/metanorma/document/components/lists/ordered_list.rb +6 -0
- data/lib/metanorma/document/components/lists/unordered_list.rb +8 -0
- data/lib/metanorma/document/components/multi_paragraph/admonition_block.rb +8 -0
- data/lib/metanorma/document/components/multi_paragraph/review_block.rb +3 -0
- data/lib/metanorma/document/components/paragraphs/paragraph_block.rb +6 -2
- data/lib/metanorma/document/components/reference_elements/source_element.rb +57 -0
- data/lib/metanorma/document/components/reference_elements.rb +6 -0
- data/lib/metanorma/document/components/sections/references_section.rb +1 -1
- data/lib/metanorma/document/components/tables/table_block.rb +10 -0
- data/lib/metanorma/document/components/tables/table_cell.rb +2 -1
- data/lib/metanorma/document/data_types.rb +0 -4
- data/lib/metanorma/document/elements/add.rb +18 -0
- data/lib/metanorma/document/elements/del.rb +18 -0
- data/lib/metanorma/document/elements.rb +10 -0
- data/lib/metanorma/document/relaton/address.rb +16 -0
- data/lib/metanorma/document/root.rb +1 -3
- data/lib/metanorma/document/version.rb +1 -1
- data/lib/metanorma/document.rb +11 -2
- data/lib/metanorma/gb_document/metadata/gb_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/gb_document/metadata/gb_bibliographic_item.rb +15 -0
- data/lib/metanorma/gb_document/metadata.rb +12 -0
- data/lib/metanorma/gb_document/root.rb +29 -0
- data/lib/metanorma/gb_document.rb +10 -0
- data/lib/metanorma/generic_document/root.rb +31 -0
- data/lib/metanorma/generic_document.rb +7 -0
- data/lib/metanorma/html/base_renderer.rb +245 -113
- data/lib/metanorma/html/bipm_renderer.rb +16 -8
- data/lib/metanorma/html/cc_renderer.rb +0 -1
- data/lib/metanorma/html/component/base.rb +5 -1
- data/lib/metanorma/html/component/footnote_collector.rb +3 -3
- data/lib/metanorma/html/component/index_section.rb +27 -9
- data/lib/metanorma/html/component/index_term_collector.rb +8 -3
- data/lib/metanorma/html/component.rb +2 -1
- data/lib/metanorma/html/drops/admonition_drop.rb +2 -1
- data/lib/metanorma/html/drops/example_drop.rb +2 -11
- data/lib/metanorma/html/drops/figure_drop.rb +14 -5
- data/lib/metanorma/html/drops/formula_drop.rb +7 -2
- data/lib/metanorma/html/drops/note_drop.rb +2 -3
- data/lib/metanorma/html/drops/sourcecode_drop.rb +6 -2
- data/lib/metanorma/html/drops.rb +2 -1
- data/lib/metanorma/html/generator.rb +33 -16
- data/lib/metanorma/html/iec_renderer.rb +0 -1
- data/lib/metanorma/html/ieee_renderer.rb +0 -1
- data/lib/metanorma/html/ietf_renderer.rb +0 -1
- data/lib/metanorma/html/iho_renderer.rb +1 -2
- data/lib/metanorma/html/iso_renderer.rb +68 -23
- data/lib/metanorma/html/itu_renderer.rb +0 -1
- data/lib/metanorma/html/ogc_renderer.rb +0 -1
- data/lib/metanorma/html/oiml_renderer.rb +0 -1
- data/lib/metanorma/html/pdfa_renderer.rb +0 -1
- data/lib/metanorma/html/ribose_renderer.rb +0 -1
- data/lib/metanorma/html/standard_renderer.rb +61 -28
- data/lib/metanorma/html/theme.rb +2 -2
- data/lib/metanorma/html.rb +48 -1
- data/lib/metanorma/iec_document/root.rb +8 -47
- data/lib/metanorma/iec_document.rb +2 -3
- data/lib/metanorma/ieee_document/root.rb +14 -50
- data/lib/metanorma/ieee_document/sections/ieee_sections.rb +31 -0
- data/lib/metanorma/ieee_document/sections.rb +9 -0
- data/lib/metanorma/ieee_document.rb +3 -3
- data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +0 -2
- data/lib/metanorma/ietf_document/metadata/ietf_bibliographic_item.rb +0 -2
- data/lib/metanorma/ietf_document/root.rb +14 -50
- data/lib/metanorma/ietf_document/sections/ietf_annex_section.rb +26 -0
- data/lib/metanorma/ietf_document/sections/ietf_clause_section.rb +26 -0
- data/lib/metanorma/ietf_document/sections/ietf_content_section.rb +25 -0
- data/lib/metanorma/ietf_document/sections/ietf_sections.rb +35 -0
- data/lib/metanorma/ietf_document/sections.rb +4 -23
- data/lib/metanorma/ietf_document.rb +4 -3
- data/lib/metanorma/iho_document/metadata/iho_bib_data_extension_type.rb +0 -2
- data/lib/metanorma/iho_document/root.rb +10 -50
- data/lib/metanorma/iho_document.rb +0 -3
- data/lib/metanorma/iso_document/annotation_container.rb +1 -10
- data/lib/metanorma/iso_document/boilerplate.rb +1 -11
- data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +2 -2
- data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +4 -3
- data/lib/metanorma/iso_document/metadata/metanorma_extension.rb +1 -12
- data/lib/metanorma/iso_document/root.rb +7 -73
- data/lib/metanorma/iso_document/sections/colophon.rb +1 -16
- data/lib/metanorma/iso_document/sections/iso_annex_section.rb +11 -133
- data/lib/metanorma/iso_document/sections/iso_clause_section.rb +9 -166
- data/lib/metanorma/iso_document/sections/iso_foreword_section.rb +15 -89
- data/lib/metanorma/iso_document/sections/iso_preface.rb +15 -21
- data/lib/metanorma/iso_document/sections/iso_sections.rb +19 -29
- data/lib/metanorma/iso_document/sections/iso_terms_section.rb +6 -9
- data/lib/metanorma/iso_document/terms/term_expression.rb +2 -47
- data/lib/metanorma/iso_document/terms/term_origin.rb +2 -24
- data/lib/metanorma/iso_document/terms/term_source.rb +4 -32
- data/lib/metanorma/iso_document.rb +2 -2
- data/lib/metanorma/itu_document/root.rb +10 -50
- data/lib/metanorma/itu_document.rb +0 -2
- data/lib/metanorma/jis_document/metadata/jis_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/jis_document/metadata/jis_bibliographic_item.rb +15 -0
- data/lib/metanorma/jis_document/metadata.rb +12 -0
- data/lib/metanorma/jis_document/root.rb +29 -0
- data/lib/metanorma/jis_document/sections/jis_annex_section.rb +20 -0
- data/lib/metanorma/jis_document/sections.rb +9 -0
- data/lib/metanorma/jis_document.rb +11 -0
- data/lib/metanorma/m3d_document/metadata/m3d_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/m3d_document/metadata/m3d_bibliographic_item.rb +15 -0
- data/lib/metanorma/m3d_document/metadata.rb +12 -0
- data/lib/metanorma/m3d_document/root.rb +29 -0
- data/lib/metanorma/m3d_document.rb +10 -0
- data/lib/metanorma/nist_document/metadata/nist_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/nist_document/metadata/nist_bibliographic_item.rb +15 -0
- data/lib/metanorma/nist_document/metadata.rb +12 -0
- data/lib/metanorma/nist_document/root.rb +29 -0
- data/lib/metanorma/nist_document/sections/errata.rb +16 -0
- data/lib/metanorma/nist_document/sections/errata_clause.rb +20 -0
- data/lib/metanorma/nist_document/sections/errata_row.rb +22 -0
- data/lib/metanorma/nist_document/sections/nist_preface.rb +30 -0
- data/lib/metanorma/nist_document/sections.rb +12 -0
- data/lib/metanorma/nist_document.rb +11 -0
- data/lib/metanorma/ogc_document/root.rb +10 -50
- data/lib/metanorma/ogc_document.rb +0 -2
- data/lib/metanorma/oiml_document/root.rb +8 -47
- data/lib/metanorma/oiml_document.rb +2 -3
- data/lib/metanorma/plateau_document/metadata/plateau_bibliographic_item.rb +13 -0
- data/lib/metanorma/plateau_document/metadata.rb +10 -0
- data/lib/metanorma/plateau_document/root.rb +29 -0
- data/lib/metanorma/plateau_document.rb +10 -0
- data/lib/metanorma/registers/setup.rb +162 -0
- data/lib/metanorma/registers.rb +7 -0
- data/lib/metanorma/ribose_document/root.rb +10 -52
- data/lib/metanorma/ribose_document.rb +0 -2
- data/lib/metanorma/standard_document/annotation_container.rb +14 -0
- data/lib/metanorma/standard_document/block_attributes.rb +226 -0
- data/lib/metanorma/standard_document/blocks/passthrough.rb +1 -18
- data/lib/metanorma/standard_document/blocks/requirement_model.rb +18 -163
- data/lib/metanorma/standard_document/boilerplate.rb +14 -0
- data/lib/metanorma/standard_document/elements/add.rb +1 -17
- data/lib/metanorma/standard_document/elements/del.rb +1 -17
- data/lib/metanorma/standard_document/metadata/metanorma_extension.rb +16 -0
- data/lib/metanorma/standard_document/metadata.rb +2 -0
- data/lib/metanorma/standard_document/refs/reference_to_term.rb +2 -1
- data/lib/metanorma/standard_document/root_attributes.rb +78 -0
- data/lib/metanorma/standard_document/sections/abstract.rb +1 -3
- data/lib/metanorma/standard_document/sections/acknowledgements.rb +1 -3
- data/lib/metanorma/standard_document/sections/annex_section.rb +81 -16
- data/lib/metanorma/standard_document/sections/bibliography_section.rb +1 -2
- data/lib/metanorma/standard_document/sections/clause_section.rb +102 -10
- data/lib/metanorma/standard_document/sections/colophon.rb +16 -0
- data/lib/metanorma/standard_document/sections/definition_section.rb +45 -42
- data/lib/metanorma/standard_document/sections/floating_section_title.rb +23 -0
- data/lib/metanorma/standard_document/sections/foreword.rb +1 -3
- data/lib/metanorma/standard_document/sections/introduction.rb +1 -4
- data/lib/metanorma/standard_document/sections/misc_container.rb +5 -2
- data/lib/metanorma/standard_document/sections/preface.rb +36 -0
- data/lib/metanorma/standard_document/sections/sections.rb +40 -0
- data/lib/metanorma/standard_document/sections/standard_content_section.rb +42 -9
- data/lib/metanorma/standard_document/sections/terms_section.rb +52 -10
- data/lib/metanorma/standard_document/sections.rb +6 -2
- data/lib/metanorma/standard_document/terms/designation.rb +1 -1
- data/lib/metanorma/standard_document/terms/term_expression.rb +51 -0
- data/lib/metanorma/standard_document/terms.rb +1 -0
- data/lib/metanorma/standard_document.rb +7 -2
- data/lib/metanorma/un_document/metadata/un_bib_data_extension_type.rb +10 -0
- data/lib/metanorma/un_document/metadata/un_bibliographic_item.rb +15 -0
- data/lib/metanorma/un_document/metadata.rb +12 -0
- data/lib/metanorma/un_document/root.rb +29 -0
- data/lib/metanorma/un_document/sections/un_preface.rb +23 -0
- data/lib/metanorma/un_document/sections/un_sections.rb +24 -0
- data/lib/metanorma/un_document/sections.rb +10 -0
- data/lib/metanorma/un_document.rb +11 -0
- metadata +77 -3
- data/lib/metanorma/html/whitespace_patch.rb +0 -47
|
@@ -3,71 +3,74 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module StandardDocument
|
|
5
5
|
module Sections
|
|
6
|
-
# Definition sections consist of one or more definition lists
|
|
7
|
-
#
|
|
8
|
-
#
|
|
6
|
+
# Definition sections consist of one or more definition lists,
|
|
7
|
+
# used to define symbols and abbreviations used in the remainder of
|
|
8
|
+
# the document.
|
|
9
9
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
class DefinitionSection <
|
|
17
|
-
attribute :
|
|
10
|
+
# Corresponds to isodoc.rnc:
|
|
11
|
+
# definitions = element definitions {
|
|
12
|
+
# Section-Attributes,
|
|
13
|
+
# ( (BasicBlock+) | (dl+) )?,
|
|
14
|
+
# definitions*
|
|
15
|
+
# }
|
|
16
|
+
class DefinitionSection < Lutaml::Model::Serializable
|
|
17
|
+
attribute :id, :string
|
|
18
|
+
attribute :anchor, :string
|
|
18
19
|
attribute :type, :string
|
|
20
|
+
attribute :number, :string
|
|
19
21
|
attribute :obligation, :string
|
|
22
|
+
attribute :inline_header, :string
|
|
23
|
+
attribute :unnumbered, :string
|
|
24
|
+
attribute :toc, :string
|
|
25
|
+
attribute :class_attr, :string
|
|
26
|
+
attribute :title,
|
|
27
|
+
Metanorma::Document::Components::Inline::TitleWithAnnotationElement
|
|
20
28
|
|
|
21
29
|
# Block content
|
|
22
|
-
attribute :id, :string
|
|
23
|
-
attribute :anchor, :string
|
|
24
|
-
attribute :title, Metanorma::Document::Components::Inline::TitleWithAnnotationElement
|
|
25
30
|
attribute :paragraphs,
|
|
26
31
|
Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
27
32
|
collection: true
|
|
28
|
-
attribute :definition_lists,
|
|
29
|
-
Metanorma::Document::Components::Lists::DefinitionList,
|
|
30
|
-
collection: true
|
|
31
33
|
attribute :unordered_lists,
|
|
32
34
|
Metanorma::Document::Components::Lists::UnorderedList,
|
|
33
35
|
collection: true
|
|
34
|
-
attribute :
|
|
35
|
-
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
36
|
-
collection: true
|
|
37
|
-
attribute :table,
|
|
36
|
+
attribute :tables,
|
|
38
37
|
Metanorma::Document::Components::Tables::TableBlock,
|
|
39
38
|
collection: true
|
|
39
|
+
attribute :definition_lists,
|
|
40
|
+
Metanorma::Document::Components::Lists::DefinitionList,
|
|
41
|
+
collection: true
|
|
42
|
+
attribute :examples,
|
|
43
|
+
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
44
|
+
collection: true
|
|
40
45
|
|
|
46
|
+
# Recursive definitions
|
|
47
|
+
attribute :definitions, DefinitionSection, collection: true
|
|
48
|
+
|
|
49
|
+
# Presentation-specific attributes
|
|
41
50
|
attribute :semx_id, :string
|
|
42
|
-
attribute :original_id, :string
|
|
43
51
|
attribute :autonum, :string
|
|
44
52
|
attribute :displayorder, :integer
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
attribute :
|
|
48
|
-
|
|
53
|
+
attribute :fmt_title,
|
|
54
|
+
Metanorma::Document::Components::Inline::FmtTitleElement
|
|
55
|
+
attribute :fmt_xref_label,
|
|
56
|
+
Metanorma::Document::Components::Inline::FmtXrefLabelElement,
|
|
49
57
|
collection: true
|
|
50
58
|
|
|
51
59
|
xml do
|
|
52
60
|
element "definitions"
|
|
53
61
|
ordered
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
map_element "
|
|
59
|
-
map_element "
|
|
60
|
-
map_element "
|
|
61
|
-
map_element "
|
|
62
|
-
map_element "example",
|
|
63
|
-
map_element "
|
|
64
|
-
map_element "
|
|
65
|
-
map_element "fmt-title", to: :fmt_title
|
|
62
|
+
|
|
63
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_content_section_attributes(self)
|
|
64
|
+
|
|
65
|
+
map_element "title", to: :title
|
|
66
|
+
map_element "p", to: :paragraphs
|
|
67
|
+
map_element "ul", to: :unordered_lists
|
|
68
|
+
map_element "table", to: :tables
|
|
69
|
+
map_element "dl", to: :definition_lists
|
|
70
|
+
map_element "example", to: :examples
|
|
71
|
+
map_element "definitions", to: :definitions
|
|
72
|
+
map_element "fmt-title", to: :fmt_title
|
|
66
73
|
map_element "fmt-xref-label", to: :fmt_xref_label
|
|
67
|
-
map_attribute "semx-id", to: :semx_id
|
|
68
|
-
map_attribute "original-id", to: :original_id
|
|
69
|
-
map_attribute "autonum", to: :autonum
|
|
70
|
-
map_attribute "displayorder", to: :displayorder
|
|
71
74
|
end
|
|
72
75
|
end
|
|
73
76
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module StandardDocument
|
|
5
|
+
module Sections
|
|
6
|
+
# A floating section title used in BSI and JIS documents.
|
|
7
|
+
# Differs from FloatingTitle: uses element name "section-title",
|
|
8
|
+
# has id (not derived from StandardBlockNoNotes), and contains TextElement.
|
|
9
|
+
class FloatingSectionTitle < Lutaml::Model::Serializable
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :depth, :integer
|
|
12
|
+
attribute :text, :string, collection: true
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
element "section-title"
|
|
16
|
+
map_attribute "id", to: :id
|
|
17
|
+
map_attribute "depth", to: :depth
|
|
18
|
+
map_content to: :text
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -4,10 +4,8 @@ module Metanorma
|
|
|
4
4
|
module StandardDocument
|
|
5
5
|
module Sections
|
|
6
6
|
# Foreword of document.
|
|
7
|
-
class Foreword < Metanorma::StandardDocument::Sections::
|
|
8
|
-
attribute :semx_id, :string
|
|
7
|
+
class Foreword < Metanorma::StandardDocument::Sections::ContentSection
|
|
9
8
|
attribute :original_id, :string
|
|
10
|
-
attribute :displayorder, :integer
|
|
11
9
|
xml do
|
|
12
10
|
element "foreword"
|
|
13
11
|
|
|
@@ -4,11 +4,8 @@ module Metanorma
|
|
|
4
4
|
module StandardDocument
|
|
5
5
|
module Sections
|
|
6
6
|
# Introduction of document.
|
|
7
|
-
class Introduction < Metanorma::StandardDocument::Sections::
|
|
8
|
-
attribute :semx_id, :string
|
|
7
|
+
class Introduction < Metanorma::StandardDocument::Sections::ContentSection
|
|
9
8
|
attribute :original_id, :string
|
|
10
|
-
attribute :autonum, :string
|
|
11
|
-
attribute :displayorder, :integer
|
|
12
9
|
xml do
|
|
13
10
|
element "introduction"
|
|
14
11
|
|
|
@@ -5,8 +5,11 @@ module Metanorma
|
|
|
5
5
|
module Sections
|
|
6
6
|
# Extension point for extraneous elements that need to be added to standards document
|
|
7
7
|
# from other schemas, e.g. UnitsML.
|
|
8
|
+
#
|
|
9
|
+
# Content is stored as raw XML text since the children come from external
|
|
10
|
+
# vocabularies not defined in the metanorma schema.
|
|
8
11
|
class MiscContainer < Lutaml::Model::Serializable
|
|
9
|
-
attribute :
|
|
12
|
+
attribute :content, :string
|
|
10
13
|
|
|
11
14
|
attribute :semx_id, :string
|
|
12
15
|
attribute :original_id, :string
|
|
@@ -14,7 +17,7 @@ module Metanorma
|
|
|
14
17
|
|
|
15
18
|
xml do
|
|
16
19
|
element "misc-container"
|
|
17
|
-
|
|
20
|
+
map_content to: :content
|
|
18
21
|
|
|
19
22
|
map_attribute "semx-id", to: :semx_id
|
|
20
23
|
map_attribute "original-id", to: :original_id
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module StandardDocument
|
|
5
|
+
module Sections
|
|
6
|
+
# Container for preface sections.
|
|
7
|
+
# Corresponds to isodoc.rnc:
|
|
8
|
+
# preface = element preface {
|
|
9
|
+
# ( content | abstract | foreword | introduction |
|
|
10
|
+
# acknowledgements | executivesummary )+
|
|
11
|
+
# }
|
|
12
|
+
class Preface < Lutaml::Model::Serializable
|
|
13
|
+
attribute :abstract, ContentSection
|
|
14
|
+
attribute :foreword, ContentSection
|
|
15
|
+
attribute :introduction, ContentSection
|
|
16
|
+
attribute :acknowledgements, ContentSection
|
|
17
|
+
attribute :executivesummary, ContentSection
|
|
18
|
+
attribute :content, ContentSection, collection: true
|
|
19
|
+
|
|
20
|
+
# Presentation-specific attributes
|
|
21
|
+
attribute :semx_id, :string
|
|
22
|
+
attribute :displayorder, :integer
|
|
23
|
+
|
|
24
|
+
xml do
|
|
25
|
+
element "preface"
|
|
26
|
+
ordered
|
|
27
|
+
|
|
28
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_preface_elements(self)
|
|
29
|
+
map_element "clause", to: :content
|
|
30
|
+
|
|
31
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_preface_attributes(self)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module StandardDocument
|
|
5
|
+
module Sections
|
|
6
|
+
# Container for the main body sections of a document.
|
|
7
|
+
# Corresponds to isodoc.rnc:
|
|
8
|
+
# sections = element sections {
|
|
9
|
+
# ( clause | terms | term-clause | definitions | floating-title )+
|
|
10
|
+
# }
|
|
11
|
+
class Sections < Lutaml::Model::Serializable
|
|
12
|
+
attribute :clause, ClauseSection, collection: true
|
|
13
|
+
attribute :terms,
|
|
14
|
+
Metanorma::StandardDocument::Sections::TermsSection,
|
|
15
|
+
collection: true
|
|
16
|
+
attribute :definitions,
|
|
17
|
+
Metanorma::StandardDocument::Sections::DefinitionSection,
|
|
18
|
+
collection: true
|
|
19
|
+
attribute :floating_title,
|
|
20
|
+
Metanorma::StandardDocument::Sections::FloatingTitle,
|
|
21
|
+
collection: true
|
|
22
|
+
attribute :references,
|
|
23
|
+
Metanorma::StandardDocument::Sections::StandardReferencesSection,
|
|
24
|
+
collection: true
|
|
25
|
+
|
|
26
|
+
# Presentation-specific attributes
|
|
27
|
+
attribute :semx_id, :string
|
|
28
|
+
attribute :displayorder, :integer
|
|
29
|
+
|
|
30
|
+
xml do
|
|
31
|
+
element "sections"
|
|
32
|
+
ordered
|
|
33
|
+
|
|
34
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_sections_elements(self)
|
|
35
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_sections_attributes(self)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -3,23 +3,56 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module StandardDocument
|
|
5
5
|
module Sections
|
|
6
|
-
#
|
|
7
|
-
|
|
6
|
+
# A content section used for preface elements (abstract, foreword,
|
|
7
|
+
# introduction, acknowledgements, executivesummary) and generic clauses
|
|
8
|
+
# within preface.
|
|
9
|
+
# Corresponds to isodoc.rnc `Content-Section`:
|
|
10
|
+
# Section-Attributes, type?, title?,
|
|
11
|
+
# ( BasicBlock*, content-subsection* )
|
|
12
|
+
class ContentSection < Lutaml::Model::Serializable
|
|
13
|
+
include Metanorma::StandardDocument::BlockAttributes
|
|
14
|
+
|
|
15
|
+
# Section identity
|
|
16
|
+
attribute :id, :string
|
|
8
17
|
attribute :type, :string
|
|
18
|
+
attribute :number, :string
|
|
19
|
+
attribute :obligation, :string
|
|
20
|
+
attribute :inline_header, :string
|
|
21
|
+
attribute :unnumbered, :string
|
|
22
|
+
attribute :toc, :string
|
|
23
|
+
attribute :class_attr, :string
|
|
24
|
+
attribute :title,
|
|
25
|
+
Metanorma::Document::Components::Inline::TitleWithAnnotationElement
|
|
26
|
+
|
|
27
|
+
# Nested content subsections (recursive)
|
|
28
|
+
attribute :subsection, ContentSection, collection: true
|
|
9
29
|
|
|
30
|
+
# Presentation-specific attributes
|
|
31
|
+
attribute :anchor, :string
|
|
10
32
|
attribute :semx_id, :string
|
|
11
|
-
attribute :original_id, :string
|
|
12
33
|
attribute :autonum, :string
|
|
13
34
|
attribute :displayorder, :integer
|
|
35
|
+
attribute :fmt_title,
|
|
36
|
+
Metanorma::Document::Components::Inline::FmtTitleElement
|
|
37
|
+
attribute :fmt_xref_label,
|
|
38
|
+
Metanorma::Document::Components::Inline::FmtXrefLabelElement,
|
|
39
|
+
collection: true
|
|
40
|
+
attribute :variant_title,
|
|
41
|
+
Metanorma::Document::Components::Inline::VariantTitleElement,
|
|
42
|
+
collection: true
|
|
43
|
+
attribute :fmt_annotation_start,
|
|
44
|
+
Metanorma::Document::Components::Inline::FmtAnnotationStartElement,
|
|
45
|
+
collection: true
|
|
46
|
+
attribute :fmt_annotation_end,
|
|
47
|
+
Metanorma::Document::Components::Inline::FmtAnnotationEndElement,
|
|
48
|
+
collection: true
|
|
14
49
|
|
|
15
50
|
xml do
|
|
16
|
-
element "
|
|
17
|
-
|
|
51
|
+
element "clause"
|
|
52
|
+
ordered
|
|
18
53
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
map_attribute "autonum", to: :autonum
|
|
22
|
-
map_attribute "displayorder", to: :displayorder
|
|
54
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_content_section_attributes(self)
|
|
55
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_content_section_elements(self)
|
|
23
56
|
end
|
|
24
57
|
end
|
|
25
58
|
end
|
|
@@ -3,25 +3,67 @@
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module StandardDocument
|
|
5
5
|
module Sections
|
|
6
|
-
# Term sections give elaborated definitions of terms used in a
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
# Term sections give elaborated definitions of terms used in a
|
|
7
|
+
# standardization document.
|
|
8
|
+
#
|
|
9
|
+
# Corresponds to isodoc.rnc:
|
|
10
|
+
# terms = element terms {
|
|
11
|
+
# Section-Attributes, title?,
|
|
12
|
+
# ( paragraph | ul )*,
|
|
13
|
+
# term+
|
|
14
|
+
# }
|
|
15
|
+
class TermsSection < Lutaml::Model::Serializable
|
|
16
|
+
attribute :id, :string
|
|
17
|
+
attribute :anchor, :string
|
|
18
|
+
attribute :type, :string
|
|
19
|
+
attribute :number, :string
|
|
20
|
+
attribute :obligation, :string
|
|
21
|
+
attribute :inline_header, :string
|
|
22
|
+
attribute :unnumbered, :string
|
|
23
|
+
attribute :toc, :string
|
|
24
|
+
attribute :class_attr, :string
|
|
25
|
+
attribute :title,
|
|
26
|
+
Metanorma::Document::Components::Inline::TitleWithAnnotationElement
|
|
27
|
+
|
|
28
|
+
# Prefatory paragraphs before term entries
|
|
29
|
+
attribute :paragraphs,
|
|
30
|
+
Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
31
|
+
collection: true
|
|
32
|
+
attribute :unordered_lists,
|
|
33
|
+
Metanorma::Document::Components::Lists::UnorderedList,
|
|
34
|
+
collection: true
|
|
35
|
+
|
|
36
|
+
# Term entries
|
|
37
|
+
attribute :terms,
|
|
38
|
+
Metanorma::StandardDocument::Terms::Term,
|
|
10
39
|
collection: true
|
|
11
40
|
|
|
41
|
+
# Presentation-specific attributes
|
|
12
42
|
attribute :semx_id, :string
|
|
13
|
-
attribute :original_id, :string
|
|
14
43
|
attribute :autonum, :string
|
|
15
44
|
attribute :displayorder, :integer
|
|
45
|
+
attribute :fmt_title,
|
|
46
|
+
Metanorma::Document::Components::Inline::FmtTitleElement
|
|
47
|
+
attribute :fmt_xref_label,
|
|
48
|
+
Metanorma::Document::Components::Inline::FmtXrefLabelElement,
|
|
49
|
+
collection: true
|
|
50
|
+
attribute :variant_title,
|
|
51
|
+
Metanorma::Document::Components::Inline::VariantTitleElement,
|
|
52
|
+
collection: true
|
|
16
53
|
|
|
17
54
|
xml do
|
|
18
55
|
element "terms"
|
|
19
|
-
|
|
56
|
+
ordered
|
|
57
|
+
|
|
58
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_content_section_attributes(self)
|
|
20
59
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
60
|
+
map_element "title", to: :title
|
|
61
|
+
map_element "variant-title", to: :variant_title
|
|
62
|
+
map_element "fmt-title", to: :fmt_title
|
|
63
|
+
map_element "fmt-xref-label", to: :fmt_xref_label
|
|
64
|
+
map_element "p", to: :paragraphs
|
|
65
|
+
map_element "ul", to: :unordered_lists
|
|
66
|
+
map_element "term", to: :terms
|
|
25
67
|
end
|
|
26
68
|
end
|
|
27
69
|
end
|
|
@@ -7,18 +7,22 @@ module Metanorma
|
|
|
7
7
|
autoload :Acknowledgements, "#{__dir__}/sections/acknowledgements"
|
|
8
8
|
autoload :AnnexSection, "#{__dir__}/sections/annex_section"
|
|
9
9
|
autoload :BibliographySection, "#{__dir__}/sections/bibliography_section"
|
|
10
|
+
autoload :Colophon, "#{__dir__}/sections/colophon"
|
|
10
11
|
autoload :BoilerplateType, "#{__dir__}/sections/boilerplate_type"
|
|
11
12
|
autoload :ClauseHierarchicalSection,
|
|
12
13
|
"#{__dir__}/sections/clause_hierarchical_section"
|
|
13
14
|
autoload :ClauseSection, "#{__dir__}/sections/clause_section"
|
|
15
|
+
autoload :ContentSection, "#{__dir__}/sections/standard_content_section"
|
|
14
16
|
autoload :DefinitionSection, "#{__dir__}/sections/definition_section"
|
|
17
|
+
autoload :FloatingSectionTitle,
|
|
18
|
+
"#{__dir__}/sections/floating_section_title"
|
|
15
19
|
autoload :FloatingTitle, "#{__dir__}/sections/floating_title"
|
|
16
20
|
autoload :Foreword, "#{__dir__}/sections/foreword"
|
|
17
21
|
autoload :Introduction, "#{__dir__}/sections/introduction"
|
|
18
22
|
autoload :MiscContainer, "#{__dir__}/sections/misc_container"
|
|
19
23
|
autoload :NormativeType, "#{__dir__}/sections/normative_type"
|
|
20
|
-
autoload :
|
|
21
|
-
|
|
24
|
+
autoload :Preface, "#{__dir__}/sections/preface"
|
|
25
|
+
autoload :Sections, "#{__dir__}/sections/sections"
|
|
22
26
|
autoload :StandardHierarchicalSection,
|
|
23
27
|
"#{__dir__}/sections/standard_hierarchical_section"
|
|
24
28
|
autoload :StandardReferencesSection,
|
|
@@ -10,7 +10,7 @@ module Metanorma
|
|
|
10
10
|
Metanorma::Document::Components::DataTypes::Iso3166Code, collection: true
|
|
11
11
|
attribute :sources, Metanorma::StandardDocument::Terms::TermSource,
|
|
12
12
|
collection: true
|
|
13
|
-
attribute :expression, Metanorma::
|
|
13
|
+
attribute :expression, Metanorma::StandardDocument::Terms::TermExpression
|
|
14
14
|
|
|
15
15
|
attribute :semx_id, :string
|
|
16
16
|
attribute :original_id, :string
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module StandardDocument
|
|
5
|
+
module Terms
|
|
6
|
+
class TermNameElement < Lutaml::Model::Serializable
|
|
7
|
+
attribute :id, :string
|
|
8
|
+
attribute :semx_id, :string
|
|
9
|
+
attribute :lang, :string
|
|
10
|
+
attribute :text, :string, collection: true
|
|
11
|
+
attribute :strike, Metanorma::Document::Components::TextElements::StrikeElement,
|
|
12
|
+
collection: true
|
|
13
|
+
attribute :em, Metanorma::Document::Components::Inline::EmRawElement,
|
|
14
|
+
collection: true
|
|
15
|
+
attribute :strong, Metanorma::Document::Components::Inline::StrongRawElement,
|
|
16
|
+
collection: true
|
|
17
|
+
attribute :sup, Metanorma::Document::Components::Inline::SupElement,
|
|
18
|
+
collection: true
|
|
19
|
+
attribute :sub, Metanorma::Document::Components::Inline::SubElement,
|
|
20
|
+
collection: true
|
|
21
|
+
|
|
22
|
+
xml do
|
|
23
|
+
element "name"
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "semx-id", to: :semx_id
|
|
26
|
+
map_attribute "lang", to: :lang
|
|
27
|
+
mixed_content
|
|
28
|
+
map_content to: :text
|
|
29
|
+
map_element "strike", to: :strike
|
|
30
|
+
map_element "em", to: :em
|
|
31
|
+
map_element "strong", to: :strong
|
|
32
|
+
map_element "sup", to: :sup
|
|
33
|
+
map_element "sub", to: :sub
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class TermExpression < Lutaml::Model::Serializable
|
|
38
|
+
attribute :name, TermNameElement, collection: true
|
|
39
|
+
attribute :usage, :string
|
|
40
|
+
attribute :abbreviation_type, :string
|
|
41
|
+
|
|
42
|
+
xml do
|
|
43
|
+
element "expression"
|
|
44
|
+
map_element "name", to: :name
|
|
45
|
+
map_element "usage", to: :usage
|
|
46
|
+
map_element "abbreviation-type", to: :abbreviation_type
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -22,6 +22,7 @@ module Metanorma
|
|
|
22
22
|
autoload :Term, "#{__dir__}/terms/term"
|
|
23
23
|
autoload :TermCollection, "#{__dir__}/terms/term_collection"
|
|
24
24
|
autoload :TermDefinition, "#{__dir__}/terms/term_definition"
|
|
25
|
+
autoload :TermExpression, "#{__dir__}/terms/term_expression"
|
|
25
26
|
autoload :TermSource, "#{__dir__}/terms/term_source"
|
|
26
27
|
autoload :TermSourceStatus, "#{__dir__}/terms/term_source_status"
|
|
27
28
|
autoload :TermSourceType, "#{__dir__}/terms/term_source_type"
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "metanorma/document"
|
|
4
|
-
|
|
5
3
|
module Metanorma
|
|
6
4
|
module StandardDocument
|
|
5
|
+
autoload :AnnotationContainer,
|
|
6
|
+
"metanorma/standard_document/annotation_container"
|
|
7
|
+
autoload :BlockAttributes, "metanorma/standard_document/block_attributes"
|
|
8
|
+
autoload :BlockXmlMapping, "metanorma/standard_document/block_attributes"
|
|
9
|
+
autoload :SectionXmlMapping, "metanorma/standard_document/block_attributes"
|
|
7
10
|
autoload :Blocks, "metanorma/standard_document/blocks"
|
|
11
|
+
autoload :Boilerplate, "metanorma/standard_document/boilerplate"
|
|
8
12
|
autoload :Elements, "metanorma/standard_document/elements"
|
|
9
13
|
autoload :Lists, "metanorma/standard_document/lists"
|
|
10
14
|
autoload :Metadata, "metanorma/standard_document/metadata"
|
|
11
15
|
autoload :Namespace, "metanorma/standard_document/namespace"
|
|
12
16
|
autoload :Refs, "metanorma/standard_document/refs"
|
|
13
17
|
autoload :Root, "metanorma/standard_document/root"
|
|
18
|
+
autoload :RootAttributes, "metanorma/standard_document/root_attributes"
|
|
14
19
|
autoload :Sections, "metanorma/standard_document/sections"
|
|
15
20
|
autoload :StandardDocumentType,
|
|
16
21
|
"metanorma/standard_document/standard_document_type"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module UnDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class UnBibliographicItem < Metanorma::IsoDocument::Metadata::IsoBibliographicItem
|
|
7
|
+
attribute :ext, UnBibDataExtensionType
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
element "bibdata"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module UnDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
autoload :UnBibDataExtensionType,
|
|
7
|
+
"#{__dir__}/metadata/un_bib_data_extension_type"
|
|
8
|
+
autoload :UnBibliographicItem,
|
|
9
|
+
"#{__dir__}/metadata/un_bibliographic_item"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module UnDocument
|
|
5
|
+
class Root < Lutaml::Model::Serializable
|
|
6
|
+
include Metanorma::StandardDocument::RootAttributes
|
|
7
|
+
|
|
8
|
+
def self.lutaml_default_register
|
|
9
|
+
:un_document
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attribute :bibdata, Metadata::UnBibliographicItem
|
|
13
|
+
attribute :preface,
|
|
14
|
+
UnDocument::Sections::UnPreface
|
|
15
|
+
attribute :sections,
|
|
16
|
+
UnDocument::Sections::UnSections
|
|
17
|
+
attribute :annex,
|
|
18
|
+
Metanorma::StandardDocument::Sections::AnnexSection,
|
|
19
|
+
collection: true
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
element "metanorma"
|
|
23
|
+
namespace Metanorma::StandardDocument::Namespace
|
|
24
|
+
|
|
25
|
+
Metanorma::StandardDocument::RootXmlMapping.apply(self)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module UnDocument
|
|
5
|
+
module Sections
|
|
6
|
+
# UN preface with only abstract, foreword, introduction.
|
|
7
|
+
# Corresponds to un.rnc:
|
|
8
|
+
# preface = element preface { abstract?, foreword?, introduction? }
|
|
9
|
+
class UnPreface < Metanorma::StandardDocument::Sections::Preface
|
|
10
|
+
xml do
|
|
11
|
+
element "preface"
|
|
12
|
+
ordered
|
|
13
|
+
|
|
14
|
+
map_element "abstract", to: :abstract
|
|
15
|
+
map_element "foreword", to: :foreword
|
|
16
|
+
map_element "introduction", to: :introduction
|
|
17
|
+
|
|
18
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_preface_attributes(self)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module UnDocument
|
|
5
|
+
module Sections
|
|
6
|
+
# UN sections container.
|
|
7
|
+
# Corresponds to un.rnc:
|
|
8
|
+
# sections = element sections { (clause | floating-title)+ }
|
|
9
|
+
#
|
|
10
|
+
# UN does not allow terms/definitions at top level of sections.
|
|
11
|
+
class UnSections < Metanorma::StandardDocument::Sections::Sections
|
|
12
|
+
xml do
|
|
13
|
+
element "sections"
|
|
14
|
+
ordered
|
|
15
|
+
|
|
16
|
+
map_element "clause", to: :clause
|
|
17
|
+
map_element "floating-title", to: :floating_title
|
|
18
|
+
|
|
19
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_sections_attributes(self)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|