metanorma-jis 0.0.9 → 0.1.0

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.
@@ -63,34 +63,29 @@ module IsoDoc
63
63
  olstyle: "l8" }
64
64
  end
65
65
 
66
- def norm_ref(isoxml, out, num)
67
- (f = isoxml.at(ns(norm_ref_xpath)) and f["hidden"] != "true") or
68
- return num
66
+ def norm_ref(node, out)
67
+ node["hidden"] != "true" or return
69
68
  out.div class: "normref_div" do |div|
70
- num += 1
71
- clause_name(f, f.at(ns("./title")), div, nil)
72
- if f.name == "clause"
73
- f.elements.each { |e| parse(e, div) unless e.name == "title" }
74
- else biblio_list(f, div, false)
69
+ clause_name(node, node.at(ns("./title")), div, nil)
70
+ if node.name == "clause"
71
+ node.elements.each { |e| parse(e, div) unless e.name == "title" }
72
+ else biblio_list(node, div, false)
75
73
  end
76
74
  end
77
- num
78
75
  end
79
76
 
80
- def bibliography(isoxml, out)
81
- (f = isoxml.at(ns(bibliography_xpath)) and f["hidden"] != "true") or
82
- return
77
+ def bibliography(node, out)
78
+ node["hidden"] != "true" or return
83
79
  page_break(out)
84
80
  out.div class: "bibliography" do |div|
85
81
  div.h1 class: "Section3" do |h1|
86
- f.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
82
+ node.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
87
83
  end
88
- biblio_list(f, div, true)
84
+ biblio_list(node, div, true)
89
85
  end
90
86
  end
91
87
 
92
88
  def annex_name(_annex, name, div)
93
- preceding_floating_titles(name, div)
94
89
  return if name.nil?
95
90
 
96
91
  div.h1 class: "Annex" do |t|
@@ -114,32 +109,6 @@ module IsoDoc
114
109
  end
115
110
  end
116
111
 
117
- def make_body2(body, docxml)
118
- body.div class: "WordSection2" do |div2|
119
- boilerplate docxml, div2
120
- front docxml, div2
121
- div2.p { |p| p << "&#xa0;" } # placeholder
122
- end
123
- section_break(body)
124
- end
125
-
126
- def middle(isoxml, out)
127
- middle_title(isoxml, out)
128
- middle_admonitions(isoxml, out)
129
- i = isoxml.at(ns("//sections/introduction")) and
130
- introduction i, out
131
- scope isoxml, out, 0
132
- norm_ref isoxml, out, 0
133
- clause_etc isoxml, out, 0
134
- annex isoxml, out
135
- bibliography isoxml, out
136
- end
137
-
138
- def make_body3(body, docxml)
139
- super
140
- commentary docxml, body
141
- end
142
-
143
112
  def footnote_parse(node, out)
144
113
  return table_footnote_parse(node, out) if @in_table || @in_figure # &&
145
114
 
@@ -161,23 +130,20 @@ module IsoDoc
161
130
  @seen_footnote << fn
162
131
  end
163
132
 
164
- def annex(isoxml, out)
165
- amd(isoxml) and @suppressheadingnumbers = @oldsuppressheadingnumbers
166
- isoxml.xpath(ns("//annex[not(@commentary = 'true')]")).each do |c|
167
- page_break(out)
168
- render_annex(out, c)
169
- end
170
- amd(isoxml) and @suppressheadingnumbers = true
133
+ def annex(node, out)
134
+ node["commentary"] == "true" and return commentary(node, out)
135
+ amd(node.document.root) and
136
+ @suppressheadingnumbers = @oldsuppressheadingnumbers
137
+ page_break(out)
138
+ render_annex(out, node)
139
+ amd(node.document.root) and @suppressheadingnumbers = true
171
140
  end
172
141
 
173
- def commentary(isoxml, out)
174
- isoxml.xpath(ns("//annex[@commentary = 'true']")).each do |c|
175
- out.span style: "mso-bookmark:PRECOMMENTARYPAGEREF"
176
- section_break(out)
177
- out.div class: "WordSectionCommentary" do |div|
178
- commentary_title(isoxml, div)
179
- render_annex(div, c)
180
- end
142
+ def commentary(node, out)
143
+ out.span style: "mso-bookmark:PRECOMMENTARYPAGEREF"
144
+ section_break(out)
145
+ out.div class: "WordSectionCommentary" do |div|
146
+ render_annex(div, node)
181
147
  end
182
148
  end
183
149
 
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.2 -->
20
+ <!-- VERSION v1.2.3 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -192,9 +192,11 @@
192
192
  </attribute>
193
193
  </optional>
194
194
  <attribute name="citeas"/>
195
- <attribute name="type">
196
- <ref name="ReferenceFormat"/>
197
- </attribute>
195
+ <optional>
196
+ <attribute name="type">
197
+ <ref name="ReferenceFormat"/>
198
+ </attribute>
199
+ </optional>
198
200
  <optional>
199
201
  <attribute name="alt"/>
200
202
  </optional>
@@ -836,6 +838,26 @@
836
838
  <ref name="paragraph"/>
837
839
  </element>
838
840
  </define>
841
+ <define name="stem">
842
+ <element name="stem">
843
+ <attribute name="type">
844
+ <choice>
845
+ <value>MathML</value>
846
+ <value>AsciiMath</value>
847
+ <value>LatexMath</value>
848
+ </choice>
849
+ </attribute>
850
+ <attribute name="block">
851
+ <data type="boolean"/>
852
+ </attribute>
853
+ <oneOrMore>
854
+ <choice>
855
+ <text/>
856
+ <ref name="AnyElement"/>
857
+ </choice>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
839
861
  <define name="em">
840
862
  <element name="em">
841
863
  <zeroOrMore>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module JIS
3
- VERSION = "0.0.9".freeze
3
+ VERSION = "0.1.0".freeze
4
4
  end
5
5
  end
6
6
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
32
32
 
33
- spec.add_dependency "metanorma-iso", "~> 2.4.2"
33
+ spec.add_dependency "metanorma-iso", "~> 2.5.0"
34
34
  #spec.add_dependency "relaton-bipm", "~> 1.14.8"
35
35
  #spec.add_dependency "relaton-iho", "~> 1.14.3"
36
36
  spec.add_dependency "pubid-jis"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-07 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.2
19
+ version: 2.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.2
26
+ version: 2.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pubid-jis
29
29
  requirement: !ruby/object:Gem::Requirement