metanorma-iso 1.5.12 → 1.5.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/lib/asciidoctor/iso/base.rb +5 -0
  4. data/lib/asciidoctor/iso/front.rb +5 -0
  5. data/lib/asciidoctor/iso/isostandard.rng +8 -0
  6. data/lib/isodoc/iso/base_convert.rb +2 -1
  7. data/lib/isodoc/iso/html/htmlstyle.css +1 -1
  8. data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
  9. data/lib/isodoc/iso/html/isodoc.css +42 -42
  10. data/lib/isodoc/iso/html/isodoc.scss +42 -42
  11. data/lib/isodoc/iso/html/style-human.css +9 -9
  12. data/lib/isodoc/iso/html/style-human.scss +7 -7
  13. data/lib/isodoc/iso/html/style-iso.css +7 -7
  14. data/lib/isodoc/iso/html/style-iso.scss +5 -5
  15. data/lib/isodoc/iso/html/wordstyle.css +67 -67
  16. data/lib/isodoc/iso/html/wordstyle.scss +67 -67
  17. data/lib/isodoc/iso/html_convert.rb +4 -0
  18. data/lib/isodoc/iso/iso.amendment.xsl +9 -5
  19. data/lib/isodoc/iso/iso.international-standard.xsl +9 -5
  20. data/lib/isodoc/iso/metadata.rb +1 -0
  21. data/lib/isodoc/iso/word_convert.rb +4 -0
  22. data/lib/isodoc/iso/xref.rb +10 -0
  23. data/lib/metanorma/iso/fonts_manifest.yaml +6 -0
  24. data/lib/metanorma/iso/processor.rb +0 -9
  25. data/lib/metanorma/iso/version.rb +1 -1
  26. data/metanorma-iso.gemspec +1 -1
  27. data/spec/asciidoctor-iso/base_spec.rb +2 -0
  28. data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
  29. data/spec/asciidoctor-iso/lists_spec.rb +6 -6
  30. data/spec/asciidoctor-iso/refs_spec.rb +1 -1
  31. data/spec/asciidoctor-iso/section_spec.rb +5 -0
  32. data/spec/isodoc/metadata_spec.rb +2 -0
  33. data/spec/isodoc/section_spec.rb +20 -0
  34. data/spec/isodoc/xref_spec.rb +12 -0
  35. metadata +5 -7
  36. data/.github/workflows/macos.yml +0 -49
  37. data/.github/workflows/ubuntu.yml +0 -53
  38. data/.github/workflows/windows.yml +0 -50
@@ -166,9 +166,9 @@
166
166
 
167
167
  <xsl:template match="/">
168
168
  <xsl:call-template name="namespaceCheck"/>
169
- <fo:root font-family="Cambria, Times New Roman, Cambria Math, HanSans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
169
+ <fo:root font-family="Cambria, Times New Roman, Cambria Math, Source Han Sans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
170
170
  <xsl:if test="$lang = 'zh'">
171
- <xsl:attribute name="font-family">HanSans, Times New Roman, Cambria Math</xsl:attribute>
171
+ <xsl:attribute name="font-family">Source Han Sans, Times New Roman, Cambria Math</xsl:attribute>
172
172
  </xsl:if>
173
173
  <fo:layout-master-set>
174
174
 
@@ -2547,6 +2547,7 @@
2547
2547
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2548
2548
 
2549
2549
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2550
+
2550
2551
 
2551
2552
 
2552
2553
 
@@ -3911,6 +3912,7 @@
3911
3912
  </fo:inline>
3912
3913
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3913
3914
  <fo:inline font-weight="bold">
3915
+
3914
3916
  <xsl:apply-templates/>
3915
3917
  </fo:inline>
3916
3918
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -4315,6 +4317,7 @@
4315
4317
  </xsl:choose>
4316
4318
  </xsl:variable>
4317
4319
  <fo:inline xsl:use-attribute-sets="link-style">
