metanorma-standoc 1.1.7 → 1.1.8

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: 2989c386041bf221f5c9627ff57765b18b1bd1990891eec48add7dfd3b14ef8e
4
- data.tar.gz: 4eea2a64da042dcb8bc14d12a74d630a006ae8f7ac79654f95eec64426525427
3
+ metadata.gz: 824b1e03a0d0ad3473df22d417991f5e7a1dbf551143d0a810c3b0d66a126f4e
4
+ data.tar.gz: 67a0fe247f7c6bf8339bcd8e0188a2b301b44fd865d8c171bd39508ca42f6246
5
5
  SHA512:
6
- metadata.gz: 7e928dc4b5ab62caf6a69a7b17d52f7ac95a67cdec4b957e8b61c3f0bff40840416d7e664d963ade8e6ea82f4d85154f76495ad21acbf8eb102f95da60cc6dd3
7
- data.tar.gz: 7968ee76f47e1faf852b218652594a815cc36bcf24d2b66389fe032e47f54981c476e1dee212b45485e07003e388a4c327ec61729fa1ad9737f7c716e56af0cb
6
+ metadata.gz: e1a583f8f45b49cc1645bda7eea76e45750eadec72abc248db93e980fde9d96525e6c2fa80de2092ca0db4b58b5e58159621059ceab9a4a383ecc4a67a4a8202
7
+ data.tar.gz: 7dfff1109a7d3fb6905840170fe738c94301c3521c65786702a5f6055756885acb20f0cf013ead5d1004bfe6e9b558bb9e679f4d45ee73e9d1cef8cbfb8d9219
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- metanorma-standoc (1.1.7)
11
+ metanorma-standoc (1.1.8)
12
12
  asciidoctor (~> 1.5.7)
13
13
  concurrent-ruby
14
14
  html2doc (~> 0.8.0)
@@ -61,7 +61,7 @@ GEM
61
61
  guard (~> 2.1)
62
62
  guard-compat (~> 1.1)
63
63
  rspec (>= 2.99.0, < 4.0)
64
- hashdiff (0.3.8)
64
+ hashdiff (0.3.9)
65
65
  html2doc (0.8.10)
66
66
  asciimath (~> 1.0.7)
67
67
  htmlentities (~> 4.3.4)
@@ -75,7 +75,7 @@ GEM
75
75
  iecbib (0.2.2)
76
76
  addressable
77
77
  iso-bib-item (~> 0.4.2)
78
- ietfbib (0.4.5)
78
+ ietfbib (0.4.6)
79
79
  iso-bib-item (~> 0.4.2)
80
80
  iev (0.2.2)
81
81
  nokogiri
@@ -88,7 +88,7 @@ GEM
88
88
  algoliasearch
89
89
  iecbib (~> 0.2.1)
90
90
  iso-bib-item (~> 0.4.2)
91
- isodoc (0.9.21)
91
+ isodoc (0.9.22)
92
92
  asciimath
93
93
  html2doc (~> 0.8.6)
94
94
  htmlentities (~> 4.3.4)
@@ -117,7 +117,7 @@ GEM
117
117
  mime-types-data (3.2019.0331)
118
118
  mini_portile2 (2.3.0)
119
119
  nenv (0.3.0)
120
- nistbib (0.1.1)
120
+ nistbib (0.1.2)
121
121
  iso-bib-item (~> 0.4.2)
122
122
  nokogiri (1.8.5)
123
123
  mini_portile2 (~> 2.3.0)
@@ -153,7 +153,7 @@ GEM
153
153
  rspec-mocks (~> 3.8.0)
154
154
  rspec-core (3.8.0)
155
155
  rspec-support (~> 3.8.0)
156
- rspec-expectations (3.8.2)
156
+ rspec-expectations (3.8.3)
157
157
  diff-lcs (>= 1.2.0, < 2.0)
158
158
  rspec-support (~> 3.8.0)
159
159
  rspec-mocks (3.8.0)
@@ -810,6 +810,9 @@
810
810
  </define>
811
811
  <define name="biblionote">
812
812
  <element name="note">
813
+ <optional>
814
+ <attribute name="type"/>
815
+ </optional>
813
816
  <ref name="FormattedString"/>
814
817
  </element>
815
818
  </define>
@@ -10,12 +10,13 @@ module Asciidoctor
10
10
  module Standoc
11
11
  module Cleanup
12
12
  def para_cleanup(xmldoc)
13
- xmldoc.xpath("//p[not(@id)]").each do |x|
14
- x["id"] = Utils::anchor_or_uuid
15
- end
16
- xmldoc.xpath("//note[not(@id)][not(ancestor::bibitem)]"\
17
- "[not(ancestor::table)]").each do |x|
18
- x["id"] = Utils::anchor_or_uuid
13
+ inject_id(xmldoc, "//p | //ol | //ul")
14
+ inject_id(xmldoc, "//note[not(ancestor::bibitem)][not(ancestor::table)]")
15
+ end
16
+
17
+ def inject_id(xmldoc, path)
18
+ xmldoc.xpath(path).each do |x|
19
+ x["id"] ||= Utils::anchor_or_uuid
19
20
  end
