metanorma-acme 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,6 @@ module IsoDoc
12
12
  def initialize(options)
13
13
  @libdir = File.dirname(__FILE__)
14
14
  super
15
- #system "cp #{html_doc_path('logo.jpg')} logo.jpg"
16
15
  FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
17
16
  @files_to_delete << "logo.jpg"
18
17
  end
@@ -34,12 +33,12 @@ module IsoDoc
34
33
  }
35
34
  end
36
35
 
37
- def metadata_init(lang, script, labels)
38
- @meta = Metadata.new(lang, script, labels)
39
- end
36
+ def metadata_init(lang, script, labels)
37
+ @meta = Metadata.new(lang, script, labels)
38
+ end
40
39
 
41
- def html_head
42
- <<~HEAD.freeze
40
+ def html_head
41
+ <<~HEAD.freeze
43
42
  <title>{{ doctitle }}</title>
44
43
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
45
44
 
@@ -53,148 +52,85 @@ module IsoDoc
53
52
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
54
53
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/fontawesome.css" integrity="sha384-q3jl8XQu1OpdLgGFvNRnPdj5VIlCvgsDQTQB6owSOHWlAurxul7f+JpUOVdAiJ5P" crossorigin="anonymous">
55
54
  <style class="anchorjs"></style>
56
- HEAD
57
- end
58
-
59
- def make_body(xml, docxml)
60
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
61
- xml.body **body_attr do |body|
62
- make_body1(body, docxml)
63
- make_body2(body, docxml)
64
- make_body3(body, docxml)
65
- end
66
- end
67
-
68
- def html_toc(docxml)
69
- docxml
70
- end
71
-
72
- def annex_name(annex, name, div)
73
- div.h1 **{ class: "Annex" } do |t|
74
- t << "#{get_anchors[annex['id']][:label]} "
75
- t << "<b>#{name.text}</b>"
76
- end
77
- end
78
-
79
- def annex_name_lbl(clause, num)
80
- obl = l10n("(#{@inform_annex_lbl})")
81
- obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
82
- l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
83
- end
84
-
85
- def pre_parse(node, out)
86
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
87
- end
88
-
89
- def term_defs_boilerplate(div, source, term, preface)
90
- if source.empty? && term.nil?
91
- div << @no_terms_boilerplate
92
- else
93
- div << term_defs_boilerplate_cont(source, term)
94
- end
95
- end
96
-
97
- def i18n_init(lang, script)
98
- super
99
- @annex_lbl = "Appendix"
100
- end
101
-
102
- def error_parse(node, out)
103
- # catch elements not defined in ISO
104
- case node.name
105
- when "pre"
106
- pre_parse(node, out)
107
- when "keyword"
108
- out.span node.text, **{ class: "keyword" }
109
- else
110
- super
111
- end
112
- end
113
-
114
- def fileloc(loc)
115
- File.join(File.dirname(__FILE__), loc)
116
- end
117
-
118
- def cleanup(docxml)
119
- super
120
- term_cleanup(docxml)
121
- end
55
+ HEAD
56
+ end
122
57
 
123
- def term_cleanup(docxml)
124
- docxml.xpath("//p[@class = 'Terms']").each do |d|
125
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
126
- h2.add_child("&nbsp;")
127
- h2.add_child(d.remove)
128
- end
129
- docxml
58
+ def make_body(xml, docxml)
59
+ body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
60
+ xml.body **body_attr do |body|
61
+ make_body1(body, docxml)
62
+ make_body2(body, docxml)
63
+ make_body3(body, docxml)
130
64
  end
65
+ end
131
66
 
132
- def info(isoxml, out)
133
- @meta.security isoxml, out
134
- super
135
- end
67
+ def html_toc(docxml)
68
+ docxml
69
+ end
136
70
 
137
- def annex_name(annex, name, div)
138
- div.h1 **{ class: "Annex" } do |t|
139
- t << "#{get_anchors[annex['id']][:label]} "
140
- t << "<b>#{name.text}</b>"
71
+ def annex_name(annex, name, div)
72
+ div.h1 **{ class: "Annex" } do |t|
73
+ t << "#{get_anchors[annex['id']][:label]}"
74
+ t.br
75
+ t.b do |b|
76
+ name&.children&.each { |c2| parse(c2, b) }
141
77
  end
142
78
  end
79
+ end
143
80
 
144
- def annex_name_lbl(clause, num)
145
- obl = l10n("(#{@inform_annex_lbl})")
146
- obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
147
- l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
148
- end
81
+ def pre_parse(node, out)
82
+ out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
83
+ end
149
84
 
150
- def pre_parse(node, out)
151
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
85
+ def term_defs_boilerplate(div, source, term, preface)
86
+ if source.empty? && term.nil?
87
+ div << @no_terms_boilerplate
88
+ else
89
+ div << term_defs_boilerplate_cont(source, term)
152
90
  end
91
+ end
153
92
 
154
- def term_defs_boilerplate(div, source, term, preface)
155
- if source.empty? && term.nil?
156
- div << @no_terms_boilerplate
157
- else
158
- div << term_defs_boilerplate_cont(source, term)
159
- end
160
- end
93
+ def i18n_init(lang, script)
94
+ super
95
+ @annex_lbl = "Appendix"
96
+ end
161
97
 
162
- def i18n_init(lang, script)
98
+ def error_parse(node, out)
99
+ # catch elements not defined in ISO
100
+ case node.name
101
+ when "pre"
102
+ pre_parse(node, out)
103
+ when "keyword"
104
+ out.span node.text, **{ class: "keyword" }
105
+ else
163
106
  super
164
- @annex_lbl = "Appendix"
165
- end
166
-
167
- def error_parse(node, out)
168
- # catch elements not defined in ISO
169
- case node.name
170
- when "pre"
171
- pre_parse(node, out)
172
- when "keyword"
173
- out.span node.text, **{ class: "keyword" }
174
- else
175
- super
176
- end
177
107
  end
108
+ end
178
109
 
179
- def fileloc(loc)
180
- File.join(File.dirname(__FILE__), loc)
181
- end
110
+ def fileloc(loc)
111
+ File.join(File.dirname(__FILE__), loc)
112
+ end
182
113
 
183
- def cleanup(docxml)
184
- super
185
- term_cleanup(docxml)
186
- end
114
+ def cleanup(docxml)
115
+ super
116
+ term_cleanup(docxml)
117
+ end
187
118
 
188
- def term_cleanup(docxml)
189
- docxml.xpath("//p[@class = 'Terms']").each do |d|
190
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
191
- h2.add_child("&nbsp;")
192
- h2.add_child(d.remove)
193
- end
194
- docxml
119
+ def term_cleanup(docxml)
120
+ docxml.xpath("//p[@class = 'Terms']").each do |d|
121
+ h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
122
+ h2.add_child("&nbsp;")
123
+ h2.add_child(d.remove)
195
124
  end
125
+ docxml
126
+ end
196
127
 
128
+ def info(isoxml, out)
129
+ @meta.security isoxml, out
130
+ super
197
131
  end
132
+
198
133
  end
199
134
  end
135
+ end
200
136
 
@@ -10,7 +10,6 @@ module IsoDoc
10
10
  def initialize(options)
11
11
  @libdir = File.dirname(__FILE__)
12
12
  super
13
- #system "cp #{html_doc_path('logo.jpg')} logo.jpg"
14
13
  FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
15
14
  @files_to_delete << "logo.jpg"
16
15
  end
@@ -70,14 +69,11 @@ module IsoDoc
70
69
  def annex_name(annex, name, div)
71
70
  div.h1 **{ class: "Annex" } do |t|
72
71
  t << "#{get_anchors[annex['id']][:label]} "
73
- t << "<b>#{name.text}</b>"
72
+ t.br
73
+ t.b do |b|
74
+ name&.children&.each { |c2| parse(c2, b) }
75
+ end
74
76
  end
75
- end
76
-
77
- def annex_name_lbl(clause, num)
78
- obl = l10n("(#{@inform_annex_lbl})")
79
- obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
80
- l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
81
77
  end
82
78
 
83
79
  def pre_parse(node, out)
@@ -131,67 +127,6 @@ module IsoDoc
131
127
  @meta.security isoxml, out
132
128
  super
133
129
  end
134
-
135
- def annex_name(annex, name, div)
136
- div.h1 **{ class: "Annex" } do |t|
137
- t << "#{get_anchors[annex['id']][:label]} "
138
- t << "<b>#{name.text}</b>"
139
- end
140
- end
141
-
142
- def annex_name_lbl(clause, num)
143
- obl = l10n("(#{@inform_annex_lbl})")
144
- obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
145
- l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
146
- end
147
-
148
- def pre_parse(node, out)
149
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
150
- end
151
-
152
- def term_defs_boilerplate(div, source, term, preface)
153
- if source.empty? && term.nil?
154
- div << @no_terms_boilerplate
155
- else
156
- div << term_defs_boilerplate_cont(source, term)
157
- end
158
- end
159
-
160
- def i18n_init(lang, script)
161
- super
162
- @annex_lbl = "Appendix"
163
- end
164
-
165
- def error_parse(node, out)
166
- # catch elements not defined in ISO
167
- case node.name
168
- when "pre"
169
- pre_parse(node, out)
170
- when "keyword"
171
- out.span node.text, **{ class: "keyword" }
172
- else
173
- super
174
- end
175
- end
176
-
177
- def fileloc(loc)
178
- File.join(File.dirname(__FILE__), loc)
179
- end
180
-
181
- def cleanup(docxml)
182
- super
183
- term_cleanup(docxml)
184
- end
185
-
186
- def term_cleanup(docxml)
187
- docxml.xpath("//p[@class = 'Terms']").each do |d|
188
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
189
- h2.add_child("&nbsp;")
190
- h2.add_child(d.remove)
191
- end
192
- docxml
193
- end
194
-
195
130
  end
196
131
  end
197
132
  end
@@ -11,7 +11,6 @@ module IsoDoc
11
11
  def initialize(options)
12
12
  @libdir = File.dirname(__FILE__)
13
13
  super
14
- #system "cp #{html_doc_path('logo.jpg')} logo.jpg"
15
14
  FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
16
15
  end
17
16
 
@@ -95,14 +94,11 @@ module IsoDoc
95
94
  def annex_name(annex, name, div)
96
95
  div.h1 **{ class: "Annex" } do |t|
97
96
  t << "#{get_anchors[annex['id']][:label]} "
98
- t << "<b>#{name.text}</b>"
97
+ t.br
98
+ t.b do |b|
99
+ name&.children&.each { |c2| parse(c2, b) }
100
+ end
99
101
  end
100
- end
101
-
102
- def annex_name_lbl(clause, num)
103
- obl = l10n("(#{@inform_annex_lbl})")
104
- obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
105
- l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
106
102
  end
107
103
 
108
104
  def pre_parse(node, out)
@@ -22,8 +22,8 @@ module Metanorma
22
22
  "Metanorma::Acme #{Metanorma::Acme::VERSION}"
23
23
  end
24
24
 
25
- def input_to_isodoc(file)
26
- Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
25
+ def input_to_isodoc(file, filename)
26
+ Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
27
27
  end
28
28
 
29
29
  def extract_options(file)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Acme
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -28,8 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "asciidoctor", "~> 1.5.7"
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  spec.add_dependency "ruby-jing"
31
-
32
- spec.add_dependency "metanorma-standoc", "~> 1.0.0"
31
+ spec.add_dependency "metanorma-standoc", "~> 1.0.8"
33
32
  spec.add_dependency "isodoc", "~> 0.9.0"
34
33
 
35
34
  spec.add_development_dependency "bundler", "~> 1.15"
@@ -42,6 +41,6 @@ Gem::Specification.new do |spec|
42
41
  spec.add_development_dependency "rubocop", "~> 0.50"
43
42
  spec.add_development_dependency "simplecov", "~> 0.15"
44
43
  spec.add_development_dependency "timecop", "~> 0.9"
45
- spec.add_development_dependency "metanorma", "~> 0.2.5"
46
- spec.add_development_dependency "metanorma-cli", "~> 1.0.0"
44
+ spec.add_development_dependency "metanorma", "~> 0.3.0"
45
+ spec.add_development_dependency "metanorma-cli", "~> 1.0.3"
47
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-acme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: 1.0.8
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.0.0
68
+ version: 1.0.8
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: isodoc
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -226,28 +226,28 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 0.2.5
229
+ version: 0.3.0
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 0.2.5
236
+ version: 0.3.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: metanorma-cli
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: 1.0.0
243
+ version: 1.0.3
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: 1.0.0
250
+ version: 1.0.3
251
251
  description: |
252
252
  Metanorma for the (fictitious) Acme Corp.
253
253
 
@@ -259,6 +259,10 @@ extensions: []
259
259
  extra_rdoc_files: []
260
260
  files:
261
261
  - ".gitignore"
262
+ - ".hound.yml"
263
+ - ".rubocop.ribose.yml"
264
+ - ".rubocop.tb.yml"
265
+ - ".rubocop.yml"
262
266
  - ".travis.yml"
263
267
  - CODE_OF_CONDUCT.md
264
268
  - Gemfile