metanorma-document 0.2.6 → 0.2.8
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 +41 -168
- 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 +206 -120
- 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/figure_drop.rb +14 -5
- data/lib/metanorma/html/drops/formula_drop.rb +7 -2
- data/lib/metanorma/html/drops/sourcecode_drop.rb +6 -2
- data/lib/metanorma/html/drops.rb +2 -1
- data/lib/metanorma/html/generator.rb +16 -6
- 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 +5 -90
- 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 +9 -22
- 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 +268 -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 +56 -19
- data/lib/metanorma/standard_document/sections/bibliography_section.rb +1 -2
- data/lib/metanorma/standard_document/sections/clause_section.rb +75 -13
- data/lib/metanorma/standard_document/sections/colophon.rb +16 -0
- data/lib/metanorma/standard_document/sections/definition_section.rb +43 -46
- 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 +26 -12
- data/lib/metanorma/standard_document/sections/terms_section.rb +45 -13
- 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 +10 -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
|
@@ -12,6 +12,8 @@ module Metanorma
|
|
|
12
12
|
attribute :semx_id, :string
|
|
13
13
|
attribute :original_id, :string
|
|
14
14
|
attribute :keep_with_next, :string
|
|
15
|
+
attribute :keep_with_previous, :string
|
|
16
|
+
attribute :indent, :string
|
|
15
17
|
attribute :class_attr, :string
|
|
16
18
|
attribute :type_attr, :string
|
|
17
19
|
attribute :displayorder, :integer
|
|
@@ -75,9 +77,9 @@ module Metanorma
|
|
|
75
77
|
collection: true
|
|
76
78
|
attribute :image, Metanorma::Document::Components::IdElements::Image,
|
|
77
79
|
collection: true
|
|
78
|
-
attribute :add, "Metanorma::
|
|
80
|
+
attribute :add, "Metanorma::Document::Elements::Add",
|
|
79
81
|
collection: true
|
|
80
|
-
attribute :del, "Metanorma::
|
|
82
|
+
attribute :del, "Metanorma::Document::Elements::Del",
|
|
81
83
|
collection: true
|
|
82
84
|
|
|
83
85
|
# JSON serialization attributes
|
|
@@ -99,6 +101,8 @@ module Metanorma
|
|
|
99
101
|
map_attribute "semx-id", to: :semx_id
|
|
100
102
|
map_attribute "original-id", to: :original_id
|
|
101
103
|
map_attribute "keep-with-next", to: :keep_with_next
|
|
104
|
+
map_attribute "keep-with-previous", to: :keep_with_previous
|
|
105
|
+
map_attribute "indent", to: :indent
|
|
102
106
|
map_attribute "class", to: :class_attr
|
|
103
107
|
map_attribute "type", to: :type_attr
|
|
104
108
|
map_attribute "displayorder", to: :displayorder
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module ReferenceElements
|
|
7
|
+
class SourceOrigin < Lutaml::Model::Serializable
|
|
8
|
+
attribute :bibitemid, :string
|
|
9
|
+
attribute :type, :string
|
|
10
|
+
attribute :citeas, :string
|
|
11
|
+
attribute :locality_stack, Metanorma::Document::Relaton::LocalityStack,
|
|
12
|
+
collection: true
|
|
13
|
+
attribute :display_text,
|
|
14
|
+
Metanorma::Document::Components::Inline::DisplayTextElement
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
element "origin"
|
|
18
|
+
map_attribute "bibitemid", to: :bibitemid
|
|
19
|
+
map_attribute "type", to: :type
|
|
20
|
+
map_attribute "citeas", to: :citeas
|
|
21
|
+
map_element "localityStack", to: :locality_stack
|
|
22
|
+
map_element "display-text", to: :display_text
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class SourceModification < Lutaml::Model::Serializable
|
|
27
|
+
attribute :id, :string
|
|
28
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
29
|
+
collection: true
|
|
30
|
+
|
|
31
|
+
xml do
|
|
32
|
+
element "modification"
|
|
33
|
+
map_attribute "id", to: :id
|
|
34
|
+
map_element "p", to: :p
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class SourceElement < Lutaml::Model::Serializable
|
|
39
|
+
attribute :id, :string
|
|
40
|
+
attribute :status, :string
|
|
41
|
+
attribute :type, :string
|
|
42
|
+
attribute :origin, SourceOrigin
|
|
43
|
+
attribute :modification, SourceModification
|
|
44
|
+
|
|
45
|
+
xml do
|
|
46
|
+
element "source"
|
|
47
|
+
map_attribute "id", to: :id
|
|
48
|
+
map_attribute "status", to: :status
|
|
49
|
+
map_attribute "type", to: :type
|
|
50
|
+
map_element "origin", to: :origin
|
|
51
|
+
map_element "modification", to: :modification
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -21,6 +21,12 @@ module Metanorma
|
|
|
21
21
|
"#{__dir__}/reference_elements/reference_to_id_with_paragraph_element"
|
|
22
22
|
autoload :ReferenceToLinkElement,
|
|
23
23
|
"#{__dir__}/reference_elements/reference_to_link_element"
|
|
24
|
+
autoload :SourceElement,
|
|
25
|
+
"#{__dir__}/reference_elements/source_element"
|
|
26
|
+
autoload :SourceModification,
|
|
27
|
+
"#{__dir__}/reference_elements/source_element"
|
|
28
|
+
autoload :SourceOrigin,
|
|
29
|
+
"#{__dir__}/reference_elements/source_element"
|
|
24
30
|
end
|
|
25
31
|
end
|
|
26
32
|
end
|
|
@@ -10,7 +10,7 @@ module Metanorma
|
|
|
10
10
|
attribute :references, Metanorma::Document::Components::BibData::BibliographicItem,
|
|
11
11
|
collection: true
|
|
12
12
|
|
|
13
|
-
attribute :passthrough, Metanorma::
|
|
13
|
+
attribute :passthrough, Metanorma::Document::Components::Blocks::Passthrough,
|
|
14
14
|
collection: true
|
|
15
15
|
|
|
16
16
|
xml do
|
|
@@ -44,6 +44,12 @@ module Metanorma
|
|
|
44
44
|
collection: true
|
|
45
45
|
attribute :dl, Metanorma::Document::Components::Lists::DefinitionList
|
|
46
46
|
attribute :key, Metanorma::Document::Components::AncillaryBlocks::KeyElement
|
|
47
|
+
attribute :example,
|
|
48
|
+
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
49
|
+
collection: true
|
|
50
|
+
attribute :sourcecode,
|
|
51
|
+
Metanorma::Document::Components::AncillaryBlocks::SourcecodeBlock,
|
|
52
|
+
collection: true
|
|
47
53
|
attribute :colgroup, ColGroupElement
|
|
48
54
|
|
|
49
55
|
# Presentation-specific elements
|
|
@@ -54,6 +60,7 @@ module Metanorma
|
|
|
54
60
|
collection: true
|
|
55
61
|
|
|
56
62
|
attribute :width, :string
|
|
63
|
+
attribute :align, :string
|
|
57
64
|
attribute :json_type, :string
|
|
58
65
|
|
|
59
66
|
def json_type
|
|
@@ -78,6 +85,7 @@ module Metanorma
|
|
|
78
85
|
map_attribute "summary", to: :summary
|
|
79
86
|
map_attribute "uri", to: :uri
|
|
80
87
|
map_attribute "width", to: :width
|
|
88
|
+
map_attribute "align", to: :align
|
|
81
89
|
map_attribute "semx-id", to: :semx_id
|
|
82
90
|
map_attribute "autonum", to: :autonum
|
|
83
91
|
map_attribute "displayorder", to: :displayorder
|
|
@@ -88,6 +96,8 @@ module Metanorma
|
|
|
88
96
|
map_element "dl", to: :dl
|
|
89
97
|
map_element "colgroup", to: :colgroup
|
|
90
98
|
map_element "key", to: :key
|
|
99
|
+
map_element "example", to: :example
|
|
100
|
+
map_element "sourcecode", to: :sourcecode
|
|
91
101
|
map_element "fmt-name", to: :fmt_name
|
|
92
102
|
map_element "fmt-xref-label", to: :fmt_xref_label
|
|
93
103
|
map_element "fmt-footnote-container", to: :fmt_footnote_container
|
|
@@ -61,7 +61,8 @@ module Metanorma
|
|
|
61
61
|
collection: true
|
|
62
62
|
attribute :sourcecode, "Metanorma::Document::Components::AncillaryBlocks::SourcecodeBlock",
|
|
63
63
|
collection: true
|
|
64
|
-
attribute :source,
|
|
64
|
+
attribute :source,
|
|
65
|
+
Metanorma::Document::Components::ReferenceElements::SourceElement,
|
|
65
66
|
collection: true
|
|
66
67
|
|
|
67
68
|
# Nested tables (table inside td/th)
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Redirect to Components::DataTypes for backwards compatibility
|
|
4
|
-
require "metanorma/document/components/data_types"
|
|
5
|
-
|
|
6
3
|
module Metanorma
|
|
7
4
|
module Document
|
|
8
|
-
# @deprecated Use {Components::DataTypes} instead
|
|
9
5
|
DataTypes = Metanorma::Document::Components::DataTypes
|
|
10
6
|
end
|
|
11
7
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Elements
|
|
6
|
+
class Add < Metanorma::Document::Components::TextElements::TextElement
|
|
7
|
+
attribute :semx_id, :string
|
|
8
|
+
attribute :original_id, :string
|
|
9
|
+
xml do
|
|
10
|
+
element "add"
|
|
11
|
+
|
|
12
|
+
map_attribute "semx-id", to: :semx_id
|
|
13
|
+
map_attribute "original-id", to: :original_id
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Elements
|
|
6
|
+
class Del < Metanorma::Document::Components::TextElements::TextElement
|
|
7
|
+
attribute :semx_id, :string
|
|
8
|
+
attribute :original_id, :string
|
|
9
|
+
xml do
|
|
10
|
+
element "del"
|
|
11
|
+
|
|
12
|
+
map_attribute "semx-id", to: :semx_id
|
|
13
|
+
map_attribute "original-id", to: :original_id
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -6,10 +6,26 @@ module Metanorma
|
|
|
6
6
|
# Model for formattedAddress element which may contain mixed content with <br/> tags.
|
|
7
7
|
class FormattedAddress < Lutaml::Model::Serializable
|
|
8
8
|
attribute :content, :string, collection: true
|
|
9
|
+
attribute :br, Metanorma::Document::Components::Inline::BrElement,
|
|
10
|
+
collection: true
|
|
9
11
|
|
|
10
12
|
xml do
|
|
11
13
|
element "formattedAddress"
|
|
14
|
+
mixed_content
|
|
12
15
|
map_content to: :content
|
|
16
|
+
map_element "br", to: :br
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Construct a FormattedAddress from an array of text lines,
|
|
20
|
+
# inserting <br/> elements between them for proper mixed-content
|
|
21
|
+
# serialization.
|
|
22
|
+
def self.from_lines(lines)
|
|
23
|
+
new.tap do |fa|
|
|
24
|
+
fa.content = lines
|
|
25
|
+
fa.br = lines[1..].map do
|
|
26
|
+
Metanorma::Document::Components::Inline::BrElement.new
|
|
27
|
+
end
|
|
28
|
+
end
|
|
13
29
|
end
|
|
14
30
|
end
|
|
15
31
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "lutaml/model"
|
|
4
|
-
|
|
5
3
|
module Metanorma
|
|
6
4
|
module Document
|
|
7
5
|
# Base root class for all Metanorma document flavors.
|
|
8
|
-
# All document types
|
|
6
|
+
# All document types inherit from this.
|
|
9
7
|
class Root < Lutaml::Model::Serializable
|
|
10
8
|
attribute :autonum, :string
|
|
11
9
|
attribute :fmt_xref_label, :string
|
data/lib/metanorma/document.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Metanorma
|
|
|
17
17
|
module Document
|
|
18
18
|
autoload :Components, "metanorma/document/components"
|
|
19
19
|
autoload :DataTypes, "metanorma/document/data_types"
|
|
20
|
+
autoload :Elements, "metanorma/document/elements"
|
|
20
21
|
autoload :Relaton, "metanorma/document/relaton"
|
|
21
22
|
autoload :Root, "metanorma/document/root"
|
|
22
23
|
autoload :Version, "metanorma/document/version"
|
|
@@ -40,15 +41,23 @@ module Metanorma
|
|
|
40
41
|
autoload :IsoDocument, "metanorma/iso_document"
|
|
41
42
|
autoload :IecDocument, "metanorma/iec_document"
|
|
42
43
|
autoload :IeeeDocument, "metanorma/ieee_document"
|
|
44
|
+
autoload :IetfDocument, "metanorma/ietf_document"
|
|
43
45
|
autoload :IhoDocument, "metanorma/iho_document"
|
|
44
46
|
autoload :OimlDocument, "metanorma/oiml_document"
|
|
45
|
-
autoload :IetfDocument, "metanorma/ietf_document"
|
|
46
47
|
autoload :CcDocument, "metanorma/cc_document"
|
|
47
48
|
autoload :BipmDocument, "metanorma/bipm_document"
|
|
49
|
+
autoload :BsiDocument, "metanorma/bsi_document"
|
|
50
|
+
autoload :GbDocument, "metanorma/gb_document"
|
|
51
|
+
autoload :GenericDocument, "metanorma/generic_document"
|
|
48
52
|
autoload :ItuDocument, "metanorma/itu_document"
|
|
53
|
+
autoload :JisDocument, "metanorma/jis_document"
|
|
54
|
+
autoload :M3dDocument, "metanorma/m3d_document"
|
|
55
|
+
autoload :NistDocument, "metanorma/nist_document"
|
|
49
56
|
autoload :OgcDocument, "metanorma/ogc_document"
|
|
57
|
+
autoload :PlateauDocument, "metanorma/plateau_document"
|
|
58
|
+
autoload :Registers, "metanorma/registers"
|
|
50
59
|
autoload :RiboseDocument, "metanorma/ribose_document"
|
|
51
|
-
autoload :
|
|
60
|
+
autoload :UnDocument, "metanorma/un_document"
|
|
52
61
|
autoload :Collection, "metanorma/collection"
|
|
53
62
|
autoload :Html, "metanorma/html"
|
|
54
63
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module GbDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
class GbBibliographicItem < Metanorma::IsoDocument::Metadata::IsoBibliographicItem
|
|
7
|
+
attribute :ext, GbBibDataExtensionType
|
|
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 GbDocument
|
|
5
|
+
module Metadata
|
|
6
|
+
autoload :GbBibDataExtensionType,
|
|
7
|
+
"#{__dir__}/metadata/gb_bib_data_extension_type"
|
|
8
|
+
autoload :GbBibliographicItem,
|
|
9
|
+
"#{__dir__}/metadata/gb_bibliographic_item"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module GbDocument
|
|
5
|
+
class Root < Lutaml::Model::Serializable
|
|
6
|
+
include Metanorma::StandardDocument::RootAttributes
|
|
7
|
+
|
|
8
|
+
def self.lutaml_default_register
|
|
9
|
+
:gb_document
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attribute :bibdata, Metadata::GbBibliographicItem
|
|
13
|
+
attribute :preface,
|
|
14
|
+
Metanorma::IsoDocument::Sections::IsoPreface
|
|
15
|
+
attribute :sections,
|
|
16
|
+
Metanorma::IsoDocument::Sections::IsoSections
|
|
17
|
+
attribute :annex,
|
|
18
|
+
Metanorma::IsoDocument::Sections::IsoAnnexSection,
|
|
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,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module GenericDocument
|
|
5
|
+
class Root < Lutaml::Model::Serializable
|
|
6
|
+
include Metanorma::StandardDocument::RootAttributes
|
|
7
|
+
|
|
8
|
+
attribute :bibdata,
|
|
9
|
+
Metanorma::StandardDocument::Metadata::StandardBibData
|
|
10
|
+
attribute :preface,
|
|
11
|
+
Metanorma::StandardDocument::Sections::Preface
|
|
12
|
+
attribute :sections,
|
|
13
|
+
Metanorma::StandardDocument::Sections::Sections,
|
|
14
|
+
collection: true
|
|
15
|
+
attribute :annex,
|
|
16
|
+
Metanorma::StandardDocument::Sections::AnnexSection,
|
|
17
|
+
collection: true
|
|
18
|
+
attribute :misccontainer,
|
|
19
|
+
Metanorma::StandardDocument::Sections::MiscContainer
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
element "metanorma"
|
|
23
|
+
namespace Metanorma::StandardDocument::Namespace
|
|
24
|
+
|
|
25
|
+
Metanorma::StandardDocument::RootXmlMapping.apply(self)
|
|
26
|
+
|
|
27
|
+
map_element "misc-container", to: :misccontainer
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|