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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
class Root < Lutaml::Model::Serializable
|
|
6
|
+
include Metanorma::StandardDocument::RootAttributes
|
|
7
|
+
|
|
8
|
+
def self.lutaml_default_register
|
|
9
|
+
:bsi_document
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attribute :bibdata, Metadata::BsiBibliographicItem
|
|
13
|
+
attribute :preface,
|
|
14
|
+
Metanorma::IsoDocument::Sections::IsoPreface
|
|
15
|
+
attribute :sections,
|
|
16
|
+
BsiDocument::Sections::BsiSections
|
|
17
|
+
attribute :annex,
|
|
18
|
+
BsiDocument::Sections::BsiAnnexSection,
|
|
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,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
module Sections
|
|
6
|
+
class BsiAnnexSection < Metanorma::IsoDocument::Sections::IsoAnnexSection
|
|
7
|
+
attribute :clause, BsiClauseSection, collection: true
|
|
8
|
+
|
|
9
|
+
attribute :floating_section_title,
|
|
10
|
+
Metanorma::StandardDocument::Sections::FloatingSectionTitle,
|
|
11
|
+
collection: true
|
|
12
|
+
|
|
13
|
+
xml do
|
|
14
|
+
element "annex"
|
|
15
|
+
ordered
|
|
16
|
+
|
|
17
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_annex_attributes(self)
|
|
18
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_annex_elements(self)
|
|
19
|
+
|
|
20
|
+
map_element "section-title", to: :floating_section_title
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
module Sections
|
|
6
|
+
class BsiClauseSection < Metanorma::IsoDocument::Sections::IsoClauseSection
|
|
7
|
+
attribute :clause, BsiClauseSection, collection: true
|
|
8
|
+
|
|
9
|
+
attribute :floating_section_title,
|
|
10
|
+
Metanorma::StandardDocument::Sections::FloatingSectionTitle,
|
|
11
|
+
collection: true
|
|
12
|
+
|
|
13
|
+
xml do
|
|
14
|
+
element "clause"
|
|
15
|
+
ordered
|
|
16
|
+
|
|
17
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_clause_attributes(self)
|
|
18
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_clause_elements(self)
|
|
19
|
+
|
|
20
|
+
map_element "section-title", to: :floating_section_title
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
module Sections
|
|
6
|
+
class BsiSections < Metanorma::IsoDocument::Sections::IsoSections
|
|
7
|
+
attribute :floating_section_title,
|
|
8
|
+
Metanorma::StandardDocument::Sections::FloatingSectionTitle,
|
|
9
|
+
collection: true
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element "sections"
|
|
13
|
+
ordered
|
|
14
|
+
|
|
15
|
+
map_element "note", to: :note
|
|
16
|
+
map_element "admonition", to: :admonition
|
|
17
|
+
|
|
18
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_sections_elements(self)
|
|
19
|
+
map_element "p", to: :p
|
|
20
|
+
map_element "section-title", to: :floating_section_title
|
|
21
|
+
|
|
22
|
+
Metanorma::StandardDocument::SectionXmlMapping.apply_sections_attributes(self)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
module Sections
|
|
6
|
+
autoload :BsiAnnexSection, "#{__dir__}/sections/bsi_annex_section"
|
|
7
|
+
autoload :BsiClauseSection, "#{__dir__}/sections/bsi_clause_section"
|
|
8
|
+
autoload :BsiSections, "#{__dir__}/sections/bsi_sections"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module BsiDocument
|
|
5
|
+
autoload :Metadata, "metanorma/bsi_document/metadata"
|
|
6
|
+
autoload :Root, "metanorma/bsi_document/root"
|
|
7
|
+
autoload :Sections, "metanorma/bsi_document/sections"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
Metanorma::Registers::Setup.setup_bsi_register
|
|
@@ -1,64 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "metanorma/standard_document"
|
|
4
|
-
require "metanorma/iso_document"
|
|
5
|
-
|
|
6
3
|
module Metanorma
|
|
7
4
|
module CcDocument
|
|
8
|
-
class Root <
|
|
9
|
-
|
|
10
|
-
attribute :type, :string
|
|
11
|
-
attribute :schema_version, :string
|
|
12
|
-
attribute :flavor, :string
|
|
5
|
+
class Root < Lutaml::Model::Serializable
|
|
6
|
+
include Metanorma::StandardDocument::RootAttributes
|
|
13
7
|
|
|
14
8
|
attribute :bibdata, Metadata::CcBibliographicItem
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
attribute :preface,
|
|
10
|
+
Metanorma::StandardDocument::Sections::Preface
|
|
11
|
+
attribute :sections,
|
|
12
|
+
Metanorma::StandardDocument::Sections::Sections
|
|
13
|
+
attribute :annex,
|
|
14
|
+
Metanorma::StandardDocument::Sections::AnnexSection,
|
|
18
15
|
collection: true
|
|
19
16
|
|
|
20
|
-
attribute :preface, Metanorma::IsoDocument::Sections::IsoPreface
|
|
21
|
-
attribute :sections, Metanorma::IsoDocument::Sections::IsoSections
|
|
22
|
-
attribute :annex, Metanorma::IsoDocument::Sections::IsoAnnexSection,
|
|
23
|
-
collection: true
|
|
24
|
-
attribute :bibliography,
|
|
25
|
-
Metanorma::StandardDocument::Sections::BibliographySection
|
|
26
|
-
attribute :boilerplate, Metanorma::IsoDocument::Boilerplate
|
|
27
|
-
attribute :metanorma_extension,
|
|
28
|
-
Metanorma::IsoDocument::Metadata::MetanormaExtension
|
|
29
|
-
attribute :annotation_container, Metanorma::IsoDocument::AnnotationContainer
|
|
30
|
-
attribute :indexsect,
|
|
31
|
-
Metanorma::Document::Components::Sections::BasicSection
|
|
32
|
-
attribute :autonum, :string
|
|
33
|
-
attribute :fmt_xref_label, :string
|
|
34
|
-
attribute :localized_strings,
|
|
35
|
-
Metanorma::Document::Components::Inline::LocalizedStringsElement
|
|
36
|
-
attribute :fmt_footnote_container,
|
|
37
|
-
Metanorma::Document::Components::Inline::FmtFootnoteContainerElement
|
|
38
|
-
attribute :colophon, Metanorma::IsoDocument::Sections::Colophon
|
|
39
|
-
|
|
40
17
|
xml do
|
|
41
18
|
element "metanorma"
|
|
42
19
|
namespace Metanorma::StandardDocument::Namespace
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
map_attribute "schema-version", to: :schema_version
|
|
46
|
-
map_attribute "flavor", to: :flavor
|
|
47
|
-
map_element "bibdata", to: :bibdata
|
|
48
|
-
map_element "termdocsource", to: :term_sources
|
|
49
|
-
map_element "metanorma-extension", to: :metanorma_extension
|
|
50
|
-
map_element "boilerplate", to: :boilerplate
|
|
51
|
-
map_element "preface", to: :preface
|
|
52
|
-
map_element "sections", to: :sections
|
|
53
|
-
map_element "annex", to: :annex
|
|
54
|
-
map_element "bibliography", to: :bibliography
|
|
55
|
-
map_element "annotation-container", to: :annotation_container
|
|
56
|
-
map_element "indexsect", to: :indexsect
|
|
57
|
-
map_element "localized-strings", to: :localized_strings
|
|
58
|
-
map_element "fmt-footnote-container", to: :fmt_footnote_container
|
|
59
|
-
map_element "colophon", to: :colophon
|
|
60
|
-
map_attribute "autonum", to: :autonum
|
|
61
|
-
map_attribute "fmt-xref-label", to: :fmt_xref_label
|
|
20
|
+
|
|
21
|
+
Metanorma::StandardDocument::RootXmlMapping.apply(self)
|
|
62
22
|
end
|
|
63
23
|
end
|
|
64
24
|
end
|
data/lib/metanorma/collection.rb
CHANGED
|
@@ -59,11 +59,11 @@ module Metanorma
|
|
|
59
59
|
collection: true
|
|
60
60
|
|
|
61
61
|
# Requirement/recommendation/permission blocks inside examples.
|
|
62
|
-
attribute :requirement, "Metanorma::
|
|
62
|
+
attribute :requirement, "Metanorma::Document::Components::Blocks::RequirementModel",
|
|
63
63
|
collection: true
|
|
64
|
-
attribute :recommendation, "Metanorma::
|
|
64
|
+
attribute :recommendation, "Metanorma::Document::Components::Blocks::RecommendationModel",
|
|
65
65
|
collection: true
|
|
66
|
-
attribute :permission, "Metanorma::
|
|
66
|
+
attribute :permission, "Metanorma::Document::Components::Blocks::PermissionModel",
|
|
67
67
|
collection: true
|
|
68
68
|
|
|
69
69
|
# Paragraph blocks contributing to example content.
|
|
@@ -31,6 +31,7 @@ module Metanorma
|
|
|
31
31
|
attribute :displayorder, :integer
|
|
32
32
|
attribute :height, :string
|
|
33
33
|
attribute :width, :string
|
|
34
|
+
attribute :align, :string
|
|
34
35
|
|
|
35
36
|
# The image file to be included in the figure as its main content.
|
|
36
37
|
attribute :image, Metanorma::Document::Components::IdElements::Image
|
|
@@ -89,6 +90,7 @@ module Metanorma
|
|
|
89
90
|
map_attribute "displayorder", to: :displayorder
|
|
90
91
|
map_attribute "height", to: :height
|
|
91
92
|
map_attribute "width", to: :width, render_empty: true
|
|
93
|
+
map_attribute "align", to: :align
|
|
92
94
|
map_attribute "source", to: :source
|
|
93
95
|
map_attribute "unnumbered", to: :unnumbered
|
|
94
96
|
map_attribute "subsequence", to: :subsequence
|
|
@@ -61,6 +61,7 @@ module Metanorma
|
|
|
61
61
|
|
|
62
62
|
# Whether callout markers are displayed
|
|
63
63
|
attribute :markers, :string
|
|
64
|
+
attribute :alt, :string
|
|
64
65
|
|
|
65
66
|
# The computer code or other such text presented in the block, as a single unformatted string. (The
|
|
66
67
|
# string should be treated as pre-formatted text, with whitespace treated as significant.)
|
|
@@ -109,6 +110,7 @@ module Metanorma
|
|
|
109
110
|
map_attribute "filename", to: :filename
|
|
110
111
|
map_attribute "lang", to: :lang
|
|
111
112
|
map_attribute "markers", to: :markers
|
|
113
|
+
map_attribute "alt", to: :alt
|
|
112
114
|
map_content to: :content
|
|
113
115
|
map_element "body", to: :body
|
|
114
116
|
map_element "callout", to: :callouts
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Blocks
|
|
7
|
+
class Passthrough < BasicBlockNoNotes
|
|
8
|
+
attribute :formats, :string
|
|
9
|
+
attribute :content, :string
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element "passthrough"
|
|
13
|
+
map_attribute "id", to: :id
|
|
14
|
+
map_attribute "formats", to: :formats
|
|
15
|
+
map_content to: :content
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Document
|
|
5
|
+
module Components
|
|
6
|
+
module Blocks
|
|
7
|
+
class ClassificationValue < Lutaml::Model::Serializable
|
|
8
|
+
attribute :text, :string, collection: true
|
|
9
|
+
attribute :link, Metanorma::Document::Components::Inline::LinkElement,
|
|
10
|
+
collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
mixed_content
|
|
14
|
+
map_content to: :text
|
|
15
|
+
map_element "link", to: :link
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class RequirementClassification < Lutaml::Model::Serializable
|
|
20
|
+
attribute :tag, :string
|
|
21
|
+
attribute :value, ClassificationValue
|
|
22
|
+
|
|
23
|
+
xml do
|
|
24
|
+
element "classification"
|
|
25
|
+
map_element "tag", to: :tag
|
|
26
|
+
map_element "value", to: :value
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class RequirementDescription < Lutaml::Model::Serializable
|
|
31
|
+
attribute :p, Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
32
|
+
collection: true
|
|
33
|
+
attribute :ul, Metanorma::Document::Components::Lists::UnorderedList,
|
|
34
|
+
collection: true
|
|
35
|
+
attribute :ol, Metanorma::Document::Components::Lists::OrderedList,
|
|
36
|
+
collection: true
|
|
37
|
+
attribute :sourcecode,
|
|
38
|
+
Metanorma::Document::Components::AncillaryBlocks::SourcecodeBlock,
|
|
39
|
+
collection: true
|
|
40
|
+
attribute :table, Metanorma::Document::Components::Tables::TableBlock,
|
|
41
|
+
collection: true
|
|
42
|
+
attribute :example,
|
|
43
|
+
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
44
|
+
collection: true
|
|
45
|
+
attribute :note, Metanorma::Document::Components::Blocks::NoteBlock,
|
|
46
|
+
collection: true
|
|
47
|
+
attribute :figure,
|
|
48
|
+
Metanorma::Document::Components::AncillaryBlocks::FigureBlock,
|
|
49
|
+
collection: true
|
|
50
|
+
|
|
51
|
+
xml do
|
|
52
|
+
element "description"
|
|
53
|
+
map_element "p", to: :p
|
|
54
|
+
map_element "ul", to: :ul
|
|
55
|
+
map_element "ol", to: :ol
|
|
56
|
+
map_element "sourcecode", to: :sourcecode
|
|
57
|
+
map_element "table", to: :table
|
|
58
|
+
map_element "example", to: :example
|
|
59
|
+
map_element "note", to: :note
|
|
60
|
+
map_element "figure", to: :figure
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class RequirementInherit < Lutaml::Model::Serializable
|
|
65
|
+
attribute :text, :string, collection: true
|
|
66
|
+
attribute :eref, Metanorma::Document::Components::Inline::ErefElement,
|
|
67
|
+
collection: true
|
|
68
|
+
attribute :xref, Metanorma::Document::Components::Inline::XrefElement,
|
|
69
|
+
collection: true
|
|
70
|
+
|
|
71
|
+
xml do
|
|
72
|
+
mixed_content
|
|
73
|
+
map_content to: :text
|
|
74
|
+
map_element "eref", to: :eref
|
|
75
|
+
map_element "xref", to: :xref
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class RequirementBase < Lutaml::Model::Serializable
|
|
80
|
+
attribute :id, :string
|
|
81
|
+
attribute :model, :string
|
|
82
|
+
attribute :obligation, :string
|
|
83
|
+
attribute :type, :string
|
|
84
|
+
attribute :anchor, :string
|
|
85
|
+
attribute :subject, :string
|
|
86
|
+
attribute :classification, RequirementClassification, collection: true
|
|
87
|
+
attribute :description, RequirementDescription, collection: true
|
|
88
|
+
attribute :inherit, RequirementInherit, collection: true
|
|
89
|
+
attribute :requirement, "Metanorma::Document::Components::Blocks::RequirementModel",
|
|
90
|
+
collection: true
|
|
91
|
+
attribute :recommendation, "Metanorma::Document::Components::Blocks::RecommendationModel",
|
|
92
|
+
collection: true
|
|
93
|
+
attribute :permission, "Metanorma::Document::Components::Blocks::PermissionModel",
|
|
94
|
+
collection: true
|
|
95
|
+
attribute :example,
|
|
96
|
+
Metanorma::Document::Components::AncillaryBlocks::ExampleBlock,
|
|
97
|
+
collection: true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class RequirementModel < RequirementBase
|
|
101
|
+
xml do
|
|
102
|
+
element "requirement"
|
|
103
|
+
map_attribute "id", to: :id
|
|
104
|
+
map_attribute "model", to: :model
|
|
105
|
+
map_attribute "obligation", to: :obligation
|
|
106
|
+
map_attribute "type", to: :type
|
|
107
|
+
map_attribute "anchor", to: :anchor
|
|
108
|
+
map_element "subject", to: :subject
|
|
109
|
+
map_element "classification", to: :classification
|
|
110
|
+
map_element "description", to: :description
|
|
111
|
+
map_element "inherit", to: :inherit
|
|
112
|
+
map_element "requirement", to: :requirement
|
|
113
|
+
map_element "recommendation", to: :recommendation
|
|
114
|
+
map_element "permission", to: :permission
|
|
115
|
+
map_element "example", to: :example
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
class RecommendationModel < RequirementBase
|
|
120
|
+
xml do
|
|
121
|
+
element "recommendation"
|
|
122
|
+
map_attribute "id", to: :id
|
|
123
|
+
map_attribute "model", to: :model
|
|
124
|
+
map_attribute "obligation", to: :obligation
|
|
125
|
+
map_attribute "type", to: :type
|
|
126
|
+
map_attribute "anchor", to: :anchor
|
|
127
|
+
map_element "subject", to: :subject
|
|
128
|
+
map_element "classification", to: :classification
|
|
129
|
+
map_element "description", to: :description
|
|
130
|
+
map_element "inherit", to: :inherit
|
|
131
|
+
map_element "requirement", to: :requirement
|
|
132
|
+
map_element "recommendation", to: :recommendation
|
|
133
|
+
map_element "permission", to: :permission
|
|
134
|
+
map_element "example", to: :example
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
class PermissionModel < RequirementBase
|
|
139
|
+
xml do
|
|
140
|
+
element "permission"
|
|
141
|
+
map_attribute "id", to: :id
|
|
142
|
+
map_attribute "model", to: :model
|
|
143
|
+
map_attribute "obligation", to: :obligation
|
|
144
|
+
map_attribute "type", to: :type
|
|
145
|
+
map_attribute "anchor", to: :anchor
|
|
146
|
+
map_element "subject", to: :subject
|
|
147
|
+
map_element "classification", to: :classification
|
|
148
|
+
map_element "description", to: :description
|
|
149
|
+
map_element "inherit", to: :inherit
|
|
150
|
+
map_element "requirement", to: :requirement
|
|
151
|
+
map_element "recommendation", to: :recommendation
|
|
152
|
+
map_element "permission", to: :permission
|
|
153
|
+
map_element "example", to: :example
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
@@ -7,6 +7,16 @@ module Metanorma
|
|
|
7
7
|
autoload :BasicBlock, "#{__dir__}/blocks/basic_block"
|
|
8
8
|
autoload :BasicBlockNoNotes, "#{__dir__}/blocks/basic_block_no_notes"
|
|
9
9
|
autoload :NoteBlock, "#{__dir__}/blocks/note_block"
|
|
10
|
+
autoload :Passthrough, "#{__dir__}/blocks/passthrough"
|
|
11
|
+
autoload :ClassificationValue, "#{__dir__}/blocks/requirement_model"
|
|
12
|
+
autoload :RequirementClassification,
|
|
13
|
+
"#{__dir__}/blocks/requirement_model"
|
|
14
|
+
autoload :RequirementDescription, "#{__dir__}/blocks/requirement_model"
|
|
15
|
+
autoload :RequirementInherit, "#{__dir__}/blocks/requirement_model"
|
|
16
|
+
autoload :RequirementBase, "#{__dir__}/blocks/requirement_model"
|
|
17
|
+
autoload :RequirementModel, "#{__dir__}/blocks/requirement_model"
|
|
18
|
+
autoload :RecommendationModel, "#{__dir__}/blocks/requirement_model"
|
|
19
|
+
autoload :PermissionModel, "#{__dir__}/blocks/requirement_model"
|
|
10
20
|
end
|
|
11
21
|
end
|
|
12
22
|
end
|
|
@@ -8,7 +8,9 @@ module Metanorma
|
|
|
8
8
|
class ContributionElementMetadata < Lutaml::Model::Serializable
|
|
9
9
|
attribute :date_time, :string
|
|
10
10
|
attribute :contributor, Metanorma::Document::Relaton::Contributor
|
|
11
|
-
attribute :integrity_value,
|
|
11
|
+
attribute :integrity_value,
|
|
12
|
+
Metanorma::Document::Components::ContribMetadata::IntegrityValue,
|
|
13
|
+
collection: true
|
|
12
14
|
|
|
13
15
|
xml do
|
|
14
16
|
element "contribution-element-metadata"
|
|
@@ -8,12 +8,14 @@ module Metanorma
|
|
|
8
8
|
class Image < Media
|
|
9
9
|
attribute :height, :string
|
|
10
10
|
attribute :width, :string
|
|
11
|
+
attribute :align, :string
|
|
11
12
|
attribute :semx_id, :string
|
|
12
13
|
|
|
13
14
|
xml do
|
|
14
15
|
element "image"
|
|
15
16
|
map_attribute "height", to: :height, render_empty: true
|
|
16
17
|
map_attribute "width", to: :width, render_empty: true
|
|
18
|
+
map_attribute "align", to: :align
|
|
17
19
|
map_attribute "semx-id", to: :semx_id
|
|
18
20
|
end
|
|
19
21
|
end
|
|
@@ -7,6 +7,10 @@ module Metanorma
|
|
|
7
7
|
attribute :target, :string
|
|
8
8
|
attribute :style, :string
|
|
9
9
|
attribute :format, :string
|
|
10
|
+
attribute :pagenumber, :string
|
|
11
|
+
attribute :nosee, :string
|
|
12
|
+
attribute :nopage, :string
|
|
13
|
+
attribute :alt, :string
|
|
10
14
|
attribute :text, :string, collection: true
|
|
11
15
|
|
|
12
16
|
xml do
|
|
@@ -15,6 +19,10 @@ module Metanorma
|
|
|
15
19
|
map_attribute "target", to: :target
|
|
16
20
|
map_attribute "style", to: :style
|
|
17
21
|
map_attribute "format", to: :format
|
|
22
|
+
map_attribute "pagenumber", to: :pagenumber
|
|
23
|
+
map_attribute "nosee", to: :nosee
|
|
24
|
+
map_attribute "nopage", to: :nopage
|
|
25
|
+
map_attribute "alt", to: :alt
|
|
18
26
|
map_content to: :text
|
|
19
27
|
end
|
|
20
28
|
end
|
|
@@ -9,6 +9,9 @@ module Metanorma
|
|
|
9
9
|
attribute :id, :string
|
|
10
10
|
attribute :semx_id, :string
|
|
11
11
|
attribute :key, :string
|
|
12
|
+
attribute :newline, :string
|
|
13
|
+
attribute :indent, :string
|
|
14
|
+
attribute :spacing, :string
|
|
12
15
|
attribute :name, Metanorma::Document::Components::Inline::NameWithIdElement
|
|
13
16
|
attribute :dt, DtElement, collection: true
|
|
14
17
|
attribute :dd, DdElement, collection: true
|
|
@@ -32,6 +35,9 @@ module Metanorma
|
|
|
32
35
|
map_attribute "id", to: :id
|
|
33
36
|
map_attribute "semx-id", to: :semx_id
|
|
34
37
|
map_attribute "key", to: :key
|
|
38
|
+
map_attribute "newline", to: :newline
|
|
39
|
+
map_attribute "indent", to: :indent
|
|
40
|
+
map_attribute "spacing", to: :spacing
|
|
35
41
|
map_element "name", to: :name
|
|
36
42
|
map_element "dt", to: :dt
|
|
37
43
|
map_element "dd", to: :dd
|
|
@@ -13,6 +13,9 @@ module Metanorma
|
|
|
13
13
|
attribute :display, :string
|
|
14
14
|
attribute :display_directives, :string
|
|
15
15
|
attribute :class_attr, :string
|
|
16
|
+
attribute :group, :string
|
|
17
|
+
attribute :spacing, :string
|
|
18
|
+
attribute :indent, :string
|
|
16
19
|
|
|
17
20
|
def json_type
|
|
18
21
|
"ol"
|
|
@@ -34,6 +37,9 @@ module Metanorma
|
|
|
34
37
|
map_attribute "display-directives", to: :display_directives
|
|
35
38
|
map_attribute "class", to: :class_attr, render_empty: true
|
|
36
39
|
map_attribute "start", to: :start
|
|
40
|
+
map_attribute "group", to: :group
|
|
41
|
+
map_attribute "spacing", to: :spacing
|
|
42
|
+
map_attribute "indent", to: :indent
|
|
37
43
|
end
|
|
38
44
|
end
|
|
39
45
|
end
|
|
@@ -9,6 +9,10 @@ module Metanorma
|
|
|
9
9
|
attribute :id, :string
|
|
10
10
|
attribute :semx_id, :string
|
|
11
11
|
attribute :original_id, :string
|
|
12
|
+
attribute :nobullet, :string
|
|
13
|
+
attribute :spacing, :string
|
|
14
|
+
attribute :indent, :string
|
|
15
|
+
attribute :bare, :string
|
|
12
16
|
attribute :json_type, :string
|
|
13
17
|
|
|
14
18
|
def json_type
|
|
@@ -26,6 +30,10 @@ module Metanorma
|
|
|
26
30
|
map_attribute "id", to: :id
|
|
27
31
|
map_attribute "semx-id", to: :semx_id
|
|
28
32
|
map_attribute "original-id", to: :original_id
|
|
33
|
+
map_attribute "nobullet", to: :nobullet
|
|
34
|
+
map_attribute "spacing", to: :spacing
|
|
35
|
+
map_attribute "indent", to: :indent
|
|
36
|
+
map_attribute "bare", to: :bare
|
|
29
37
|
end
|
|
30
38
|
end
|
|
31
39
|
end
|
|
@@ -24,6 +24,12 @@ module Metanorma
|
|
|
24
24
|
# Location where the content of the admonition is accessible as an external document.
|
|
25
25
|
attribute :uri, :string
|
|
26
26
|
|
|
27
|
+
# Target cross-reference for the admonition (BSI).
|
|
28
|
+
attribute :target, :string
|
|
29
|
+
|
|
30
|
+
# Whether the admonition is excluded from automatic numbering (UN).
|
|
31
|
+
attribute :unnumbered, :string
|
|
32
|
+
|
|
27
33
|
# Paragraphs within the admonition.
|
|
28
34
|
attribute :paragraphs,
|
|
29
35
|
Metanorma::Document::Components::Paragraphs::ParagraphBlock,
|
|
@@ -51,6 +57,8 @@ module Metanorma
|
|
|
51
57
|
map_attribute "type", to: :type
|
|
52
58
|
map_element "name", to: :name
|
|
53
59
|
map_attribute "class", to: :block_class
|
|
60
|
+
map_attribute "target", to: :target
|
|
61
|
+
map_attribute "unnumbered", to: :unnumbered
|
|
54
62
|
map_element "uri", to: :uri
|
|
55
63
|
map_element "p", to: :paragraphs
|
|
56
64
|
map_element "fmt-name", to: :fmt_name
|
|
@@ -20,12 +20,15 @@ module Metanorma
|
|
|
20
20
|
# Identifier for the end of the text to which the comment applies.
|
|
21
21
|
attribute :applies_to, :string
|
|
22
22
|
|
|
23
|
+
attribute :display, :string
|
|
24
|
+
|
|
23
25
|
xml do
|
|
24
26
|
element "review"
|
|
25
27
|
map_attribute "reviewer", to: :reviewer
|
|
26
28
|
map_attribute "date", to: :date
|
|
27
29
|
map_attribute "from", to: :applies_from
|
|
28
30
|
map_attribute "to", to: :applies_to
|
|
31
|
+
map_attribute "display", to: :display
|
|
29
32
|
end
|
|
30
33
|
end
|
|
31
34
|
end
|