metanorma-gb 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/gb/converter.rb +1 -6
- data/lib/asciidoctor/gb/reqt.rng +1 -1
- data/lib/isodoc/gb/gbbaseconvert.rb +7 -7
- data/lib/isodoc/gb/metadata.rb +7 -6
- data/lib/metanorma/gb/version.rb +1 -1
- data/metanorma-gb.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc1b7d14c6fb7838469307406ad9d9942ca59faedbc998f2a4c49db97f02701
|
4
|
+
data.tar.gz: 79fbf7df72778a85f056b2bdb8dd5f9d96733fb11fb21c243ae9c9d3fa77d330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70999dfd783e9d8a955a4bdb715c862c4695d8057095f9fada0fead6d6f0b5ae0abca77e702ca1fcdc2ab7f8a0d3b195d6117e66f61f0a73954f4a9f70e8500b
|
7
|
+
data.tar.gz: 38de8f7e1f2326d3b8f96d259e49eb03d17e596f901d91a6ba2a844f0b31e390c75d101109b0e5b5125c946b2cc0cacf2f9c2cadf74b438cbb7b49ff8c9b38c4
|
@@ -184,12 +184,7 @@ module Asciidoctor
|
|
184
184
|
def fetch_ref(xml, code, year, **opts)
|
185
185
|
code = "CN(#{code})" if !/^CN\(/.match(code) &&
|
186
186
|
/^#{GBCODE}[^A-Za-z]/.match(code)
|
187
|
-
|
188
|
-
return nil if hit.nil?
|
189
|
-
xml.parent.add_child(Asciidoctor::Standoc::Utils::smart_render_xml(hit))
|
190
|
-
xml
|
191
|
-
rescue Algolia::AlgoliaProtocolError
|
192
|
-
nil # Render reference without an Internet connection.
|
187
|
+
super
|
193
188
|
end
|
194
189
|
|
195
190
|
def cleanup(xmldoc)
|
data/lib/asciidoctor/gb/reqt.rng
CHANGED
@@ -77,11 +77,11 @@ module IsoDoc
|
|
77
77
|
out.table **{ class: "dl" } do |v|
|
78
78
|
node.elements.each_slice(2) do |dt, dd|
|
79
79
|
v.tr do |tr|
|
80
|
-
tr.td **{
|
80
|
+
tr.td **{ style: "vertical-align:top;text-align:left;" } do |term|
|
81
81
|
dt_parse(dt, term)
|
82
82
|
end
|
83
|
-
tr.td(**{
|
84
|
-
tr.td **{
|
83
|
+
tr.td(**{ style: "vertical-align:top;" }) { |td| td << "—" }
|
84
|
+
tr.td **{ style: "vertical-align:top;" } do |listitem|
|
85
85
|
dd.children.each { |n| parse(n, listitem) }
|
86
86
|
end
|
87
87
|
end
|
@@ -90,8 +90,8 @@ module IsoDoc
|
|
90
90
|
end
|
91
91
|
|
92
92
|
EXAMPLE_TBL_ATTR =
|
93
|
-
{
|
94
|
-
style: "padding:2pt 2pt 2pt 2pt" }.freeze
|
93
|
+
{ class: "example_label",
|
94
|
+
style: "padding:2pt 2pt 2pt 2pt;vertical-align:top;" }.freeze
|
95
95
|
|
96
96
|
def example_label(node)
|
97
97
|
l10n(super + ":")
|
@@ -105,7 +105,7 @@ module IsoDoc
|
|
105
105
|
tr.td **EXAMPLE_TBL_ATTR do |td|
|
106
106
|
td << l10n(note_label(node) + ":")
|
107
107
|
end
|
108
|
-
tr.td **{
|
108
|
+
tr.td **{ style: "vertical-align:top;", class: "Note" } do |td|
|
109
109
|
node.children.each { |n| parse(n, td) }
|
110
110
|
end
|
111
111
|
end
|
@@ -120,7 +120,7 @@ module IsoDoc
|
|
120
120
|
tr.td **EXAMPLE_TBL_ATTR do |td|
|
121
121
|
td << l10n("#{anchor(node['id'], :label)}:")
|
122
122
|
end
|
123
|
-
tr.td **{
|
123
|
+
tr.td **{ style: "vertical-align:top;", class: "Note" } do |td|
|
124
124
|
node.children.each { |n| parse(n, td) }
|
125
125
|
end
|
126
126
|
end
|
data/lib/isodoc/gb/metadata.rb
CHANGED
@@ -102,16 +102,16 @@ module IsoDoc
|
|
102
102
|
|
103
103
|
def stage_abbrev(stage, iter, draft)
|
104
104
|
stage = STAGE_ABBRS[stage.to_sym] || "??"
|
105
|
-
stage += iter
|
106
|
-
stage = "Pre" + stage if draft
|
105
|
+
stage += iter if iter
|
106
|
+
stage = "Pre" + stage if draft =~ /^0\./
|
107
107
|
stage
|
108
108
|
end
|
109
109
|
|
110
110
|
def stage_abbrev_cn(stage, iter, draft)
|
111
111
|
return stage_abbrev(stage, iter, draft) if @lang != "zh"
|
112
112
|
stage = STAGE_ABBRS_CN[stage.to_sym] || "??"
|
113
|
-
stage = "#{iter.
|
114
|
-
stage = "Pre" + HTMLEntities.new.encode(stage, :hexadecimal) if draft
|
113
|
+
stage = "#{iter.to_i.localize(:zh).spellout.force_encoding("UTF-8")}次#{stage}" if iter
|
114
|
+
stage = "Pre" + HTMLEntities.new.encode(stage, :hexadecimal) if draft =~ /^0\./
|
115
115
|
stage
|
116
116
|
end
|
117
117
|
|
@@ -121,8 +121,9 @@ module IsoDoc
|
|
121
121
|
if docstatus
|
122
122
|
set(:stage, docstatus.text.to_i)
|
123
123
|
set(:unpublished, docstatus.text.to_i < 60)
|
124
|
-
abbr = stage_abbrev_cn(docstatus.text,
|
125
|
-
isoxml
|
124
|
+
abbr = stage_abbrev_cn(docstatus.text,
|
125
|
+
isoxml&.at(ns("//bibdata/status/iteration"))&.text,
|
126
|
+
isoxml&.at(ns("//version/draft"))&.text)
|
126
127
|
set(:stageabbr, abbr)
|
127
128
|
set(:status, STATUS_CSS[docstatus.text.to_sym])
|
128
129
|
end
|
data/lib/metanorma/gb/version.rb
CHANGED
data/metanorma-gb.gemspec
CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
31
31
|
|
32
|
-
spec.add_dependency "metanorma-iso", "~> 1.
|
33
|
-
spec.add_dependency "isodoc", "~> 0.
|
32
|
+
spec.add_dependency "metanorma-iso", "~> 1.3.0"
|
33
|
+
spec.add_dependency "isodoc", "~> 1.0.0"
|
34
34
|
spec.add_dependency "twitter_cldr", "~> 4.4.4"
|
35
35
|
spec.add_dependency "gb-agencies", "~> 0.0.4"
|
36
36
|
spec.add_dependency "htmlentities", "~> 4.3.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.
|
4
|
+
version: 1.3.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-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3.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.
|
26
|
+
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: isodoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 1.0.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: 0.
|
40
|
+
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: twitter_cldr
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|