metanorma-iso 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe27e81a226e0eb506a4cf4cc1c80d482e25ef5e9866577a2cd42689852e2b50
4
- data.tar.gz: 4dd394c88bcf6ff2d1a47c179b20fa957e2fae882aad6fa54b19dfda62b8b8ae
3
+ metadata.gz: da80e1829e3bb23b48ec255ec0d6533f4649eb2ad68c226213bc79715ae2b1a4
4
+ data.tar.gz: 91fde5d59c47042e11426c4b66128acd946302786345f30aead55e0783b30297
5
5
  SHA512:
6
- metadata.gz: c7772933f31a12224a87c36f2a520763b664ca6c6aa6f25a7372392fa77487923a8c879d5493b0d3b7bf4e99e65c4b33a6eb31b95e392a5793652339c958990a
7
- data.tar.gz: 6d287c011e5b7192842ff3b4dbc789a75c68d1b5e4e64ce3082be51aac60f9fcc7579d550c38f7d7cd88fab3d912ec7e1ea7f42dd4dc21a29afb380ad8d5d8f2
6
+ metadata.gz: a20bb43d79f3e9590238a0f115d70d149d14b8ee5884e97898f7ab40f8fcc5cf6855bb5065d90e3931f763d620a68dba936ad79a0a7d87e42e31289a5273b1da
7
+ data.tar.gz: d9ed11afc2c9ba8ed9964106dc9ebdbbde7278be5b06036e4ba7150a2a0501bd968a10bf7f31cf98c96cb713cb0cd9950b4b47431f91471ce1831b8f454b2bec
@@ -384,7 +384,7 @@
384
384
  </define>
385
385
  <define name="LocalityType">
386
386
  <data type="string">
387
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|example|volume|issue|locality:[a-zA-Z0-9_]+</param>
387
+ <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|locality:[a-zA-Z0-9_]+</param>
388
388
  </data>
389
389
  </define>
390
390
  <define name="referenceFrom">
@@ -700,8 +700,12 @@
700
700
  <ref name="btitle"/>
701
701
  <ref name="formattedref"/>
702
702
  </choice>
703
- <ref name="bplace"/>
704
- <ref name="seriesorganization"/>
703
+ <optional>
704
+ <ref name="bplace"/>
705
+ </optional>
706
+ <optional>
707
+ <ref name="seriesorganization"/>
708
+ </optional>
705
709
  <optional>
706
710
  <ref name="abbreviation"/>
707
711
  </optional>
@@ -20,6 +20,9 @@
20
20
  <!-- add type to docidentifier in isodoc? -->
21
21
  <define name="docidentifier">
22
22
  <element name="docidentifier">
23
+ <optional>
24
+ <attribute name="type"/>
25
+ </optional>
23
26
  <choice>
24
27
  <text/>
25
28
  <group>
@@ -108,6 +111,27 @@
108
111
  <zeroOrMore>
109
112
  <ref name="docrelation"/>
110
113
  </zeroOrMore>
114
+ <zeroOrMore>
115
+ <ref name="series"/>
116
+ </zeroOrMore>
117
+ <optional>
118
+ <ref name="medium"/>
119
+ </optional>
120
+ <zeroOrMore>
121
+ <ref name="bplace"/>
122
+ </zeroOrMore>
123
+ <zeroOrMore>
124
+ <ref name="extent"/>
125
+ </zeroOrMore>
126
+ <zeroOrMore>
127
+ <ref name="accesslocation"/>
128
+ </zeroOrMore>
129
+ <optional>
130
+ <ref name="bclassification"/>
131
+ </optional>
132
+ <optional>
133
+ <ref name="validity"/>
134
+ </optional>
111
135
  <optional>
112
136
  <ref name="editorialgroup"/>
113
137
  </optional>
@@ -164,6 +188,27 @@
164
188
  <zeroOrMore>
165
189
  <ref name="docrelation"/>
166
190
  </zeroOrMore>
191
+ <zeroOrMore>
192
+ <ref name="series"/>
193
+ </zeroOrMore>
194
+ <optional>
195
+ <ref name="medium"/>
196
+ </optional>
197
+ <zeroOrMore>
198
+ <ref name="bplace"/>
199
+ </zeroOrMore>
200
+ <zeroOrMore>
201
+ <ref name="extent"/>
202
+ </zeroOrMore>
203
+ <zeroOrMore>
204
+ <ref name="accesslocation"/>
205
+ </zeroOrMore>
206
+ <optional>
207
+ <ref name="bclassification"/>
208
+ </optional>
209
+ <optional>
210
+ <ref name="validity"/>
211
+ </optional>
167
212
  <ref name="editorialgroup"/>
168
213
  <zeroOrMore>
169
214
  <ref name="ics"/>
@@ -866,7 +911,7 @@
866
911
  </element>
867
912
  </define>
868
913
  <define name="allParts">
869
- <element name="allParts">
914
+ <element name="allparts">
870
915
  <data type="boolean"/>
871
916
  </element>
872
917
  </define>
@@ -954,17 +999,13 @@
954
999
  <optional>
955
1000
  <ref name="section-title"/>
956
1001
  </optional>
957
- <choice>
958
- <oneOrMore>
1002
+ <zeroOrMore>
1003
+ <choice>
959
1004
  <ref name="term-clause"/>
960
- </oneOrMore>
961
- <zeroOrMore>
962
- <choice>
963
- <ref name="terms"/>
964
- <ref name="definitions"/>
965
- </choice>
966
- </zeroOrMore>
967
- </choice>
1005
+ <ref name="terms"/>
1006
+ <ref name="definitions"/>
1007
+ </choice>
1008
+ </zeroOrMore>
968
1009
  </element>
969
1010
  </define>
970
1011
  <define name="reference-clause">
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module ISO
3
- VERSION = "1.0.2".freeze
3
+ VERSION = "1.0.3".freeze
4
4
  end
5
5
  end
@@ -273,6 +273,7 @@ p.AltTerms {
273
273
 
274
274
  p.Terms {
275
275
  font-weight: bold;
276
+ margin-top: 0em;
276
277
  }
277
278
 
278
279
 
@@ -275,6 +275,7 @@ p.AltTerms {
275
275
 
276
276
  p.Terms {
277
277
  font-weight: bold;
278
+ margin-top: 0em;
278
279
  }
279
280
 
280
281
  /* Navigation*/
@@ -119,7 +119,8 @@ module IsoDoc
119
119
  ret = ", 第#{from.text}" if from
120
120
  ret += "&ndash;#{to}" if to
121
121
  loc = (@locality[type] || type.sub(/^locality:/, "").capitalize )
122
- ret += " #{loc}" unless subsection && type == "clause" || target.match(/^IEV$/)
122
+ ret += " #{loc}" unless subsection && type == "clause" || type == "list" || target.match(/^IEV$/)
123
+ ret += ")" if type == "list"
123
124
  ret
124
125
  end
125
126
 
@@ -128,9 +129,10 @@ module IsoDoc
128
129
  return l10n(eref_localities1_zh(target, type, from, to)) if lang == "zh"
129
130
  ret = ","
130
131
  loc = @locality[type] || type.sub(/^locality:/, "").capitalize
131
- ret += " #{loc}" unless subsection && type == "clause" || target.match(/^IEV$/)
132
+ ret += " #{loc}" unless subsection && type == "clause" || type == "list" || target.match(/^IEV$/)
132
133
  ret += " #{from.text}" if from
133
134
  ret += "&ndash;#{to.text}" if to
135
+ ret += ")" if type == "list"
134
136
  l10n(ret)
135
137
  end
136
138
  end
@@ -137,12 +137,13 @@ module IsoDoc
137
137
  end
138
138
  end
139
139
 
140
- def eref_localities1_zh(target, type, from, to)
140
+ def eref_localities1_zh(target, type, from, to)
141
141
  subsection = from&.text&.match(/\./)
142
142
  ret = ", 第#{from.text}" if from
143
143
  ret += "&ndash;#{to}" if to
144
144
  loc = (@locality[type] || type.sub(/^locality:/, "").capitalize )
145
- ret += " #{loc}" unless subsection && type == "clause" || target.match(/^IEV$/)
145
+ ret += " #{loc}" unless subsection && type == "clause" || type == "list" || target.match(/^IEV$/)
146
+ ret += ")" if type == "list"
146
147
  ret
147
148
  end
148
149
 
@@ -151,9 +152,10 @@ module IsoDoc
151
152
  return l10n(eref_localities1_zh(target, type, from, to)) if lang == "zh"
152
153
  ret = ","
153
154
  loc = @locality[type] || type.sub(/^locality:/, "").capitalize
154
- ret += " #{loc}" unless subsection && type == "clause" || target.match(/^IEV$/)
155
+ ret += " #{loc}" unless subsection && type == "clause" || type == "list" || target.match(/^IEV$/)
155
156
  ret += " #{from.text}" if from
156
157
  ret += "&ndash;#{to.text}" if to
158
+ ret += ")" if type == "list"
157
159
  l10n(ret)
158
160
  end
159
161
  end
@@ -337,7 +337,7 @@ RSpec.describe Asciidoctor::ISO do
337
337
  <abbreviation>ISO</abbreviation>
338
338
  </organization>
339
339
  </contributor>
340
- <allParts>true</allParts>
340
+ <allparts>true</allparts>
341
341
  </bibitem>
342
342
  </references>
343
343
  </bibliography>
@@ -318,7 +318,7 @@ RSpec.describe Asciidoctor::ISO do
318
318
 
319
319
  INPUT
320
320
  #{BLANK_HDR}
321
- <termdocsource bibitemid="iso1234" type="inline"/><termdocsource bibitemid="iso5678" type="inline"/>
321
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
322
322
  <preface><foreword obligation="informative">
323
323
  <title>Foreword</title>
324
324
  <p id="_">Foreword</p>
data/spec/assets/iso.doc CHANGED
@@ -1,7 +1,7 @@
1
1
  MIME-Version: 1.0
2
- Content-Type: multipart/related; boundary="----=_NextPart_f1bb7f88.630f.42d2"
2
+ Content-Type: multipart/related; boundary="----=_NextPart_c65e6679.db03.4744"
3
3
 
4
- ------=_NextPart_f1bb7f88.630f.42d2
4
+ ------=_NextPart_c65e6679.db03.4744
5
5
  Content-Location: file:///C:/Doc/spec/assets/iso.htm
6
6
  Content-Type: text/html; charset="utf-8"
7
7
 
@@ -19,13 +19,12 @@ Content-Type: text/html; charset="utf-8"
19
19
  <meta http-equiv=Content-Type content="text/html; charset=utf-8"/>
20
20
 
21
21
  <link rel=File-List href="spec/assets/iso_files/filelist.xml"/>
22
- <meta http-equiv=Content-Type content="text/html; charset=UTF-8"/>
23
- <title>spec/assets/iso</title><style>
22
+ <style>
24
23
  <!--
25
24
  /* one empty stylesheet */
26
25
 
27
26
  -->
28
- </style>
27
+ </style><meta http-equiv=Content-Type content="text/html; charset=UTF-8"/>
29
28
  <style>
30
29
  <!--
31
30
  p.Sourcecode, li.Sourcecode, div.Sourcecode, pre.Sourcecode {
@@ -844,11 +843,11 @@ Switzerland<p class="MsoNormal"></p></span></p>
844
843
  <p class="MsoToc1"><span lang="EN-GB" xml:lang="EN-GB"><span style="mso-element:field-begin"></span><span style="mso-spacerun:yes">&#xA0;</span>TOC
845
844
  \o "1-2" \h \z \u <span style="mso-element:field-separator"></span></span>
846
845
  <span class="MsoHyperlink"><span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
847
- <a href="#_Toc663335066">Foreword<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
846
+ <a href="#_Toc586635060">Foreword<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
848
847
  <span style="mso-tab-count:1 dotted">. </span>
849
848
  </span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
850
849
  <span style="mso-element:field-begin"></span></span>
851
- <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc663335066 \h </span>
850
+ <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc586635060 \h </span>
852
851
  <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-separator"></span></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">1</span>
853
852
  <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-end"></span></span></a></span></span></p>
854
853
 
@@ -881,7 +880,7 @@ Switzerland<p class="MsoNormal"></p></span></p>
881
880
  </html>
882
881
 
883
882
 
884
- ------=_NextPart_f1bb7f88.630f.42d2
883
+ ------=_NextPart_c65e6679.db03.4744
885
884
  Content-Location: file:///C:/Doc/spec/assets/iso_files/filelist.xml
886
885
  Content-Transfer-Encoding: base64
887
886
  Content-Type: application/xml
@@ -891,7 +890,7 @@ ICAgICAgIDxvOk1haW5GaWxlIEhSZWY9Ii4uL3NwZWMvYXNzZXRzL2lzby5odG0iLz4gIDxvOkZp
891
890
  bGUgSFJlZj0iZmlsZWxpc3QueG1sIi8+CiAgPG86RmlsZSBIUmVmPSJoZWFkZXIuaHRtbCIvPgo8
892
891
  L3htbD4K
893
892
 
894
- ------=_NextPart_f1bb7f88.630f.42d2
893
+ ------=_NextPart_c65e6679.db03.4744
895
894
  Content-Location: file:///C:/Doc/spec/assets/iso_files/header.html
896
895
  Content-Transfer-Encoding: base64
897
896
  Content-Type: text/html charset="utf-8"
@@ -1084,4 +1083,4 @@ cD4NCg0KPHAgY2xhc3M9TXNvRm9vdGVyPjxzcGFuIGxhbmc9RU4tQVUgc3R5bGU9J2ZvbnQtc2l6
1084
1083
  ZToxMC4wcHQ7Jz7CqQ0KJm5ic3A7Jm5ic3A74oCTIEFsbCByaWdodHMgcmVzZXJ2ZWQ8bzpwPjwv
1085
1084
  bzpwPjwvc3Bhbj48L3A+DQoNCjwvZGl2Pg0KDQoNCg0KPC9ib2R5Pg0KDQo8L2h0bWw+DQo=
1086
1085
 
1087
- ------=_NextPart_f1bb7f88.630f.42d2--
1086
+ ------=_NextPart_c65e6679.db03.4744--
data/spec/assets/iso.html CHANGED
@@ -1,14 +1,13 @@
1
1
  <?xml version="1.0"?>
2
2
  <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
3
  <html xmlns:epub="http://www.idpf.org/2007/ops">
4
- <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <title>spec/assets/iso</title><style>
4
+ <head><style>
6
5
  <!--
7
6
  /* another empty stylesheet */
8
7
 
9
8
  -->
10
- </style>
11
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
9
+ </style><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title>
10
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
12
11
 
13
12
  <!--TOC script import-->
14
13
  <script type="text/javascript" src="https://cdn.rawgit.com/jgallen23/toc/0.3.2/dist/toc.min.js"></script>
@@ -205,6 +205,7 @@ RSpec.describe IsoDoc do
205
205
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
206
206
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
207
207
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
208
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="list"><referenceFrom>a</referenceFrom></locality></eref>
208
209
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
209
210
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
210
211
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
@@ -239,6 +240,7 @@ RSpec.describe IsoDoc do
239
240
  <a href="#ISO712">ISO 712, Table 1</a>
240
241
  <a href="#ISO712">ISO 712, Table 1&#8211;1</a>
241
242
  <a href="#ISO712">ISO 712, Clause 1, Table 1</a>
243
+ <a href="#ISO712">ISO 712, Clause 1, a)</a>
242
244
  <a href="#ISO712">ISO 712, Clause 1</a>
243
245
  <a href="#ISO712">ISO 712, 1.5</a>
244
246
  <a href="#ISO712">A</a>
@@ -6,6 +6,11 @@ RSpec.describe IsoDoc do
6
6
  system "rm -f test.html"
7
7
  IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", filename: "test"}).convert("test", <<~"INPUT", false)
8
8
  <iso-standard xmlns="http://riboseinc.com/isoxml">
9
+ <title>
10
+ <title-intro language="en" format="text/plain">Cereals and pulses</title-intro>
11
+ <title-main language="en" format="text/plain">Specifications and test methods</title-main>
12
+ <title-part language="en" format="text/plain">Rice</title-part>
13
+ </title>
9
14
  <preface><foreword>
10
15
  <note>
11
16
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
@@ -15,7 +20,7 @@ RSpec.describe IsoDoc do
15
20
  INPUT
16
21
  expect(File.exist?("test.html")).to be true
17
22
  html = File.read("test.html")
18
- expect(html).to match(%r{<title>test</title><style>})
23
+ expect(html).to match(%r{<title>Cereals and pulses\&nbsp;\&mdash; Specifications and test methods\&nbsp;\&mdash; Rice</title>})
19
24
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/2\.7\.1/MathJax\.js})
20
25
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
21
26
  end
@@ -25,6 +30,11 @@ RSpec.describe IsoDoc do
25
30
  system "rm -f test.html"
26
31
  IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
27
32
  <iso-standard xmlns="http://riboseinc.com/isoxml">
33
+ <title>
34
+ <title-intro language="en" format="text/plain">Cereals and pulses</title-intro>
35
+ <title-main language="en" format="text/plain">Specifications and test methods</title-main>
36
+ <title-part language="en" format="text/plain">Rice</title-part>
37
+ </title>
28
38
  <preface><foreword>
29
39
  <note>
30
40
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
@@ -34,7 +44,7 @@ RSpec.describe IsoDoc do
34
44
  INPUT
35
45
  expect(File.exist?("test.html")).to be true
36
46
  html = File.read("test.html")
37
- expect(html).to match(%r{<title>test</title><style>})
47
+ expect(html).to match(%r{<title>Cereals and pulses\&nbsp;\&mdash; Specifications and test methods\&nbsp;\&mdash; Rice</title>})
38
48
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/2\.7\.1/MathJax\.js})
39
49
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
40
50
  end
data/spec/spec_helper.rb CHANGED
@@ -135,9 +135,7 @@ HDR
135
135
 
136
136
  HTML_HDR = <<~END
137
137
  <html xmlns:epub="http://www.idpf.org/2007/ops">
138
- <head>
139
- <title>test</title>
140
- </head>
138
+ <head/>
141
139
  <body lang="EN-US" link="blue" vlink="#954F72">
142
140
  <div class="title-section">
143
141
  <p>&#160;</p>
@@ -152,9 +150,9 @@ END
152
150
 
153
151
  WORD_HDR = <<~END
154
152
  <html xmlns:epub="http://www.idpf.org/2007/ops">
155
- <head>
156
- <title>test</title>
157
- </head>
153
+ <head>
154
+ <title>test</title>
155
+ </head>
158
156
  <body lang="EN-US" link="blue" vlink="#954F72">
159
157
  <div class="WordSection1">
160
158
  <p>&#160;</p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-21 00:00:00.000000000 Z
11
+ date: 2018-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor