metanorma-gb 1.0.12 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/asciidoctor/gb/biblio.rng +21 -11
- data/lib/asciidoctor/gb/isodoc.rng +3 -0
- data/lib/isodoc/gb/gbconvert.rb +8 -8
- data/lib/isodoc/gb/gbhtmlrender.rb +6 -15
- data/lib/isodoc/gb/gbwordrender.rb +2 -2
- data/lib/isodoc/gb/html/htmlcompliantstyle.scss +0 -1
- data/lib/isodoc/gb/html/htmlstyle.scss +2 -1
- data/lib/isodoc/gb/metadata.rb +1 -1
- data/lib/metanorma/gb/version.rb +1 -1
- data/metanorma-gb.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10351e9508e07385bebe80fc1655dcb55da123a23263140f8bc5d2924289a404
|
4
|
+
data.tar.gz: 05ac2092d8dcab14fd2010de03473265835427d0326c0c565fe6c824483e777d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2267cd3211dd73c0d7add935a7f1318f44e18ea771ea90e744a85d0b1d609a8cc42203142128a288bbb1895f9e633387d65c4d400b09392257b91405e217b5b8
|
7
|
+
data.tar.gz: 361e89d32fd9f188d2d117e596760ada3f67442a074d42e32fba1ef8d0f12ce41118861085cd85b27de786571d9d2ce7264805fbf5097d583d27acb1e5b27564
|
data/.travis.yml
CHANGED
@@ -286,18 +286,23 @@
|
|
286
286
|
</define>
|
287
287
|
<define name="address">
|
288
288
|
<element name="address">
|
289
|
-
<
|
289
|
+
<choice>
|
290
290
|
<!-- iso191606 TODO -->
|
291
|
-
<
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
291
|
+
<group>
|
292
|
+
<oneOrMore>
|
293
|
+
<ref name="street"/>
|
294
|
+
</oneOrMore>
|
295
|
+
<ref name="city"/>
|
296
|
+
<optional>
|
297
|
+
<ref name="state"/>
|
298
|
+
</optional>
|
299
|
+
<ref name="country"/>
|
300
|
+
<optional>
|
301
|
+
<ref name="postcode"/>
|
302
|
+
</optional>
|
303
|
+
</group>
|
304
|
+
<ref name="formattedAddress"/>
|
305
|
+
</choice>
|
301
306
|
</element>
|
302
307
|
</define>
|
303
308
|
<define name="street">
|
@@ -325,6 +330,11 @@
|
|
325
330
|
<text/>
|
326
331
|
</element>
|
327
332
|
</define>
|
333
|
+
<define name="formattedAddress">
|
334
|
+
<element name="formattedAddress">
|
335
|
+
<text/>
|
336
|
+
</element>
|
337
|
+
</define>
|
328
338
|
<define name="person-identifier">
|
329
339
|
<element name="identifier">
|
330
340
|
<attribute name="type">
|
data/lib/isodoc/gb/gbconvert.rb
CHANGED
@@ -21,11 +21,11 @@ module IsoDoc
|
|
21
21
|
File.join(File.dirname(__FILE__), loc)
|
22
22
|
end
|
23
23
|
|
24
|
-
def format_agency(agency, format)
|
25
|
-
return "<img class='logo' src='#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
|
24
|
+
def format_agency(agency, format, localdir)
|
25
|
+
return "<img class='logo' src='#{localdir}/#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
|
26
26
|
return agency unless agency.is_a?(Array)
|
27
27
|
if agency == ["中华人民共和国国家质量监督检验检疫总局", "中国国家标准化管理委员会"]
|
28
|
-
logo = "gb-issuer-default.gif"
|
28
|
+
logo = "#{localdir}/gb-issuer-default.gif"
|
29
29
|
FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
|
30
30
|
return "<img class='logo' src='#{logo}' alt='#{agency.join(",")}'></img>"
|
31
31
|
end
|
@@ -40,14 +40,14 @@ module IsoDoc
|
|
40
40
|
ret
|
41
41
|
end
|
42
42
|
|
43
|
-
def format_logo(prefix, scope, _format)
|
43
|
+
def format_logo(prefix, scope, _format, localdir)
|
44
44
|
logo = @meta.standard_logo(prefix)
|
45
|
-
return format_logo1(logo, prefix, scope) if @standardlogoimg
|
45
|
+
return format_logo1(logo, prefix, scope, localdir) if @standardlogoimg
|
46
46
|
return "" if %w(enterprise social-group).include? scope
|
47
47
|
if logo.nil?
|
48
48
|
"<span style='font-size:36pt;font-weight:bold'>#{prefix}</span>"
|
49
49
|
else
|
50
|
-
format_logo1(logo, prefix, scope)
|
50
|
+
format_logo1("#{localdir}/#{logo}", prefix, scope, localdir)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -58,9 +58,9 @@ module IsoDoc
|
|
58
58
|
end
|
59
59
|
|
60
60
|
|
61
|
-
def format_logo1(logo, prefix, scope)
|
61
|
+
def format_logo1(logo, prefix, scope, localdir)
|
62
62
|
local = local_logo_suffix(scope)
|
63
|
-
return "<img class='logo' width='113' height='56' src='#{@standardlogoimg}' alt='#{prefix}'></img>"\
|
63
|
+
return "<img class='logo' width='113' height='56' src='#{localdir}/#{@standardlogoimg}' alt='#{prefix}'></img>"\
|
64
64
|
"#{local}" if @standardlogoimg
|
65
65
|
logo += ".gif"
|
66
66
|
FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
|
@@ -39,17 +39,8 @@ module IsoDoc
|
|
39
39
|
{ valign: "top", class: "example_label",
|
40
40
|
style: "padding:2pt 2pt 2pt 2pt" }.freeze
|
41
41
|
|
42
|
-
def
|
43
|
-
|
44
|
-
t.tr do |tr|
|
45
|
-
tr.td **EXAMPLE_TBL_ATTR do |td|
|
46
|
-
td << l10n(example_label(node) + ":")
|
47
|
-
end
|
48
|
-
tr.td **{ valign: "top", class: "example" } do |td|
|
49
|
-
node.children.each { |n| parse(n, td) }
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
42
|
+
def example_label(node)
|
43
|
+
l10n(super + ":")
|
53
44
|
end
|
54
45
|
|
55
46
|
def note_parse(node, out)
|
@@ -134,11 +125,11 @@ module IsoDoc
|
|
134
125
|
|
135
126
|
def populate_template(docxml, format)
|
136
127
|
meta = @meta.get.merge(@labels)
|
137
|
-
logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format)
|
128
|
+
logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format, @localdir)
|
138
129
|
logofile = @meta.standard_logo(meta[:gbprefix])
|
139
130
|
docxml = termref_resolve(docxml)
|
140
131
|
meta[:standard_agency_formatted] =
|
141
|
-
@common.format_agency(meta[:standard_agency], format)
|
132
|
+
@common.format_agency(meta[:standard_agency], format, @localdir)
|
142
133
|
meta[:standard_logo] = logo
|
143
134
|
template = Liquid::Template.parse(docxml)
|
144
135
|
template.render(meta.map { |k, v| [k.to_s, v] }.to_h)
|
@@ -183,8 +174,8 @@ module IsoDoc
|
|
183
174
|
div.h1 **{ class: "Annex" } do |t|
|
184
175
|
t << "#{get_anchors[annex['id']][:label]}<br/><br/>"
|
185
176
|
t.b do |b|
|
186
|
-
|
187
|
-
|
177
|
+
name&.children&.each { |c2| parse(c2, b) }
|
178
|
+
end
|
188
179
|
end
|
189
180
|
end
|
190
181
|
|
@@ -134,12 +134,12 @@ module IsoDoc
|
|
134
134
|
|
135
135
|
def populate_template(docxml, format)
|
136
136
|
meta = @meta.get.merge(@labels)
|
137
|
-
logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format)
|
137
|
+
logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format, @localdir)
|
138
138
|
logofile = @meta.standard_logo(meta[:gbprefix])
|
139
139
|
@files_to_delete << logofile + ".gif" unless logofile.nil?
|
140
140
|
docxml = termref_resolve(docxml)
|
141
141
|
meta[:standard_agency_formatted] =
|
142
|
-
@common.format_agency(meta[:standard_agency], format)
|
142
|
+
@common.format_agency(meta[:standard_agency], format, @localdir)
|
143
143
|
meta[:standard_logo] = logo
|
144
144
|
template = Liquid::Template.parse(docxml)
|
145
145
|
template.render(meta.map { |k, v| [k.to_s, v] }.to_h)
|
@@ -878,6 +878,7 @@ text-align: center;
|
|
878
878
|
padding: 0.5em;
|
879
879
|
margin: 2em 0 1em 0;
|
880
880
|
text-align: left;
|
881
|
+
padding-left: 2em;
|
881
882
|
}
|
882
883
|
|
883
884
|
.example p {
|
@@ -887,8 +888,8 @@ text-align: center;
|
|
887
888
|
.example .example-title {
|
888
889
|
font-weight: 700;
|
889
890
|
text-transform: uppercase;
|
890
|
-
text-align: center;
|
891
891
|
margin-top:0;
|
892
|
+
margin-left:-1.5em;
|
892
893
|
}
|
893
894
|
|
894
895
|
/*
|
data/lib/isodoc/gb/metadata.rb
CHANGED
@@ -158,7 +158,7 @@ module IsoDoc
|
|
158
158
|
def standard_class(scope, prefix, mandate)
|
159
159
|
standardclassimg = get[:standardclassimg]
|
160
160
|
ret = @agencies.standard_class(scope, prefix, mandate)
|
161
|
-
return "<img class='logo' src='#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
|
161
|
+
return "<img class='logo' src='#{@localdir}/#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
|
162
162
|
ret
|
163
163
|
end
|
164
164
|
|
data/lib/metanorma/gb/version.rb
CHANGED
data/metanorma-gb.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_dependency "metanorma-iso", "~> 1.0
|
31
|
+
spec.add_dependency "metanorma-iso", "~> 1.1.0"
|
32
32
|
spec.add_dependency "isodoc", "~> 0.9.1"
|
33
33
|
spec.add_dependency "twitter_cldr"
|
34
34
|
spec.add_dependency "gb-agencies", "~> 0.0.4"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-gb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.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: 2019-01-
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: 1.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: isodoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|