metanorma-generic 1.10.2 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15f20c2ff6ac5b4bd0c8225e2c2e90eccc45535e37ed0aa1a2d5d644aa66edab
4
- data.tar.gz: b8334113bb3b81424dded4d127fdabf2767441201c5a4509d9282b280304d004
3
+ metadata.gz: 68780e456b59524a58f5943a2f611eb77eb8609d71d67d0fd03493845bd77a26
4
+ data.tar.gz: d80def3233b10b107eae9159b981755486555782962d5ab48ef8dfbd5f476e53
5
5
  SHA512:
6
- metadata.gz: 45cb75656b843384c91ce95588e490515cb8aeec3c3288359cd755c89a988d6d4821a0990a83c9c94776822a3d9df09ccc518934d8a8180364e9a3c0465e8435
7
- data.tar.gz: c539dee549b527bb65f52272caaed23924139b06cc822272589a49a14dff01c826f4d2cb33a931e8d571b9b7466395935eff8d4893b4fd2b47a047b78d85acc7
6
+ metadata.gz: 2e583a0c09780c638708932e53c6d625f291650ad66cbc0c15aad3eb8fce7f1bc728e6503b7b2c7c531558da48fd305c4575541255f501cfd68a391ab775fd17
7
+ data.tar.gz: 0c937c51fc767624d6c05d2d74e409a8128b4c45d57da929bed48cf301be47b5897ecff6632219bb1532b785cce3cf707686568f42e9b6c2651ea65db27cd6a5
@@ -624,6 +624,9 @@
624
624
  <choice>
625
625
  <ref name="PureTextElement"/>
626
626
  <ref name="stem"/>
627
+ <ref name="eref"/>
628
+ <ref name="xref"/>
629
+ <ref name="hyperlink"/>
627
630
  </choice>
628
631
  </zeroOrMore>
629
632
  </element>
@@ -634,6 +637,9 @@
634
637
  <choice>
635
638
  <ref name="PureTextElement"/>
636
639
  <ref name="stem"/>
640
+ <ref name="eref"/>
641
+ <ref name="xref"/>
642
+ <ref name="hyperlink"/>
637
643
  </choice>
638
644
  </zeroOrMore>
639
645
  </element>
@@ -641,7 +647,12 @@
641
647
  <define name="tt">
642
648
  <element name="tt">
643
649
  <zeroOrMore>
644
- <ref name="PureTextElement"/>
650
+ <choice>
651
+ <ref name="PureTextElement"/>
652
+ <ref name="eref"/>
653
+ <ref name="xref"/>
654
+ <ref name="hyperlink"/>
655
+ </choice>
645
656
  </zeroOrMore>
646
657
  </element>
647
658
  </define>
@@ -822,7 +833,9 @@
822
833
  <attribute name="alt"/>
823
834
  </optional>
824
835
  <ref name="CitationType"/>
825
- <text/>
836
+ <oneOrMore>
837
+ <ref name="PureTextElement"/>
838
+ </oneOrMore>
826
839
  </define>
827
840
  <define name="hyperlink">
828
841
  <element name="link">
@@ -835,7 +848,9 @@
835
848
  <optional>
836
849
  <attribute name="alt"/>
837
850
  </optional>
838
- <text/>
851
+ <oneOrMore>
852
+ <ref name="PureTextElement"/>
853
+ </oneOrMore>
839
854
  </element>
840
855
  </define>
841
856
  <define name="xref">
@@ -849,7 +864,9 @@
849
864
  <optional>
850
865
  <attribute name="alt"/>
851
866
  </optional>
852
- <text/>
867
+ <oneOrMore>
868
+ <ref name="PureTextElement"/>
869
+ </oneOrMore>
853
870
  </element>
854
871
  </define>
855
872
  <define name="fn">
@@ -19,11 +19,13 @@ module Asciidoctor
19
19
  configuration.document_namespace || XML_NAMESPACE
20
20
  end
21
21
 
22
- def baselocation(loc)
22
+ def baselocation(loc)
23
23
  return nil if loc.nil?
24
+
24
25
  return loc
25
26
  File.expand_path(File.join(File.dirname(
26
- self.class::_file || __FILE__), "..", "..", "..", loc))
27
+ self.class::_file || __FILE__,
28
+ ), "..", "..", "..", loc))
27
29
  end
28
30
 
29
31
  def docidentifier_cleanup(xmldoc)
@@ -36,7 +38,7 @@ module Asciidoctor
36
38
 
37
39
  def doctype(node)
38
40
  d = super
39
- configuration.doctypes or return d == "article" ?
41
+ configuration.doctypes or return d == "article" ?
40
42
  (configuration.default_doctype || "standard") : d
41
43
  type = configuration.default_doctype ||
42
44
  configuration.doctypes.keys.dig(0) || "standard"
@@ -49,18 +51,18 @@ module Asciidoctor
49
51
  end
50
52
 
51
53
  def read_config_file(path_to_config_file)
52
- Metanorma::Generic.configuration.
53
- set_default_values_from_yaml_file(path_to_config_file)
54
+ Metanorma::Generic.configuration
55
+ .set_default_values_from_yaml_file(path_to_config_file)
54
56
  end
55
57
 
56
58
  def sectiontype_streamline(ret)
57
- if configuration&.termsdefs_titles&.map(&:downcase)&.include? (ret)
59
+ if configuration&.termsdefs_titles&.map(&:downcase)&.include? ret
58
60
  "terms and definitions"
59
- elsif configuration&.symbols_titles&.map(&:downcase)&.include? (ret)
61
+ elsif configuration&.symbols_titles&.map(&:downcase)&.include? ret
60
62
  "symbols and abbreviated terms"
61
- elsif configuration&.normref_titles&.map(&:downcase)&.include? (ret)
63
+ elsif configuration&.normref_titles&.map(&:downcase)&.include? ret
62
64
  "normative references"
63
- elsif configuration&.bibliography_titles&.map(&:downcase)&.include? (ret)
65
+ elsif configuration&.bibliography_titles&.map(&:downcase)&.include? ret
64
66
  "bibliography"
65
67
  else
66
68
  ret
@@ -73,15 +75,14 @@ module Asciidoctor
73
75
  end
74
76
 
75
77
  def outputs(node, ret)
76
- File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
77
- presentation_xml_converter(node)&.convert(@filename + ".xml")
78
- html_converter(node)&.convert(@filename + ".presentation.xml",
78
+ File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
79
+ presentation_xml_converter(node)&.convert("#{@filename}.xml")
80
+ html_converter(node)&.convert("#{@filename}.presentation.xml",
79
81
  nil, false, "#{@filename}.html")
80
- doc_converter(node)&.convert(@filename + ".presentation.xml",
82
+ doc_converter(node)&.convert("#{@filename}.presentation.xml",
81
83
  nil, false, "#{@filename}.doc")
82
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
84
+ pdf_converter(node)&.convert("#{@filename}.presentation.xml",
83
85
  nil, false, "#{@filename}.pdf")
84
-
85
86
  end
86
87
 
87
88
  def validate(doc)
@@ -106,7 +107,8 @@ module Asciidoctor
106
107
  stages.empty? and return
107
108
  stage = xmldoc&.at("//bibdata/status/stage")&.text
108
109
  stages.include? stage or
109
- @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
110
+ @log.add("Document Attributes", nil,
111
+ "#{stage} is not a recognised status")
110
112
  end
111
113
 
112
114
  def committee_validate(xmldoc)
@@ -114,13 +116,14 @@ module Asciidoctor
114
116
  committees.empty? and return
115
117
  xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
116
118
  committees.include? c.text or
117
- @log.add("Document Attributes", nil, "#{c.text} is not a recognised committee")
119
+ @log.add("Document Attributes", nil,
120
+ "#{c.text} is not a recognised committee")
118
121
  end
119
122
  end
120
123
 
121
- def sections_cleanup(x)
124
+ def sections_cleanup(xml)
122
125
  super
123
- x.xpath("//*[@inline-header]").each do |h|
126
+ xml.xpath("//*[@inline-header]").each do |h|
124
127
  h.delete("inline-header")
125
128
  end
126
129
  end
@@ -132,7 +135,8 @@ module Asciidoctor
132
135
  end
133
136
 
134
137
  def presentation_xml_converter(node)
135
- IsoDoc::Generic::PresentationXMLConvert.new(html_extract_attributes(node))
138
+ IsoDoc::Generic::PresentationXMLConvert
139
+ .new(html_extract_attributes(node))
136
140
  end
137
141
 
138
142
  alias_method :pdf_converter, :html_converter