4320
+
4318
4321
  <xsl:choose>
4319
4322
  <xsl:when test="$target = ''">
4320
4323
  <xsl:apply-templates/>
@@ -4528,7 +4531,8 @@
4528
4531
  </fo:inline>
4529
4532
  </xsl:if>
4530
4533
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4531
- <fo:block-container id="{@id}">
4534
+ <fo:block-container id="{@id}">
4535
+
4532
4536
  <fo:block>
4533
4537
  <xsl:apply-templates/>
4534
4538
  </fo:block>
@@ -4579,7 +4583,7 @@
4579
4583
  <xsl:apply-templates mode="bookmarks"/>
4580
4584
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4581
4585
  <xsl:apply-templates select="."/>
4582
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4586
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4583
4587
  <xsl:apply-templates mode="bookmarks"/>
4584
4588
  </xsl:template><xsl:template name="addBookmarks">
4585
4589
  <xsl:param name="contents"/>
@@ -5317,7 +5321,7 @@
5317
5321
  <fo:block id="{@id}">
5318
5322
  <xsl:apply-templates/>
5319
5323
  </fo:block>
5320
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5324
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5321
5325
 
5322
5326
  <fo:block id="{@id}">
5323
5327
  <xsl:apply-templates/>
@@ -211,6 +211,7 @@ module IsoDoc
211
211
  ics = []
212
212
  isoxml.xpath(ns("//bibdata/ext/ics/code")).each { |i| ics << i.text }
213
213
  set(:ics, ics.empty? ? nil : ics.join(", "))
214
+ a = isoxml.at(ns("//bibdata/ext/horizontal")) and set(:horizontal, a.text)
214
215
  end
215
216
  end
216
217
  end
@@ -21,6 +21,10 @@ module IsoDoc
21
21
  headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
22
22
  '"Cambria",serif'),
23
23
  monospacefont: '"Courier New",monospace',
24
+ normalfontsize: "11.0pt",
25
+ monospacefontsize: "9.0pt",
26
+ smallerfontsize: "10.0pt",
27
+ footnotefontsize: "10.0pt",
24
28
  }
25
29
  end
26
30
 
@@ -34,6 +34,9 @@ module IsoDoc
34
34
  @anchors[c["id"]] = anchor_struct(i + 1, nil, @labels["appendix"], "clause")
35
35
  @anchors[c["id"]][:level] = 2
36
36
  @anchors[c["id"]][:container] = clause["id"]
37
+ c.xpath(ns("./clause | ./references")).each_with_index do |c, j|
38
+ appendix_names1(c, l10n("#{@labels["appendix"]} #{i + 1}.#{j + 1}"), 3, clause["id"])
39
+ end
37
40
  end
38
41
  end
39
42
 
@@ -55,6 +58,13 @@ module IsoDoc
55
58
  end
56
59
  end
57
60
 
61
+ def appendix_names1(clause, num, level, container)
62
+ @anchors[clause["id"]] = { label: num, xref: num, level: level, container: container }
63
+ clause.xpath(ns("./clause | ./references")).each_with_index do |c, i|
64
+ appendix_names1(c, "#{num}.#{i + 1}", level + 1, container)
65
+ end
66
+ end
67
+
58
68
  def hierarchical_formula_names(clause, num)
59
69
  c = IsoDoc::XrefGen::Counter.new
60
70
  clause.xpath(ns(".//formula")).each do |t|
@@ -0,0 +1,6 @@
1
+ ---
2
+ Cambria:
3
+ Cambria Math:
4
+ Times New Roman:
5
+ Source Han Sans:
6
+ Courier New:
@@ -2,15 +2,6 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Iso
5
- def self.fonts_used
6
- {
7
- html: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
8
- html_alt: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
9
- doc: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
10
- pdf: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
11
- }
12
- end
13
-
14
5
  class Processor < Metanorma::Processor
15
6
 
16
7
  def initialize
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.5.12".freeze
3
+ VERSION = "1.5.13".freeze
4
4
  end
5
5
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
31
31
 
32
32
  spec.add_dependency "ruby-jing"
33
- spec.add_dependency "isodoc", "~> 1.2.0"
33
+ spec.add_dependency "isodoc", "~> 1.3.0"
34
34
  spec.add_dependency "metanorma-standoc", "~> 1.6.0"
35
35
  spec.add_dependency "tokenizer", "~> 0.3.0"
36
36
  spec.add_dependency "twitter_cldr"
@@ -99,6 +99,7 @@ RSpec.describe Asciidoctor::ISO do
99
99
  :title-part-fr: Part du Titre
100
100
  :library-ics: 1,2,3
101
101
  :copyright-year: 2000
102
+ :horizontal: true
102
103
  INPUT
103
104
  <?xml version="1.0" encoding="UTF-8"?>
104
105
  <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
@@ -152,6 +153,7 @@ RSpec.describe Asciidoctor::ISO do
152
153
  </copyright>
153
154
  <ext>
154
155
  <doctype>article</doctype>
156
+ <horizontal>true</horizontal>
155
157
  <editorialgroup>
156
158
  <technical-committee number="1" type="A">TC</technical-committee>
157
159
  <technical-committee number="11" type="A1">TC1</technical-committee>
@@ -191,7 +191,7 @@ RSpec.describe Asciidoctor::ISO do
191
191
  #{BLANK_HDR}
192
192
  <sections>
193
193
  <admonition id="_" type="safety precautions"><name>Safety Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
194
- <ol id="_" type="arabic">
194
+ <ol id="_">
195
195
  <li>
196
196
  <p id="_">They are allergic to cinnamon.</p>
197
197
  </li>
@@ -28,7 +28,7 @@ RSpec.describe Asciidoctor::ISO do
28
28
  </li>
29
29
  <li>
30
30
  <p id="_">List 3</p>
31
- <ol id="_" type="arabic">
31
+ <ol id="_">
32
32
  <li>
33
33
  <p id="_">List A</p>
34
34
  </li>
@@ -107,13 +107,13 @@ RSpec.describe Asciidoctor::ISO do
107
107
  <li><p id="_">Second</p><p id="_">entry1</p>
108
108
  <p id="_">entry2</p></li>
109
109
  </ul>
110
- <ol id="id1" type="alphabet">
110
+ <ol id="id1">
111
111
  <li>
112
112
  <p id="_">First</p>
113
113
  </li>
114
114
  <li>
115
115
  <p id="_">Second</p>
116
- <ol id="_" type="alphabet_upper">
116
+ <ol id="_">
117
117
  <li>
118
118
  <p id="_">Third</p>
119
119
  </li>
@@ -129,19 +129,19 @@ RSpec.describe Asciidoctor::ISO do
129
129
  <p id="_">Sixth</p>
130
130
  </li>
131
131
  </ol>
132
- <ol id="_" type="roman">
132
+ <ol id="_">
133
133
  <li>
134
134
  <p id="_">A</p>
135
135
  </li>
136
136
  <li>
137
137
  <p id="_">B</p>
138
- <ol id="_" type="roman_upper">
138
+ <ol id="_">
139
139
  <li>
140
140
  <p id="_">C</p>
141
141
  </li>
142
142
  <li>
143
143
  <p id="_">D</p>
144
- <ol id="_" type="arabic">
144
+ <ol id="_">
145
145
  <li>
146
146
  <p id="_">E</p>
147
147
  </li>
@@ -68,7 +68,7 @@ RSpec.describe Asciidoctor::ISO do
68
68
  <note format='text/plain' type='Unpublished-Status'>The standard is in press</note>
69
69
  </bibitem>
70
70
  <bibitem id='fdis' type='standard'>
