metanorma-generic 1.6.3 → 1.8.0

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: 38f634ace384417096ff4e1ea82dcc50c0cad5d4a81186934df2c7f32e24ebe2
4
- data.tar.gz: 76a20654285bb56c3c7796c6ee3e8a57776a3417cdb81f945eca21c064454afd
3
+ metadata.gz: 4ecff55e1f5665be747c3502c80865395444c81341f884f886fdd2962e769824
4
+ data.tar.gz: b6ca5204417ec9fd4a55010a85dfdc9379747aab1519254762410c72bca330e7
5
5
  SHA512:
6
- metadata.gz: dccf6988964bd683012b07ce100789538f44464b4c98f9f22804e12ef98434c05ada0a879a2f46e67c8d243f1263b0e25639c3dc2e66a320e3f28cf73e7f315e
7
- data.tar.gz: fb7a296bb6d167ec80ff110671b7dca107f510bd2e81c9ea2104f687595b10972a9d9fa7a8b9b9e45b4d1f8b6c6b8c0d2624c7e70f7e4d87827644e9a5fe88ad
6
+ metadata.gz: 36b0019a33b5900b6d3ecd5392fc8f99e061f3d0f0e1b58e504095d002db8b44efb6ec11fb518468a6398a4f89d0da88f824bf799ccc7fbe3edec1b27ac6bc74
7
+ data.tar.gz: 425d8153f56479453f61c760799fdf2625a0ee9bb78e34fd8dfff3ca4d54eb793810bee43bb9faf1d41a8930a9aa220a2fbc652f312a5973dbe42cab4161021a
@@ -0,0 +1,62 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '2.7'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '2.7'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '2.7'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@master
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - uses: actions/cache@v2
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
48
+
49
+ - run: bundle exec rake
50
+
51
+ tests-passed:
52
+ needs: rake
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - name: Trigger tests passed event
56
+ uses: Sibz/github-status-action@v1
57
+ with:
58
+ authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
59
+ context: 'tests-passed-successfully'
60
+ description: 'Tests passed successfully'
61
+ state: 'success'
62
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -3,9 +3,7 @@
3
3
  Formerly known as metanorma-acme
4
4
 
5
5
  image:https://img.shields.io/gem/v/metanorma-generic.svg["Gem Version", link="https://rubygems.org/gems/metanorma-generic"]
6
- image:https://github.com/metanorma/metanorma-generic/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=macos"]
7
- image:https://github.com/metanorma/metanorma-generic/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=ubuntu"]
8
- image:https://github.com/metanorma/metanorma-generic/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=windows"]
6
+ image:https://github.com/metanorma/metanorma-generic/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-generic/actions?workflow=rake"]
9
7
  image:https://codeclimate.com/github/metanorma/metanorma-acme/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-acme"]
10
8
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-generic.svg["Pull Requests", link="https://github.com/metanorma/metanorma-generic/pulls"]
11
9
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-generic/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-generic/releases"]
@@ -158,17 +158,7 @@
158
158
  <data type="ID"/>
159
159
  </attribute>
160
160
  <oneOrMore>
161
- <choice>
162
- <ref name="formula"/>
163
- <ref name="ul"/>
164
- <ref name="ol"/>
165
- <ref name="dl"/>
166
- <ref name="quote"/>
167
- <ref name="sourcecode"/>
168
- <ref name="paragraph"/>
169
- <ref name="table"/>
170
- <ref name="figure"/>
171
- </choice>
161
+ <ref name="paragraph"/>
172
162
  </oneOrMore>
173
163
  </element>
174
164
  </define>
@@ -1028,6 +1018,9 @@
1028
1018
  <value>alphabet_upper</value>
1029
1019
  </choice>
1030
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1031
1024
  <oneOrMore>
1032
1025
  <ref name="li"/>
1033
1026
  </oneOrMore>
@@ -1,13 +1,10 @@
1
1
  require "asciidoctor"
2
2
  require "asciidoctor/standoc/converter"
3
3
  require "fileutils"
4
+ require_relative "front"
4
5
 
5
6
  module Asciidoctor
6
7
  module Generic
7
-
8
- # A {Converter} implementation that generates RSD output, and a document
9
- # schema encapsulation of the document for validation
10
- #
11
8
  class Converter < Standoc::Converter
12
9
  XML_ROOT_TAG = "generic-standard".freeze
13
10
  XML_NAMESPACE = "https://www.metanorma.org/ns/generic".freeze
@@ -24,37 +21,11 @@ module Asciidoctor
24
21
 
25
22
  def baselocation(loc)
26
23
  return nil if loc.nil?
24
+ return loc
27
25
  File.expand_path(File.join(File.dirname(
28
26
  self.class::_file || __FILE__), "..", "..", "..", loc))
29
27
  end
30
28
 
31
- def default_publisher
32
- configuration.organization_name_long
33
- end
34
-
35
- def metadata_committee(node, xml)
36
- return unless node.attr("committee")
37
- xml.editorialgroup do |a|
38
- a.committee node.attr("committee"),
39
- **attr_code(type: node.attr("committee-type"))
40
- i = 2
41
- while node.attr("committee_#{i}") do
42
- a.committee node.attr("committee_#{i}"),
43
- **attr_code(type: node.attr("committee-type_#{i}"))
44
- i += 1
45
- end
46
- end
47
- end
48
-
49
- def metadata_status(node, xml)
50
- xml.status do |s|
51
- s.stage ( node.attr("status") || node.attr("docstage") ||
52
- configuration.default_stage || "published" )
53
- x = node.attr("substage") and s.substage x
54
- x = node.attr("iteration") and s.iteration x
55
- end
56
- end
57
-
58
29
  def docidentifier_cleanup(xmldoc)
59
30
  template = configuration.docid_template ||
60
31
  "{{ organization_name_short }} {{ docnumeric }}"
@@ -63,30 +34,16 @@ module Asciidoctor
63
34
  id.empty? and docid.remove or docid.children = id
64
35
  end
65
36
 
66
- def metadata_id(node, xml)
67
- xml.docidentifier **{ type:
68
- configuration.organization_name_short } do |i|
69
- i << "DUMMY"
70
- end
71
- xml.docnumber { |i| i << node.attr("docnumber") }
72
- end
73
-
74
- def metadata_ext(node, ext)
75
- super
76
- Array(configuration.metadata_extensions).each do |e|
77
- a = node.attr(e) and ext.send e, a
78
- end
79
- end
80
-
81
37
  def doctype(node)
82
38
  d = super
83
- configuration.doctypes or return d == "article" ? "standard" : d
84
- default = configuration.default_doctype || Array(configuration.doctypes).dig(0) ||
85
- "standard"
86
- unless Array(configuration.doctypes).include? d
39
+ configuration.doctypes or return d == "article" ?
40
+ (configuration.default_doctype || "standard") : d
41
+ type = configuration.default_doctype ||
42
+ configuration.doctypes.keys.dig(0) || "standard"
43
+ unless configuration.doctypes.keys.include? d
87
44
  @log.add("Document Attributes", nil,
88
- "#{d} is not a legal document type: reverting to '#{default}'")
89
- d = default
45
+ "#{d} is not a legal document type: reverting to '#{type}'")
46
+ d = type
90
47
  end
91
48
  d
92
49
  end
@@ -97,13 +54,13 @@ module Asciidoctor
97
54
  end
98
55
 
99
56
  def sectiontype_streamline(ret)
100
- if configuration.termsdefs_titles.map(&:downcase).include? (ret)
57
+ if configuration&.termsdefs_titles&.map(&:downcase)&.include? (ret)
101
58
  "terms and definitions"
102
- elsif configuration.symbols_titles.map(&:downcase).include? (ret)
59
+ elsif configuration&.symbols_titles&.map(&:downcase)&.include? (ret)
103
60
  "symbols and abbreviated terms"
104
- elsif configuration.normref_titles.map(&:downcase).include? (ret)
61
+ elsif configuration&.normref_titles&.map(&:downcase)&.include? (ret)
105
62
  "normative references"
106
- elsif configuration.bibliography_titles.map(&:downcase).include? (ret)
63
+ elsif configuration&.bibliography_titles&.map(&:downcase)&.include? (ret)
107
64
  "bibliography"
108
65
  else
109
66
  ret
@@ -117,11 +74,11 @@ module Asciidoctor
117
74
 
118
75
  def outputs(node, ret)
119
76
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
120
- presentation_xml_converter(node).convert(@filename + ".xml")
121
- html_converter(node).convert(@filename + ".presentation.xml",
122
- nil, false, "#{@filename}.html")
123
- doc_converter(node).convert(@filename + ".presentation.xml",
124
- nil, false, "#{@filename}.doc")
77
+ presentation_xml_converter(node)&.convert(@filename + ".xml")
78
+ html_converter(node)&.convert(@filename + ".presentation.xml",
79
+ nil, false, "#{@filename}.html")
80
+ doc_converter(node)&.convert(@filename + ".presentation.xml",
81
+ nil, false, "#{@filename}.doc")
125
82
  pdf_converter(node)&.convert(@filename + ".presentation.xml",
126
83
  nil, false, "#{@filename}.pdf")
127
84
 
@@ -141,6 +98,7 @@ module Asciidoctor
141
98
 
142
99
  def bibdata_validate(doc)
143
100
  stage_validate(doc)
101
+ committee_validate(doc)
144
102
  end
145
103
 
146
104
  def stage_validate(xmldoc)
@@ -151,6 +109,15 @@ module Asciidoctor
151
109
  @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
152
110
  end
153
111
 
112
+ def committee_validate(xmldoc)
113
+ committees = Array(configuration&.committees) || return
114
+ committees.empty? and return
115
+ xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
116
+ committees.include? c.text or
117
+ @log.add("Document Attributes", nil, "#{c.text} is not a recognised committee")
118
+ end
119
+ end
120
+
154
121
  def sections_cleanup(x)
155
122
  super
156
123
  x.xpath("//*[@inline-header]").each do |h|
@@ -187,6 +154,26 @@ module Asciidoctor
187
154
  end
188
155
  conv
189
156
  end
157
+
158
+ def boilerplate_file(xmldoc)
159
+ f = configuration.boilerplate
160
+ f.nil? and return super
161
+ f.is_a? String and return baselocation(f)
162
+ f.is_a? Hash and f[@lang] and return baselocation(f[@lang])
163
+ super
164
+ end
165
+
166
+ def cleanup(xmldoc)
167
+ super
168
+ empty_metadata_cleanup(xmldoc)
169
+ xmldoc
170
+ end
171
+
172
+ def empty_metadata_cleanup(xmldoc)
173
+ xmldoc.xpath("//bibdata/ext//*").each do |x|
174
+ x.remove if x.children.empty?
175
+ end
176
+ end
190
177
  end
191
178
  end
192
179
  end
@@ -0,0 +1,108 @@
1
+ module Asciidoctor
2
+ module Generic
3
+ class Converter < Standoc::Converter
4
+ def default_publisher
5
+ configuration.organization_name_long
6
+ end
7
+
8
+ def org_abbrev
9
+ if !configuration.organization_name_long.empty? &&
10
+ !configuration.organization_name_short.empty? &&
11
+ configuration.organization_name_long !=
12
+ configuration.organization_name_short
13
+ { configuration.organization_name_long =>
14
+ configuration.organization_name_short }
15
+ else
16
+ super
17
+ end
18
+ end
19
+
20
+ def relaton_relations
21
+ Array(configuration.relations) || []
22
+ end
23
+
24
+ def metadata_committee(node, xml)
25
+ return unless node.attr("committee")
26
+ xml.editorialgroup do |a|
27
+ a.committee node.attr("committee"),
28
+ **attr_code(type: node.attr("committee-type"))
29
+ i = 2
30
+ while node.attr("committee_#{i}") do
31
+ a.committee node.attr("committee_#{i}"),
32
+ **attr_code(type: node.attr("committee-type_#{i}"))
33
+ i += 1
34
+ end
35
+ end
36
+ end
37
+
38
+ def metadata_status(node, xml)
39
+ xml.status do |s|
40
+ s.stage ( node.attr("status") || node.attr("docstage") ||
41
+ configuration.default_stage || "published" )
42
+ x = node.attr("substage") and s.substage x
43
+ x = node.attr("iteration") and s.iteration x
44
+ end
45
+ end
46
+
47
+ def metadata_id(node, xml)
48
+ xml.docidentifier **{ type:
49
+ configuration.organization_name_short } do |i|
50
+ i << "DUMMY"
51
+ end
52
+ xml.docnumber { |i| i << node.attr("docnumber") }
53
+ end
54
+
55
+ def metadata_ext(node, ext)
56
+ super
57
+ if configuration.metadata_extensions.is_a? Hash
58
+ metadata_ext_hash(node, ext, configuration.metadata_extensions)
59
+ else
60
+ Array(configuration.metadata_extensions).each do |e|
61
+ a = node.attr(e) and ext.send e, a
62
+ end
63
+ end
64
+ end
65
+
66
+ def metadata_doctype(node, xml)
67
+ d = doctype(node)
68
+ xml.doctype d, attr_code(abbreviation: configuration&.doctypes&.dig(d))
69
+ end
70
+
71
+ EXT_STRUCT = %w(_output _attribute _list).freeze
72
+
73
+ def metadata_ext_hash(node, ext, hash)
74
+ hash.each do |k, v|
75
+ next if EXT_STRUCT.include?(k) || !v&.is_a?(Hash) && !node.attr(k)
76
+ if v&.is_a?(Hash) && v["_list"]
77
+ csv_split(node.attr(k)).each do |val|
78
+ metadata_ext_hash1(k, val, ext, v, node)
79
+ end
80
+ else
81
+ metadata_ext_hash1(k, node.attr(k), ext, v, node)
82
+ end
83
+ end
84
+ end
85
+
86
+ def metadata_ext_hash1(key, value, ext, hash, node)
87
+ return if hash&.is_a?(Hash) && hash["_attribute"]
88
+ is_hash = hash&.is_a?(Hash) &&
89
+ !hash.keys.reject { |n| EXT_STRUCT.include?(n) }.empty?
90
+ return if !is_hash && (value.nil? || value.empty?)
91
+ name = hash&.is_a?(Hash) ? (hash["_output"] || key) : key
92
+ ext.send name, **attr_code(metadata_ext_attrs(hash, node)) do |e|
93
+ is_hash ? metadata_ext_hash(node, e, hash) : (e << value)
94
+ end
95
+ end
96
+
97
+ def metadata_ext_attrs(hash, node)
98
+ return {} unless hash.is_a?(Hash)
99
+ ret = {}
100
+ hash.each do |k, v|
101
+ next unless v.is_a?(Hash) && v["_attribute"]
102
+ ret[(v["_output"] || k).to_sym] = node.attr(k)
103
+ end
104
+ ret
105
+ end
106
+ end
107
+ end
108
+ end
@@ -59,6 +59,13 @@
59
59
  </define>
60
60
  <define name="generic-standard">
61
61
  <element name="generic-standard">
62
+ <attribute name="version"/>
63
+ <attribute name="type">
64
+ <choice>
65
+ <value>semantic</value>
66
+ <value>presentation</value>
67
+ </choice>
68
+ </attribute>
62
69
  <ref name="bibdata"/>
63
70
  <zeroOrMore>
64
71
  <ref name="termdocsource"/>
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -42,7 +50,6 @@
42
50
  </define>
43
51
  <define name="xref">
44
52
  <element name="xref">
45
- <!-- attribute target { xsd:IDREF }, -->
46
53
  <attribute name="target">
47
54
  <data type="string">
48
55
  <param name="pattern">\i\c*|\c+#\c+</param>
@@ -64,6 +71,11 @@
64
71
  </choice>
65
72
  </attribute>
66
73
  </optional>
74
+ <optional>
75
+ <attribute name="droploc">
76
+ <data type="boolean"/>
77
+ </attribute>
78
+ </optional>
67
79
  <text/>
68
80
  </element>
69
81
  </define>
@@ -137,6 +149,11 @@
137
149
  <data type="boolean"/>
138
150
  </attribute>
139
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
140
157
  <oneOrMore>
141
158
  <ref name="dt"/>
142
159
  <ref name="dd"/>
@@ -859,6 +876,13 @@
859
876
  </define>
860
877
  <define name="standard-document">
861
878
  <element name="standard-document">
879
+ <attribute name="version"/>
880
+ <attribute name="type">
881
+ <choice>
882
+ <value>semantic</value>
883
+ <value>presentation</value>
884
+ </choice>
885
+ </attribute>
862
886
  <ref name="bibdata"/>
863
887
  <optional>
864
888
  <ref name="boilerplate"/>
@@ -880,7 +904,7 @@
880
904
  <oneOrMore>
881
905
  <choice>
882
906
  <ref name="content"/>
883
- <ref name="preface_abstract"/>
907
+ <ref name="abstract"/>
884
908
  <ref name="foreword"/>
885
909
  <ref name="introduction"/>
886
910
  <ref name="acknowledgements"/>
@@ -1153,49 +1177,7 @@
1153
1177
  </define>
1154
1178
  <define name="annex">
1155
1179
  <element name="annex">
1156
- <optional>
1157
- <attribute name="id">
1158
- <data type="ID"/>
1159
- </attribute>
1160
- </optional>
1161
- <optional>
1162
- <attribute name="language"/>
1163
- </optional>
1164
- <optional>
1165
- <attribute name="script"/>
1166
- </optional>
1167
- <optional>
1168
- <attribute name="inline-header">
1169
- <data type="boolean"/>
1170
- </attribute>
1171
- </optional>
1172
- <attribute name="obligation">
1173
- <choice>
1174
- <value>normative</value>
1175
- <value>informative</value>
1176
- </choice>
1177
- </attribute>
1178
- <optional>
1179
- <ref name="section-title"/>
1180
- </optional>
1181
- <group>
1182
- <group>
1183
- <zeroOrMore>
1184
- <ref name="BasicBlock"/>
1185
- </zeroOrMore>
1186
- <zeroOrMore>
1187
- <ref name="note"/>
1188
- </zeroOrMore>
1189
- </group>
1190
- <zeroOrMore>
1191
- <choice>
1192
- <ref name="annex-subsection"/>
1193
- <ref name="terms"/>
1194
- <ref name="definitions"/>
1195
- <ref name="references"/>
1196
- </choice>
1197
- </zeroOrMore>
1198
- </group>
1180
+ <ref name="Annex-Section"/>
1199
1181
  </element>
1200
1182
  </define>
1201
1183
  <define name="terms">
@@ -1481,11 +1463,6 @@
1481
1463
  </optional>
1482
1464
  </element>
1483
1465
  </define>
1484
- <define name="preface_abstract">
1485
- <element name="abstract">
1486
- <ref name="Basic-Section"/>
1487
- </element>
1488
- </define>
1489
1466
  <define name="term-clause">
1490
1467
  <element name="clause">
1491
1468
  <optional>
@@ -4,12 +4,6 @@ require "fileutils"
4
4
  module IsoDoc
5
5
  module Generic
6
6
  module BaseConvert
7
- def baselocation(loc)
8
- return nil if loc.nil?
9
- File.expand_path(File.join(
10
- File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
11
- end
12
-
13
7
  def cleanup(docxml)
14
8
  super
15
9
  term_cleanup(docxml)
@@ -24,30 +24,35 @@ module IsoDoc
24
24
 
25
25
  def default_fonts(options)
26
26
  {
27
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif'
28
- : configuration.html_bodyfont || '"Overpass",sans-serif'),
29
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
30
- configuration.html_headerfont || '"Overpass",sans-serif'),
31
- monospacefont: configuration.html_monospacefont || '"Space Mono",monospace'
32
- }
27
+ bodyfont: (
28
+ options[:script] == "Hans" ? '"SimSun",serif' :
29
+ configuration.html_bodyfont || '"Overpass",sans-serif'
30
+ ),
31
+ headerfont: (
32
+ options[:script] == "Hans" ? '"SimHei",sans-serif' :
33
+ configuration.html_headerfont || '"Overpass",sans-serif'
34
+ ),
35
+ monospacefont: configuration.html_monospacefont || '"Space Mono",monospace',
36
+ normalfontsize: configuration.html_normalfontsize,
37
+ smallerfontsize: configuration.html_smallerfontsize,
38
+ footnotefontsize: configuration.html_footnotefontsize,
39
+ monospacefontsize: configuration.html_monospacefontsize,
40
+ }.transform_values { |v| v&.empty? ? nil : v }
33
41
  end
34
42
 
35
43
  def default_file_locations(_options)
36
44
  {
37
45
  htmlstylesheet: baselocation(configuration.htmlstylesheet) ||
38
- html_doc_path("htmlstyle.scss"),
46
+ html_doc_path("htmlstyle.scss"),
39
47
  htmlcoverpage: baselocation(configuration.htmlcoverpage) ||
40
- html_doc_path("html_generic_titlepage.html"),
48
+ html_doc_path("html_generic_titlepage.html"),
41
49
  htmlintropage: baselocation(configuration.htmlintropage) ||
42
- html_doc_path("html_generic_intro.html"),
50
+ html_doc_path("html_generic_intro.html"),
43
51
  scripts: baselocation(configuration.scripts) ||
44
- html_doc_path("scripts.html"),
45
- i18nyaml: baselocation(configuration.i18nyaml)
46
- }
47
- end
48
-
49
- def configuration
50
- Metanorma::Generic.configuration
52
+ html_doc_path("scripts.html"),
53
+ i18nyaml: (configuration.i18nyaml.is_a?(String) ?
54
+ baselocation(configuration.i18nyaml) : nil)
55
+ }.transform_values { |v| v&.empty? ? nil : v }
51
56
  end
52
57
 
53
58
  def googlefonts
@@ -0,0 +1,26 @@
1
+ require_relative "utils"
2
+
3
+ module IsoDoc
4
+ module Generic
5
+ class I18n < IsoDoc::I18n
6
+ class << self
7
+ attr_accessor :_file
8
+ end
9
+
10
+ def self.inherited( k )
11
+ k._file = caller_locations.first.absolute_path
12
+ end
13
+
14
+ def load_yaml1(lang, script)
15
+ return super unless configuration.i18nyaml
16
+ file = configuration.i18nyaml.is_a?(Hash) ?
17
+ configuration.i18nyaml[lang] : configuration.i18nyaml
18
+ return super if file.nil?
19
+ y = YAML.load_file(baselocation(file))
20
+ super.merge(y)
21
+ end
22
+
23
+ include Utils
24
+ end
25
+ end
26
+ end
@@ -1,6 +1,8 @@
1
1
  require "isodoc"
2
2
  require_relative "metadata"
3
3
  require_relative "xref"
4
+ require_relative "i18n"
5
+ require_relative "utils"
4
6
 
5
7
  module IsoDoc
6
8
  module Generic
@@ -15,14 +17,13 @@ module IsoDoc
15
17
  end
16
18
 
17
19
  def i18n_init(lang, script, i18nyaml = nil)
20
+ f = Metanorma::Generic.configuration.i18nyaml
21
+ f = nil unless f.is_a? String
18
22
  @i18n = I18n.new(
19
- lang, script, i18nyaml ||
20
- Metanorma::Generic.configuration.i18nyaml || @i18nyaml)
23
+ lang, script, i18nyaml || f || @i18nyaml)
21
24
  end
22
25
 
23
- def fileloc(loc)
24
- File.join(File.dirname(__FILE__), loc)
25
- end
26
+ include Utils
26
27
  end
27
28
  end
28
29
  end
@@ -1,5 +1,29 @@
1
1
  require "isodoc"
2
+ require "nokogiri"
2
3
  require_relative "init"
4
+ require_relative "utils"
5
+
6
+ class Nokogiri::XML::Node
7
+ TYPENAMES = {1=>'element',2=>'attribute',3=>'text',4=>'cdata',8=>'comment'}
8
+ def to_hash
9
+ ret = {kind:TYPENAMES[node_type],name:name}.tap do |h|
10
+ h.merge! text:text&.strip
11
+ a = attribute_nodes.map(&:to_hash)
12
+ if element? && !a.empty?
13
+ h.merge! attr: a.inject({}) { |m, v| m[v[:name]] = v[:text]; m }
14
+ end
15
+ c = children.map(&:to_hash)
16
+ if element? && !(c&.size == 1 && c[0][:kind] == "text")
17
+ h.merge! kids: c.delete_if { |n| n[:kind] == "text" && n[:text].empty? }
18
+ end
19
+ end
20
+ ret
21
+ end
22
+ end
23
+
24
+ class Nokogiri::XML::Document
25
+ def to_hash; root.to_hash; end
26
+ end
3
27
 
4
28
  module IsoDoc
5
29
  module Generic
@@ -23,18 +47,6 @@ module IsoDoc
23
47
  k._file = caller_locations.first.absolute_path
24
48
  end
25
49
 
26
- def baselocation(loc)
27
- return nil if loc.nil?
28
- File.expand_path(File.join(File.dirname(
29
- self.class.respond_to?(:_file) ? (self.class::_file || __FILE__) :
30
- __FILE__),
31
- "..", "..", "..", loc))
32
- end
33
-
34
- def configuration
35
- Metanorma::Generic.configuration
36
- end
37
-
38
50
  def author(isoxml, _out)
39
51
  super
40
52
  tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
@@ -51,12 +63,39 @@ module IsoDoc
51
63
  !(Array(stages).map { |m| m.downcase }.include? status.downcase)
52
64
  end
53
65
 
54
- def ext(isoxml, out)
55
- Array(configuration.metadata_extensions).each do |e|
56
- b = isoxml&.at(ns("//bibdata/ext/#{e}"))&.text or next
57
- set(e.to_sym, b)
66
+ def doctype(isoxml, _out)
67
+ super
68
+ b = isoxml&.at(ns("//bibdata/ext/doctype#{currlang}")) ||
69
+ isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}")) || return
70
+ a = b["abbreviation"] and set(:doctype_abbr, a)
71
+ end
72
+
73
+ def xmlhash2hash(h)
74
+ ret = {}
75
+ return ret if h.nil? || h[:kind] != "element"
76
+ h[:attr].nil? or h[:attr].each { |k, v| ret["#{h[:name]}_#{k}"] = v }
77
+ ret[h[:name]] = h[:kids] ? xmlhash2hash_kids(h) : h[:text]
78
+ ret
79
+ end
80
+
81
+ def xmlhash2hash_kids(h)
82
+ c = {}
83
+ h[:kids].each do |n|
84
+ xmlhash2hash(n).each do |k1, v1|
85
+ c[k1] = c[k1].nil? ? v1 :
86
+ c[k1].is_a?(Array) ? c[k1] << v1 :
87
+ [c[k1], v1]
88
+ end
58
89
  end
90
+ c
59
91
  end
92
+
93
+ def ext(isoxml, out)
94
+ b = isoxml&.at(ns("//bibdata/ext")) or return
95
+ set(:metadata_extensions, xmlhash2hash(b.to_hash)["ext"])
96
+ end
97
+
98
+ include Utils
60
99
  end
61
100
  end
62
101
  end
@@ -27,7 +27,7 @@ module IsoDoc
27
27
  headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
28
28
  configuration.html_headerfont || '"Overpass",sans-serif'),
29
29
  monospacefont: configuration.html_monospacefont || '"Space Mono",monospace'
30
- }
30
+ }.transform_values { |v| v&.empty? ? nil : v }
31
31
  end
32
32
 
33
33
  def default_file_locations(_options)
@@ -40,7 +40,7 @@ module IsoDoc
40
40
  html_doc_path("html_generic_intro.html"),
41
41
  scripts_pdf: baselocation(configuration.scripts_pdf) ||
42
42
  html_doc_path("scripts.pdf.html")
43
- }
43
+ }.transform_values { |v| v&.empty? ? nil : v }
44
44
  end
45
45
 
46
46
  def googlefonts
@@ -0,0 +1,23 @@
1
+ module IsoDoc
2
+ module Generic
3
+ module Utils
4
+ def configuration
5
+ Metanorma::Generic.configuration
6
+ end
7
+
8
+ def fileloc(loc)
9
+ File.join(File.dirname(__FILE__), loc)
10
+ end
11
+
12
+ def baselocation(loc)
13
+ return nil if loc.nil?
14
+ return "" if loc.empty?
15
+ return loc
16
+ f = defined?(self.class::_file) ? (self.class::_file || __FILE__) :
17
+ __FILE__
18
+ File.expand_path(File.join(
19
+ File.dirname(f), "..", "..", "..", loc))
20
+ end
21
+ end
22
+ end
23
+ end
@@ -23,34 +23,39 @@ module IsoDoc
23
23
 
24
24
  def default_fonts(options)
25
25
  {
26
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
27
- configuration.word_bodyfont || '"Arial",sans-serif'),
28
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
29
- configuration.word_headerfont || '"Arial",sans-serif'),
30
- monospacefont: configuration.word_monospacefont || '"Courier New",monospace'
31
- }
26
+ bodyfont: (
27
+ options[:script] == "Hans" ? '"SimSun",serif' :
28
+ configuration.word_bodyfont || '"Arial",sans-serif'
29
+ ),
30
+ headerfont: (
31
+ options[:script] == "Hans" ? '"SimHei",sans-serif' :
32
+ configuration.word_headerfont || '"Arial",sans-serif'
33
+ ),
34
+ monospacefont: configuration.word_monospacefont || '"Courier New",monospace',
35
+ normalfontsize: configuration.word_normalfontsize,
36
+ smallerfontsize: configuration.word_smallerfontsize,
37
+ footnotefontsize: configuration.word_footnotefontsize,
38
+ monospacefontsize: configuration.word_monospacefontsize,
39
+ }.transform_values { |v| v&.empty? ? nil : v }
32
40
  end
33
41
 
34
42
  def default_file_locations(options)
35
43
  {
36
44
  wordstylesheet: baselocation(configuration.wordstylesheet) ||
37
- html_doc_path("wordstyle.scss"),
45
+ html_doc_path("wordstyle.scss"),
38
46
  standardstylesheet: baselocation(configuration.standardstylesheet) ||
39
- html_doc_path("generic.scss"),
47
+ html_doc_path("generic.scss"),
40
48
  header: baselocation(configuration.header) ||
41
- html_doc_path("header.html"),
49
+ html_doc_path("header.html"),
42
50
  wordcoverpage: baselocation(configuration.wordcoverpage) ||
43
- html_doc_path("word_generic_titlepage.html"),
51
+ html_doc_path("word_generic_titlepage.html"),
44
52
  wordintropage: baselocation(configuration.wordintropage) ||
45
- html_doc_path("word_generic_intro.html"),
46
- i18nyaml: baselocation(configuration.i18nyaml),
47
- ulstyle: "l3",
48
- olstyle: "l2",
49
- }
50
- end
51
-
52
- def configuration
53
- Metanorma::Generic.configuration
53
+ html_doc_path("word_generic_intro.html"),
54
+ i18nyaml: (configuration.i18nyaml.is_a?(String) ?
55
+ baselocation(configuration.i18nyaml) : nil),
56
+ ulstyle: "l3",
57
+ olstyle: "l2",
58
+ }.transform_values { |v| v&.empty? ? nil : v }
54
59
  end
55
60
 
56
61
  include BaseConvert
@@ -15,6 +15,8 @@ module Metanorma
15
15
  organization_name_short
16
16
  organization_name_long
17
17
  bibliography_titles
18
+ boilerplate
19
+ committees
18
20
  document_namespace
19
21
  docid_template
20
22
  doctypes
@@ -29,10 +31,15 @@ module Metanorma
29
31
  html_bodyfont
30
32
  html_headerfont
31
33
  html_monospacefont
34
+ html_normalfontsize
35
+ html_monospacefontsize
36
+ html_smallerfontsize
37
+ html_footnotefontsize
32
38
  metadata_extensions
33
39
  metanorma_name
34
40
  normref_titles
35
41
  published_stages
42
+ relations
36
43
  default_stage
37
44
  stage_abbreviations
38
45
  scripts
@@ -48,9 +55,33 @@ module Metanorma
48
55
  word_bodyfont
49
56
  word_headerfont
50
57
  word_monospacefont
58
+ word_normalfontsize
59
+ word_monospacefontsize
60
+ word_smallerfontsize
61
+ word_footnotefontsize
51
62
  xml_root_tag
52
63
  ].freeze
53
64
 
65
+ def filepath_attrs
66
+ return %i[
67
+ i18nyaml
68
+ boilerplate
69
+ logo_path
70
+ logo_paths
71
+ header
72
+ htmlcoverpage
73
+ htmlintropage
74
+ htmlstylesheet
75
+ scripts
76
+ scripts_pdf
77
+ standardstylesheet
78
+ validate_rng_file
79
+ wordcoverpage
80
+ wordintropage
81
+ wordstylesheet
82
+ ]
83
+ end
84
+
54
85
  attr_accessor(*CONFIG_ATTRS)
55
86
 
56
87
  class << self
@@ -81,13 +112,47 @@ module Metanorma
81
112
  end
82
113
 
83
114
  def set_default_values_from_yaml_file(config_file)
115
+ root_path = File.dirname(self.class::_file || __FILE__)
84
116
  default_config_options = YAML.load(File.read(config_file))
117
+ if default_config_options["doctypes"]&.is_a? Array
118
+ default_config_options["doctypes"] = default_config_options["doctypes"].
119
+ each_with_object({}) { |k, m| m[k] = nil }
120
+ end
85
121
  CONFIG_ATTRS.each do |attr_name|
86
- instance_variable_set("@#{attr_name}", default_config_options[attr_name.to_s])
122
+ value = default_config_options[attr_name.to_s]
123
+ if value && filepath_attrs.include?(attr_name)
124
+ value = absolute_path(value, root_path)
125
+ end
126
+
127
+ instance_variable_set("@#{attr_name}", value)
128
+ end
129
+ end
130
+
131
+ def blank?(v)
132
+ v.nil? || v.respond_to?(:empty?) && v.empty?
133
+ end
134
+
135
+ def absolute_path(value, root_path)
136
+ if value.is_a? Hash then absolute_path1(value, root_path)
137
+ elsif value.is_a? Array
138
+ value.reject { |a| blank?(a) }.each_with_object([]) do |v1, g|
139
+ g << absolute_path(v1, root_path)
140
+ end
141
+ elsif value.is_a?(String) && !value.empty?
142
+ File.join(root_path, "..", "..", value)
143
+ else
144
+ value
145
+ end
146
+ end
147
+
148
+ def absolute_path1(h, pref)
149
+ h.reject { |k, v| blank?(v) }.each_with_object({}) do |(k, v), g|
150
+ g[k] = absolute_path(v, pref)
87
151
  end
88
152
  end
89
153
  end
90
154
 
155
+
91
156
  class << self
92
157
  extend Forwardable
93
158
 
@@ -0,0 +1,5 @@
1
+ ---
2
+ Source Sans Pro:
3
+ Overpass:
4
+ Space Mono:
5
+ Arial:
@@ -2,21 +2,6 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Generic
5
- def self.fonts_used
6
- {
7
- html: [
8
- configuration.html_bodyfont || "Overpass", configuration.html_headerfont || "Overpass",
9
- configuration.html_monospacefont || "Space Mono"
10
- ].uniq,
11
- doc: [
12
- configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
13
- configuration.word_monospacefont || "Space Mono"].uniq,
14
- pdf: [
15
- configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
16
- configuration.word_monospacefont || "Space Mono"].uniq,
17
- }
18
- end
19
-
20
5
  class Processor < Metanorma::Processor
21
6
  def configuration
22
7
  Metanorma::Generic.configuration
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "1.6.3"
3
+ VERSION = "1.8.0"
4
4
  end
5
5
  end
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  spec.add_dependency "ruby-jing"
31
- spec.add_dependency "metanorma-standoc", "~> 1.5.0"
32
- spec.add_dependency "isodoc", "~> 1.2.0"
31
+ spec.add_dependency "metanorma-standoc", "~> 1.6.0"
32
+ spec.add_dependency "isodoc", "~> 1.3.0"
33
33
 
34
34
  spec.add_development_dependency "byebug", "~> 9.1"
35
35
  spec.add_development_dependency "sassc", "2.4.0"
@@ -14,6 +14,10 @@ htmlstylesheet: /metanorma-mine/lib/isodoc/mine/html/htmlstyle.scss
14
14
  html_bodyfont: '"Source Sans Pro",sans-serif'
15
15
  html_headerfont: '"Source Sans Pro",sans-serif'
16
16
  html_monospacefont: '"Source Code Pro",monospace'
17
+ html_normalfontsize: "1.0em"
18
+ html_monospacefontsize: "0.8em"
19
+ html_smallerfontsize: "0.9em"
20
+ html_footnotefontsize: "0.8em"
17
21
  scripts: /metanorma-mine/lib/isodoc/mine/html/scripts.html
18
22
  scripts_pdf: /metanorma-mine/lib/isodoc/mine/html/scripts.prd.html
19
23
  standardstylesheet: /metanorma-mine/lib/isodoc/mine/html/
@@ -24,11 +28,20 @@ wordstylesheet: /metanorma-mine/lib/isodoc/mine/html/wordstyle.scss
24
28
  word_bodyfont: '"Source Sans Pro","Arial",sans-serif'
25
29
  word_headerfont: '"Source Sans Pro","Arial",sans-serif'
26
30
  word_monospacefont: '"Source Code Pro",monospace'
31
+ word_normalfontsize: "12.0pt"
32
+ word_monospacefontsize: "11.0pt"
33
+ word_smallerfontsize: "10.0pt"
34
+ word_footnotefontsize: "9.0pt"
27
35
  docid_template: "{{ organization_name_short }} {{ docnumeric }}"
28
36
  metadata_extensions:
29
37
  - security
30
38
  published_stages:
31
39
  - published
40
+ committees:
41
+ - TC 1
42
+ relations:
43
+ - part-of
44
+ - translated-from
32
45
  stage_abbreviations:
33
46
  draft-proposal:
34
47
  draft-development:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
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: htmlentities
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.5.0
47
+ version: 1.6.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.5.0
54
+ version: 1.6.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: isodoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.0
61
+ version: 1.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2.0
68
+ version: 1.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -216,9 +216,7 @@ executables: []
216
216
  extensions: []
217
217
  extra_rdoc_files: []
218
218
  files:
219
- - ".github/workflows/macos.yml"
220
- - ".github/workflows/ubuntu.yml"
221
- - ".github/workflows/windows.yml"
219
+ - ".github/workflows/rake.yml"
222
220
  - ".gitignore"
223
221
  - ".hound.yml"
224
222
  - ".rubocop.ribose.yml"
@@ -236,6 +234,7 @@ files:
236
234
  - lib/asciidoctor/generic/basicdoc.rng
237
235
  - lib/asciidoctor/generic/biblio.rng
238
236
  - lib/asciidoctor/generic/converter.rb
237
+ - lib/asciidoctor/generic/front.rb
239
238
  - lib/asciidoctor/generic/generic.rng
240
239
  - lib/asciidoctor/generic/isodoc.rng
241
240
  - lib/asciidoctor/generic/reqt.rng
@@ -253,14 +252,17 @@ files:
253
252
  - lib/isodoc/generic/html/word_generic_titlepage.html
254
253
  - lib/isodoc/generic/html/wordstyle.scss
255
254
  - lib/isodoc/generic/html_convert.rb
255
+ - lib/isodoc/generic/i18n.rb
256
256
  - lib/isodoc/generic/init.rb
257
257
  - lib/isodoc/generic/metadata.rb
258
258
  - lib/isodoc/generic/pdf_convert.rb
259
259
  - lib/isodoc/generic/presentation_xml_convert.rb
260
+ - lib/isodoc/generic/utils.rb
260
261
  - lib/isodoc/generic/word_convert.rb
261
262
  - lib/isodoc/generic/xref.rb
262
263
  - lib/metanorma-generic.rb
263
264
  - lib/metanorma/generic.rb
265
+ - lib/metanorma/generic/fonts_manifest.yaml
264
266
  - lib/metanorma/generic/processor.rb
265
267
  - lib/metanorma/generic/version.rb
266
268
  - metanorma-generic.gemspec
@@ -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