20
21
  end
21
22
 
@@ -81,16 +81,12 @@ module Asciidoctor
81
81
  node.attr("affiliation#{suffix}") and p.affiliation do |a|
82
82
  a.organization do |o|
83
83
  o.name node.attr("affiliation#{suffix}")
84
- node.attr("address#{suffix}") and o.contact do |c|
85
- c.address do |ad|
86
- ad.formattedAddress node.attr("address#{suffix}")
87
- end
84
+ node.attr("address#{suffix}") and o.address do |ad|
85
+ ad.formattedAddress node.attr("address#{suffix}")
88
86
  end
89
87
  end
90
88
  end
91
- node.attr("email#{suffix}") and p.contact do |c|
92
- c.email node.attr("email#{suffix}")
93
- end
89
+ node.attr("email#{suffix}") and p.email node.attr("email#{suffix}")
94
90
  node.attr("contributor-uri#{suffix}") and p.uri node.attr("contributor-uri#{suffix}")
95
91
  end
96
92
  end
@@ -180,6 +176,32 @@ module Asciidoctor
180
176
  xml.script (node.attr("script") || "Latn")
181
177
  end
182
178
 
179
+ def relaton_relations
180
+ %w(part-of)
181
+ end
182
+
183
+ def metadata_relations(node, xml)
184
+ relaton_relations.each do |t|
185
+ metadata_getrelation(node, xml, t)
186
+ end
187
+ end
188
+
189
+ def relation_normalise(type)
190
+ type.sub(/-by$/, "By").sub(/-of$/, "Of")
191
+ end
192
+
193
+ def metadata_getrelation(node, xml, type)
194
+ docs = node.attr(type) || return
195
+ docs.split(/,/).each do |d|
196
+ xml.relation **{ type: relation_normalise(type) } do |r|
197
+ fetch_ref(r, d, nil, {}) or r.bibitem do |b|
198
+ b.title "--"
199
+ b.docidentifier d
200
+ end
201
+ end
202
+ end
203
+ end
204
+
183
205
  def metadata(node, xml)
184
206
  title node, xml
185
207
  metadata_source(node, xml)
@@ -188,14 +210,19 @@ module Asciidoctor
188
210
  metadata_author(node, xml)
189
211
  metadata_publisher(node, xml)
190
212
  metadata_version(node, xml)
213
+ metadata_note(node, xml)
191
214
  metadata_language(node, xml)
192
215
  metadata_script(node, xml)
193
216
  metadata_status(node, xml)
194
217
  metadata_copyright(node, xml)
218
+ metadata_relations(node, xml)
195
219
  metadata_committee(node, xml)
196
220
  metadata_ics(node, xml)
197
221
  end
198
222
 
223
+ def metadata_note(node, xml)
224
+ end
225
+
199
226
  def asciidoc_sub(x)
200
227
  return nil if x.nil?
201
228
  return "" if x.empty?
@@ -735,6 +735,20 @@
735
735
  <ref name="bookmark"/>
736
736
  </choice>
737
737
  </define>
738
+ <define name="PureTextElement">
739
+ <choice>
740
+ <text/>
741
+ <ref name="em"/>
742
+ <ref name="strong"/>
743
+ <ref name="sub"/>
744
+ <ref name="sup"/>
745
+ <ref name="tt"/>
746
+ <ref name="keyword"/>
747
+ <ref name="strike"/>
748
+ <ref name="smallcap"/>
749
+ <ref name="br"/>
750
+ </choice>
751
+ </define>
738
752
  <define name="source">
739
753
  <element name="source">
740
754
  <ref name="TypedUri"/>
@@ -742,42 +756,58 @@
742
756
  </define>
743
757
  <define name="em">
744
758
  <element name="em">
745
- <text/>
759
+ <zeroOrMore>
760
+ <ref name="PureTextElement"/>
761
+ </zeroOrMore>
746
762
  </element>
747
763
  </define>
748
764
  <define name="strong">
749
765
  <element name="strong">
750
- <text/>
766
+ <zeroOrMore>
767
+ <ref name="PureTextElement"/>
768
+ </zeroOrMore>
751
769
  </element>
752
770
  </define>
753
771
  <define name="tt">
754
772
  <element name="tt">
755
- <text/>
773
+ <zeroOrMore>
774
+ <ref name="PureTextElement"/>
775
+ </zeroOrMore>
756
776
  </element>
757
777
  </define>
758
778
  <define name="keyword">
759
779
  <element name="keyword">
760
- <text/>
780
+ <zeroOrMore>
781
+ <ref name="PureTextElement"/>
782
+ </zeroOrMore>
761
783
  </element>
762
784
  </define>
763
785
  <define name="sub">
764
786
  <element name="sub">