71
- <fetched>2020-11-09</fetched>
71
+ <fetched>#{Date.today}</fetched>
72
72
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Traitement de produits de soins de santé</title>
73
73
  <title type='title-main' format='text/plain' language='fr' script='Latn'>
74
74
  Informations relatives au traitement des dispositifs médicaux à
@@ -50,6 +50,8 @@ RSpec.describe Asciidoctor::ISO do
50
50
  [%appendix]
51
51
  === Appendix 1
52
52
 
53
+ ==== Appendix subclause
54
+
53
55
  == Bibliography
54
56
 
55
57
  === Bibliography Subsection
@@ -136,6 +138,9 @@ standardization at the following addresses:</p>
136
138
  </clause>
137
139
  <appendix id="_" inline-header="false" obligation="normative">
138
140
  <title>Appendix 1</title>
141
+ <clause id='_' inline-header='false' obligation='normative'>
142
+ <title>Appendix subclause</title>
143
+ </clause>
139
144
  </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
140
145
  <title>Normative references</title>
141
146
  <p id="_">There are no normative references in this document.</p>
@@ -64,6 +64,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
64
64
  <keyword>kw1</keyword>
65
65
  <ext>
66
66
  <doctype>international-standard</doctype>
67
+ <horizontal>true</horizontal>
67
68
  <editorialgroup>
68
69
  <technical-committee number="34">Food products</technical-committee>
69
70
  <subcommittee number="4">Cereals and pulses</subcommittee>
@@ -106,6 +107,7 @@ INPUT
106
107
  :draftinfo=>" (draft 0.4, 2016-05-01)",
107
108
  :edition=>"2",
108
109
  :editorialgroup=>["TC 34", "SC 4", "WG 3"],
110
+ :horizontal=>"true",
109
111
  :implementeddate=>"XXX",
110
112
  :issueddate=>"XXX",
111
113
  :keywords=>["kw2", "kw1"],
@@ -55,6 +55,9 @@ RSpec.describe IsoDoc do
55
55
  </clause>
56
56
  <appendix id="Q2" inline-header="false" obligation="normative">
57
57
  <title>An Appendix</title>
58
+ <clause id='Q2a' inline-header='false' obligation='normative'>
59
+ <title>Appendix subclause</title>
60
+ </clause>
58
61
  </appendix>
59
62
  <references id="Q3" normative="false"><title>Annex Bibliography</title></references>
60
63
  </annex><bibliography><references id="R" obligation="informative" normative="true">
@@ -140,6 +143,13 @@ RSpec.describe IsoDoc do
140
143
  </clause>
141
144
  <appendix id='Q2' inline-header='false' obligation='normative'>
142
145
  <title depth='2'>Appendix 1<tab/>An Appendix</title>
146
+ <clause id='Q2a' inline-header='false' obligation='normative'>
147
+ <title depth='3'>
148
+ Appendix 1.1
149
+ <tab/>
150
+ Appendix subclause
151
+ </title>
152
+ </clause>
143
153
  </appendix>
144
154
  <references id='Q3' normative='false'>
145
155
  <title depth='2'>A.2<tab/>Annex Bibliography</title>
@@ -222,6 +232,9 @@ RSpec.describe IsoDoc do
222
232
  </div>
223
233
  <div id="Q2">
224
234
  <h2>Appendix 1&#160; An Appendix</h2>
235
+ <div id='Q2a'>
236
+ <h3> Appendix 1.1 &#160; Appendix subclause </h3>
237
+ </div>
225
238
  </div>
226
239
  <div>
227
240
  <h2 class="Section3">A.2&#160; Annex Bibliography</h2>
@@ -318,6 +331,13 @@ OUTPUT
318
331
  </div>
319
332
  <div id="Q2">
320
333
  <h2>Appendix 1<span style="mso-tab-count:1">&#160; </span>An Appendix</h2>
334
+ <div id='Q2a'>
335
+ <h3>
336
+ Appendix 1.1
337
+ <span style='mso-tab-count:1'>&#160; </span>
338
+ Appendix subclause
339
+ </h3>
340
+ </div>
321
341
  </div>
322
342
  <div>
323
343
  <h2 class='Section3'>
@@ -936,6 +936,7 @@ RSpec.describe IsoDoc do
936
936
  <xref target="Q"/>
937
937
  <xref target="Q1"/>
938
938
  <xref target="Q2"/>
939
+ <xref target="Q3"/>
939
940
  <xref target="R"/>
940
941
  </p>
941
942
  </foreword>
@@ -985,6 +986,9 @@ RSpec.describe IsoDoc do
985
986
  </clause>
986
987
  <appendix id="Q2" inline-header="false" obligation="normative">
987
988
  <title>An Appendix</title>
989
+ <clause id='Q3' inline-header='false' obligation='normative'>
990
+ <title>Appendix subclause</title>
991
+ </clause>
988
992
  </appendix>
989
993
  </annex><bibliography><references id="R" obligation="informative" normative="true">
990
994
  <title>Normative References</title>
@@ -1019,6 +1023,7 @@ RSpec.describe IsoDoc do
1019
1023
  <xref target='Q'>A.1</xref>
1020
1024
  <xref target='Q1'>A.1.1</xref>
1021
1025
  <xref target='Q2'>Annex A, Appendix 1</xref>
1026
+ <xref target='Q3'>Annex A, Appendix 1.1</xref>
1022
1027
  <xref target='R'>Clause 2</xref>
1023
1028
  </p>
1024
1029
  </foreword>
@@ -1126,6 +1131,13 @@ RSpec.describe IsoDoc do
1126
1131
  <tab/>
1127
1132
  An Appendix
1128
1133
  </title>
1134
+ <clause id='Q3' inline-header='false' obligation='normative'>
1135
+ <title depth='3'>
1136
+ Appendix 1.1
1137
+ <tab/>
1138
+ Appendix subclause
1139
+ </title>
1140
+ </clause>
1129
1141
  </appendix>
1130
1142
  </annex>
1131
1143
  <bibliography>
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.5.12
4
+ version: 1.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-09 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0
33
+ version: 1.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.0
40
+ version: 1.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: metanorma-standoc
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -261,10 +261,7 @@ extensions: []
261
261
  extra_rdoc_files: []
262
262
  files:
263
263
  - ".gitattributes"
264
- - ".github/workflows/macos.yml"
265
264
  - ".github/workflows/rake.yml"
266
- - ".github/workflows/ubuntu.yml"
267
- - ".github/workflows/windows.yml"
268
265
  - ".gitignore"
269
266
  - ".hound.yml"
270
267
  - ".oss-guides.rubocop.yml"
@@ -339,6 +336,7 @@ files:
339
336
  - lib/isodoc/iso/xref.rb
340
337
  - lib/metanorma-iso.rb
341
338
  - lib/metanorma/iso.rb
339
+ - lib/metanorma/iso/fonts_manifest.yaml
342
340
  - lib/metanorma/iso/processor.rb
343
341
  - lib/metanorma/iso/version.rb
344
342
  - metanorma-iso.gemspec
@@ -1,49 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: macos
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/ubuntu.yml
11
- - .github/workflows/windows.yml
12
-
13
- jobs:
14
- test-macos:
15
- name: Test on Ruby ${{ matrix.ruby }} macOS
16
- runs-on: macos-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Cache gems
33
- uses: actions/cache@preview
34
- with:
35
- path: vendor/bundle
36
- key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('Gemfile') }}
37
- restore-keys: |
38
- ${{ runner.os }}-${{ matrix.ruby }}-gem-
39
- - name: Update gems
40
- run: |
41
- gem install bundler
42
- bundle config --local path vendor/bundle
43
- bundle install --jobs 4 --retry 3
44
- - name: Install PlantUML
45
- run: |
46
- brew install plantuml
47
- - name: Run specs
48
- run: |
49
- bundle exec rake