metanorma-iec 1.2.4 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +62 -0
  3. data/README.adoc +3 -4
  4. data/lib/asciidoctor/iec/basicdoc.rng +4 -11
  5. data/lib/asciidoctor/iec/converter.rb +6 -1
  6. data/lib/asciidoctor/iec/front.rb +11 -3
  7. data/lib/asciidoctor/iec/iec.rng +43 -1
  8. data/lib/asciidoctor/iec/iec_intro_en.xml +82 -53
  9. data/lib/asciidoctor/iec/iec_intro_fr.xml +44 -20
  10. data/lib/asciidoctor/iec/isodoc.rng +27 -50
  11. data/lib/asciidoctor/iec/isostandard.rng +16 -1
  12. data/lib/isodoc/iec/html/htmlstyle.css +10 -6
  13. data/lib/isodoc/iec/html/htmlstyle.scss +4 -4
  14. data/lib/isodoc/iec/html/isodoc.css +79 -79
  15. data/lib/isodoc/iec/html/isodoc.scss +79 -79
  16. data/lib/isodoc/iec/html/wordstyle.css +120 -120
  17. data/lib/isodoc/iec/html/wordstyle.scss +120 -120
  18. data/lib/isodoc/iec/html_convert.rb +8 -0
  19. data/lib/isodoc/iec/i18n-en.yaml +16 -0
  20. data/lib/isodoc/iec/i18n-fr.yaml +17 -0
  21. data/lib/isodoc/iec/iec.international-standard.xsl +926 -330
  22. data/lib/isodoc/iec/metadata.rb +33 -0
  23. data/lib/isodoc/iec/presentation_xml_convert.rb +12 -0
  24. data/lib/isodoc/iec/word_convert.rb +10 -0
  25. data/lib/metanorma/iec/fonts_manifest.yaml +5 -0
  26. data/lib/metanorma/iec/processor.rb +0 -8
  27. data/lib/metanorma/iec/version.rb +1 -1
  28. data/metanorma-iec.gemspec +1 -2
  29. data/spec/asciidoctor-iec/base_spec.rb +22 -5
  30. data/spec/asciidoctor-iec/blocks_spec.rb +1 -1
  31. data/spec/asciidoctor-iec/cleanup_spec.rb +0 -84
  32. data/spec/asciidoctor-iec/iev_spec.rb +6 -3
  33. data/spec/asciidoctor-iec/lists_spec.rb +6 -6
  34. data/spec/asciidoctor-iec/validate_spec.rb +36 -1
  35. data/spec/assets/xref_error.adoc +7 -0
  36. data/spec/isodoc/blocks_spec.rb +1 -1
  37. data/spec/isodoc/i18n_spec.rb +39 -9
  38. data/spec/isodoc/iev_spec.rb +13 -13
  39. data/spec/isodoc/inline_spec.rb +1 -1
  40. data/spec/isodoc/iso_spec.rb +2 -2
  41. data/spec/isodoc/metadata_spec.rb +59 -24
  42. data/spec/isodoc/ref_spec.rb +5 -5
  43. data/spec/isodoc/section_spec.rb +2 -2
  44. data/spec/isodoc/terms_spec.rb +1 -1
  45. data/spec/spec_helper.rb +9 -2
  46. metadata +7 -21
  47. data/.github/workflows/macos.yml +0 -38
  48. data/.github/workflows/ubuntu.yml +0 -56
  49. data/.github/workflows/windows.yml +0 -40
@@ -44,7 +44,7 @@ RSpec.describe IsoDoc::Iec do
44
44
  <abbreviation>ISO</abbreviation>
45
45
  </organization>
46
46
  </contributor>
47
- <note format="text/plain" reference="1" type="ISO DATE">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
47
+ <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
48
48
  <extent type="part">
49
49
  <referenceFrom>all</referenceFrom>
50
50
  </extent>
@@ -126,9 +126,9 @@ RSpec.describe IsoDoc::Iec do
126
126
  INPUT
127
127
 
128
128
  presxml = <<~OUTPUT
129
- <iso-standard xmlns="http://riboseinc.com/isoxml">
129
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
130
130
  <bibdata>
131
- <language>en</language>
131
+ <language current="true">en</language>
132
132
  </bibdata>
133
133
  <preface><foreword>
134
134
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
@@ -167,7 +167,7 @@ RSpec.describe IsoDoc::Iec do
167
167
  <abbreviation>ISO</abbreviation>
168
168
  </organization>
169
169
  </contributor>
170
- <note format="text/plain" reference="1" type="ISO DATE">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
170
+ <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
171
171
  <extent type="part">
172
172
  <referenceFrom>all</referenceFrom>
173
173
  </extent>
@@ -369,7 +369,7 @@ RSpec.describe IsoDoc::Iec do
369
369
  </html>
370
370
 
371
371
  OUTPUT
372
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
372
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
373
373
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
374
374
  end
375
375
 
@@ -69,7 +69,7 @@ RSpec.describe IsoDoc do
69
69
  INPUT
70
70
 
71
71
  presxml = <<~OUTPUT
72
- <iso-standard xmlns="http://riboseinc.com/isoxml">
72
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
73
73
  <preface>
74
74
  <foreword obligation="informative">
75
75
  <title>Foreword</title>
@@ -327,7 +327,7 @@ OUTPUT
327
327
  </sections>
328
328
  </iso-standard>
329
329
  INPUT
330
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
330
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
331
331
  <sections>
332
332
  <clause id='D' obligation='normative'>
333
333
  <title depth='1'>
@@ -54,7 +54,7 @@ RSpec.describe IsoDoc do
54
54
  </iso-standard>
55
55
  INPUT
56
56
  presxml = <<~INPUT
57
- <iso-standard xmlns="http://riboseinc.com/isoxml">
57
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
58
58
  <sections>
59
59
  <terms id="_terms_and_definitions" obligation="normative"><title depth="1">1<tab/>Terms and definitions</title>
60
60
 
@@ -25,6 +25,10 @@ RSpec.configure do |config|
25
25
  end
26
26
  end
27
27
 
28
+ def metadata(x)
29
+ Hash[x.sort].delete_if{ |k, v| v.nil? || v.respond_to?(:empty?) && v.empty? }
30
+ end
31
+
28
32
  def strip_guid(x)
29
33
  x.gsub(%r{ id="_[^"]+"}, ' id="_"').gsub(%r{ target="_[^"]+"}, ' target="_"')
30
34
  end
@@ -115,7 +119,9 @@ BOILERPLATE =
115
119
  gsub(/\{% if unpublished %\}.*\{% endif %\}/m, "").
116
120
  gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’").
117
121
  gsub(/<p>/, "<p id='_'>").
118
- gsub(/<ol>/, "<ol id='_'>")
122
+ gsub(/<ol>/, "<ol id='_'>").
123
+ gsub(/ - /, " — ").
124
+ gsub(/\.\.\./, "…")
119
125
  )
120
126
 
121
127
  BOILERPLATE_LICENSE = <<~END
@@ -141,7 +147,7 @@ UNPUBLISHED_BOILERPLATE = BOILERPLATE.sub(/<\/boilerplate>/, "#{BOILERPLATE_LICE
141
147
 
142
148
  BLANK_HDR = <<~"HDR"
143
149
  <?xml version="1.0" encoding="UTF-8"?>
144
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
150
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
145
151
  <bibdata type="standard">
146
152
  <contributor>
147
153
  <role type="author"/>
@@ -174,6 +180,7 @@ BLANK_HDR = <<~"HDR"
174
180
  </copyright>
175
181
  <ext>
176
182
  <doctype>article</doctype>
183
+ <horizontal>false</horizontal>
177
184
  <editorialgroup>
178
185
  <technical-committee/>
179
186
  <subcommittee/>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.9
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-09-11 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
@@ -24,34 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: isodoc
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 1.2.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 1.2.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: metanorma-iso
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: 1.5.0
33
+ version: 1.5.10
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: 1.5.0
40
+ version: 1.5.10
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: byebug
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -216,9 +202,7 @@ executables: []
216
202
  extensions: []
217
203
  extra_rdoc_files: []
218
204
  files:
219
- - ".github/workflows/macos.yml"
220
- - ".github/workflows/ubuntu.yml"
221
- - ".github/workflows/windows.yml"
205
+ - ".github/workflows/rake.yml"
222
206
  - ".gitignore"
223
207
  - ".hound.yml"
224
208
  - ".rubocop.yml"
@@ -265,6 +249,7 @@ files:
265
249
  - lib/isodoc/iec/xref.rb
266
250
  - lib/metanorma-iec.rb
267
251
  - lib/metanorma/iec.rb
252
+ - lib/metanorma/iec/fonts_manifest.yaml
268
253
  - lib/metanorma/iec/processor.rb
269
254
  - lib/metanorma/iec/version.rb
270
255
  - metanorma-iec.gemspec
@@ -282,6 +267,7 @@ files:
282
267
  - spec/assets/rice_image1.png
283
268
  - spec/assets/word.css
284
269
  - spec/assets/wordintro.html
270
+ - spec/assets/xref_error.adoc
285
271
  - spec/examples/rice.adoc
286
272
  - spec/examples/rice.doc
287
273
  - spec/examples/rice.html
@@ -1,38 +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: Update gems
33
- run: |
34
- sudo gem install bundler --force
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,56 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: ubuntu
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- tags:
9
- - '*'
10
- pull_request:
11
- paths-ignore:
12
- - .github/workflows/macos.yml
13
- - .github/workflows/windows.yml
14
-
15
- jobs:
16
- test-linux:
17
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
18
- runs-on: ubuntu-latest
19
- continue-on-error: ${{ matrix.experimental }}
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby: [ '2.6', '2.5', '2.4' ]
24
- experimental: [false]
25
- include:
26
- - ruby: '2.7'
27
- experimental: true
28
- steps:
29
- - uses: actions/checkout@master
30
- - name: Use Ruby
31
- uses: actions/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- - name: Update gems
35
- run: |
36
- gem install bundler
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake
41
- - name: Trigger repositories
42
- if: matrix.ruby == '2.6'
43
- env:
44
- GH_USERNAME: metanorma-ci
45
- GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
46
- run: |
47
- curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
48
- [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
49
- CLIENT_PAYLOAD=$(cat <<EOF
50
- "{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
51
- EOF
52
- )
53
- for repo in $REPOS
54
- do
55
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
56
- done
@@ -1,40 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: windows
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/ubuntu.yml
12
-
13
- jobs:
14
- test-windows:
15
- name: Test on Ruby ${{ matrix.ruby }} Windows
16
- runs-on: windows-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: Update gems
33
- shell: pwsh
34
- run: |
35
- gem install bundler
36
- bundle config --local path vendor/bundle
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake