metanorma-gb 1.3.15 → 1.3.16
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 -2
- data/lib/asciidoctor/gb/front.rb +1 -1
- data/lib/asciidoctor/gb/gbstandard.rng +1 -1
- data/lib/isodoc/gb/gbwordconvert.rb +26 -0
- data/lib/isodoc/gb/metadata.rb +18 -9
- data/lib/metanorma/gb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d7249dc6de3238469a43aacba0f948f627724f3741a06bdd7d68c1a4d0e04a6
|
4
|
+
data.tar.gz: c6b8a1441579a1a3130e304b8388d0ca9924c3368ae987da49f46ac6496cda82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997a008d8ba5dd0eb3c5a7be5a5058f6ee51d6d6c8787cf989911536d72a9a03a2e94c2d75f2ae0be7c159cdbbec95537c426f8674d6d4d4c960ef4a2997c794
|
7
|
+
data.tar.gz: ccec18189310fc771252d6ff176014839ea9974de5a290686aefbddea45cb3562445692939c17318421cfd09345080a521f0dff170715cfa7c82a0a7a8261123
|
@@ -15,7 +15,7 @@ module Asciidoctor
|
|
15
15
|
# schema encapsulation of the document for validation
|
16
16
|
class Converter < ISO::Converter
|
17
17
|
XML_ROOT_TAG = "gb-standard".freeze
|
18
|
-
XML_NAMESPACE = "https://www.metanorma.
|
18
|
+
XML_NAMESPACE = "https://www.metanorma.org/ns/gb".freeze
|
19
19
|
|
20
20
|
register_for "gb"
|
21
21
|
|
@@ -243,7 +243,6 @@ module Asciidoctor
|
|
243
243
|
f.at(".//term"), f.at(".//p"), isodoc)
|
244
244
|
f = xmldoc.at(self.class::NORM_REF) and
|
245
245
|
norm_ref_preface(f)
|
246
|
-
initial_boilerplate(xmldoc, isodoc)
|
247
246
|
end
|
248
247
|
end
|
249
248
|
end
|
data/lib/asciidoctor/gb/front.rb
CHANGED
@@ -199,7 +199,7 @@ module Asciidoctor
|
|
199
199
|
def id_stage_prefix(dn, node)
|
200
200
|
if node.attr("docstage") && node.attr("docstage").to_i < 60
|
201
201
|
abbr = IsoDoc::Gb::Metadata.new("en", "Latn", {}).
|
202
|
-
|
202
|
+
status_abbrev(node.attr("docstage"), node.attr("iteration"),
|
203
203
|
node.attr("draft"))
|
204
204
|
dn = "/#{abbr} #{dn}" # prefixes added in cleanup
|
205
205
|
else
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns="https://www.metanorma.
|
2
|
+
<grammar ns="https://www.metanorma.org/ns/gb" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!-- default namespace = "https://www.metanorma.com/ns/gb" -->
|
4
4
|
<!--
|
5
5
|
Currently we inherit from a namespaced grammar, isostandard. Unless we inherit from isodoc,
|
@@ -89,6 +89,32 @@ module IsoDoc
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
def make_body(xml, docxml)
|
93
|
+
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
|
94
|
+
xml.body **body_attr do |body|
|
95
|
+
make_body1(body, docxml)
|
96
|
+
make_body2(body, docxml)
|
97
|
+
make_body3(body, docxml)
|
98
|
+
colophon(body, docxml)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def colophon(body, docxml)
|
103
|
+
body.br **{ clear: "all", style: "page-break-before:left;"\
|
104
|
+
"mso-break-type:section-break" }
|
105
|
+
body.div **{ class: "colophon" } do |div|
|
106
|
+
div.p **{ class: "colophon" } do |p|
|
107
|
+
p << l10n(@meta.get[:standard_class]) # TODO break up into lines if needed
|
108
|
+
end
|
109
|
+
div.p **{ class: "colophon" } do |p|
|
110
|
+
p << l10n("#{@meta.get[:docsubtitlezh]}")
|
111
|
+
end
|
112
|
+
div.p **{ class: "colophon" } do |p|
|
113
|
+
p << l10n("#{@meta.get[:docidentifier]}")
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
92
118
|
include BaseConvert
|
93
119
|
end
|
94
120
|
end
|
data/lib/isodoc/gb/metadata.rb
CHANGED
@@ -100,15 +100,19 @@ module IsoDoc
|
|
100
100
|
"95": "obsolete",
|
101
101
|
}
|
102
102
|
|
103
|
-
def
|
103
|
+
def stage_abbr(stage)
|
104
|
+
STAGE_ABBRS[stage.to_sym] || "??"
|
105
|
+
end
|
106
|
+
|
107
|
+
def status_abbrev(stage, iter, draft)
|
104
108
|
stage = STAGE_ABBRS[stage.to_sym] || "??"
|
105
109
|
stage += iter if iter
|
106
110
|
stage = "Pre" + stage if draft =~ /^0\./
|
107
111
|
stage
|
108
112
|
end
|
109
113
|
|
110
|
-
def
|
111
|
-
return
|
114
|
+
def status_abbrev_cn(stage, iter, draft)
|
115
|
+
return status_abbrev(stage, iter, draft) if @lang != "zh"
|
112
116
|
stage = STAGE_ABBRS_CN[stage.to_sym] || "??"
|
113
117
|
stage = "#{iter.to_i.localize(:zh).spellout.force_encoding("UTF-8")}次#{stage}" if iter
|
114
118
|
stage = "Pre" + HTMLEntities.new.encode(stage, :hexadecimal) if draft =~ /^0\./
|
@@ -117,18 +121,23 @@ module IsoDoc
|
|
117
121
|
|
118
122
|
def docstatus(isoxml, _out)
|
119
123
|
docstatus = isoxml.at(ns("//bibdata/status/stage"))
|
120
|
-
set(:unpublished,
|
124
|
+
set(:unpublished, true)
|
121
125
|
if docstatus
|
122
126
|
set(:stage, docstatus.text.to_i)
|
123
|
-
set(:unpublished, docstatus.text
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
set(:stageabbr, abbr)
|
127
|
+
set(:unpublished, unpublished(docstatus.text))
|
128
|
+
set(:statusabbr, status_abbrev_cn(docstatus.text,
|
129
|
+
isoxml&.at(ns("//bibdata/status/iteration"))&.text,
|
130
|
+
isoxml&.at(ns("//version/draft"))&.text))
|
128
131
|
set(:status, STATUS_CSS[docstatus.text.to_sym])
|
132
|
+
unpublished(docstatus.text) and
|
133
|
+
set(:stageabbr, stage_abbr(docstatus.text))
|
129
134
|
end
|
130
135
|
end
|
131
136
|
|
137
|
+
def unpublished(status)
|
138
|
+
status.to_i < 60
|
139
|
+
end
|
140
|
+
|
132
141
|
def docid1(isoxml, _out)
|
133
142
|
dn = isoxml.at(ns("//bibdata/docidentifier[@type = 'gb']"))
|
134
143
|
set(:docnumber, dn&.text)
|
data/lib/metanorma/gb/version.rb
CHANGED
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.3.
|
4
|
+
version: 1.3.16
|
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-02-
|
11
|
+
date: 2020-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|