765
- <text/>
787
+ <zeroOrMore>
788
+ <ref name="PureTextElement"/>
789
+ </zeroOrMore>
766
790
  </element>
767
791
  </define>
768
792
  <define name="sup">
769
793
  <element name="sup">
770
- <text/>
794
+ <zeroOrMore>
795
+ <ref name="PureTextElement"/>
796
+ </zeroOrMore>
771
797
  </element>
772
798
  </define>
773
799
  <define name="strike">
774
800
  <element name="strike">
775
- <text/>
801
+ <zeroOrMore>
802
+ <ref name="PureTextElement"/>
803
+ </zeroOrMore>
776
804
  </element>
777
805
  </define>
778
806
  <define name="smallcap">
779
807
  <element name="smallcap">
780
- <text/>
808
+ <zeroOrMore>
809
+ <ref name="PureTextElement"/>
810
+ </zeroOrMore>
781
811
  </element>
782
812
  </define>
783
813
  <define name="br">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Standoc
3
- VERSION = "1.1.7".freeze
3
+ VERSION = "1.1.8".freeze
4
4
  end
5
5
  end
@@ -95,6 +95,7 @@ RSpec.describe Asciidoctor::Standoc do
95
95
  :address_2: 6A Rubble Way, Bedrock
96
96
  :email_2: barney@rockhead.example.com
97
97
  :publisher: Hanna Barbera, Cartoon Network
98
+ :part-of: ABC
98
99
  INPUT
99
100
  <?xml version="1.0" encoding="UTF-8"?>
100
101
  <standard-document xmlns="http://riboseinc.com/isoxml">
@@ -138,11 +139,6 @@ RSpec.describe Asciidoctor::Standoc do
138
139
  <date type="Jack">
139
140
  <on>1010-01-01</on>
140
141
  </date>
141
- <edition>2</edition>
142
- <version>
143
- <revision-date>2000-01-01</revision-date>
144
- <draft>3.4</draft>
145
- </version>
146
142
  <contributor>
147
143
  <role type="author"/>
148
144
  <organization>
@@ -164,11 +160,9 @@ RSpec.describe Asciidoctor::Standoc do
164
160
  <affiliation>
165
161
  <organization>
166
162
  <name>Slate Rock and Gravel Company</name>
167
- <contact>
168
163
  <address>
169
164
  <formattedAddress>6 Rubble Way, Bedrock</formattedAddress>
170
165
  </address>
171
- </contact>
172
166
  </organization>
173
167
  </affiliation>
174
168
  <uri>http://slate.example.com</uri>
@@ -185,16 +179,12 @@ RSpec.describe Asciidoctor::Standoc do
185
179
  <affiliation>
186
180
  <organization>
187
181
  <name>Rockhead and Quarry Cave Construction Company</name>
188
- <contact>
189
182
  <address>
190
183
  <formattedAddress>6A Rubble Way, Bedrock</formattedAddress>
191
184
  </address>
192
- </contact>
193
185
  </organization>
194
186
  </affiliation>
195
- <contact>
196
187
  <email>barney@rockhead.example.com</email>
197
- </contact>
198
188
  </person>
199
189
  </contributor>
200
190
  <contributor>
@@ -209,6 +199,11 @@ RSpec.describe Asciidoctor::Standoc do
209
199
  <name>Cartoon Network</name>
210
200
  </organization>
211
201
  </contributor>
202
+ <edition>2</edition>
203
+ <version>
204
+ <revision-date>2000-01-01</revision-date>
205
+ <draft>3.4</draft>
206
+ </version>
212
207
  <language>en</language>
213
208
  <script>Latn</script>
214
209
  <status format="plain">published</status>
@@ -228,6 +223,12 @@ RSpec.describe Asciidoctor::Standoc do
228
223
  </organization>
229
224
  </owner>
230
225
  </copyright>
226
+ <relation type="partOf">
227
+ <bibitem>
228
+ <title>--</title>
229
+ <docidentifier>ABC</docidentifier>
230
+ </bibitem>
231
+ </relation>
231
232
  <editorialgroup>
232
233
  <technical-committee number="1" type="A">TC</technical-committee>
233
234
  <technical-committee number="11" type="A1">TC1</technical-committee>
@@ -401,7 +401,7 @@ RSpec.describe Asciidoctor::Standoc do
401
401
  <docidentifier type="IETF">RFC 8341</docidentifier>
402
402
  <docidentifier type="DOI">10.17487/RFC8341</docidentifier>
403
403
  <date type="published">
404
- <on>2018</on>
404
+ <on>2018-03</on>
405
405
  </date>
406
406
  <contributor>
407
407
  <role type="author"/>
@@ -432,6 +432,7 @@ RSpec.describe Asciidoctor::Standoc do
432
432
  </person>
433
433
  </contributor>
434
434
  <language>en</language>
435
+ <script>Latn</script>
435
436
  <series type="main">
436
437
  <title format="plain" language="en" script="Latn">STD</title>
437
438
  <number>91</number>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-14 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor