metanorma-rsd 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.yml +10 -0
- data/lib/asciidoctor/rsd/biblio.rng +10 -0
- data/lib/asciidoctor/rsd/converter.rb +10 -9
- data/lib/asciidoctor/rsd/isodoc.rng +3 -0
- data/lib/asciidoctor/rsd/isostandard.rng +6 -0
- data/lib/asciidoctor/rsd/rsd.rng +3 -0
- data/lib/isodoc/rsd/html/html_rsd_titlepage.html +1 -2
- data/lib/isodoc/rsd/html/htmlstyle.scss +1 -1
- data/lib/isodoc/rsd/html/word_rsd_titlepage.html +1 -1
- data/lib/isodoc/rsd/metadata.rb +1 -12
- data/lib/isodoc/rsd/word_convert.rb +0 -29
- data/lib/metanorma/rsd/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b3faf336bcf41627e1d1ef606370b69f61ee557d57f62b48fa8725d186a3c3
|
4
|
+
data.tar.gz: 93a068bf291392e7726b26dc9d7e47d670fd96d3ea33282f4373ce7b28400ae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3be851a5cae952ce487faa7fddc11badc94a0e4ab4db38b9b676d7dbedaf600767d5ae18c30ad78e69e13a355bebff2ab91c245a59171f0930d0d5a018d2df27
|
7
|
+
data.tar.gz: cfc15d586a6323688fcb2cadd645cbafc0f82f81c82e603ab9c773521fd888451a0cd460db7a03b4f9faa52a45effaa1a138283e99b9f3eb5062c9a1852af1a6
|
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# This project follows the Ribose OSS style guide.
|
2
|
+
# https://github.com/riboseinc/oss-guides
|
3
|
+
# All project-specific additions and overrides should be specified in this file.
|
4
|
+
|
5
|
+
inherit_from:
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.3
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
@@ -476,6 +476,9 @@
|
|
476
476
|
<zeroOrMore>
|
477
477
|
<ref name="docidentifier"/>
|
478
478
|
</zeroOrMore>
|
479
|
+
<optional>
|
480
|
+
<ref name="docnumber"/>
|
481
|
+
</optional>
|
479
482
|
<zeroOrMore>
|
480
483
|
<ref name="bdate"/>
|
481
484
|
</zeroOrMore>
|
@@ -637,6 +640,8 @@
|
|
637
640
|
<value>transmitted</value>
|
638
641
|
<value>copied</value>
|
639
642
|
<value>unchanged</value>
|
643
|
+
<value>circulated</value>
|
644
|
+
<text/>
|
640
645
|
</choice>
|
641
646
|
</attribute>
|
642
647
|
<choice>
|
@@ -673,6 +678,11 @@
|
|
673
678
|
<text/>
|
674
679
|
</element>
|
675
680
|
</define>
|
681
|
+
<define name="docnumber">
|
682
|
+
<element name="docnumber">
|
683
|
+
<text/>
|
684
|
+
</element>
|
685
|
+
</define>
|
676
686
|
<define name="bclassification">
|
677
687
|
<element name="classification">
|
678
688
|
<optional>
|
@@ -51,20 +51,21 @@ module Asciidoctor
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def title(node, xml)
|
55
|
-
["en"].each do |lang|
|
56
|
-
xml.title **{ language: lang, format: "plain" } do |t|
|
57
|
-
t << asciidoc_sub(node.attr("title"))
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
54
|
def metadata_status(node, xml)
|
63
55
|
xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
|
64
56
|
end
|
65
57
|
|
66
58
|
def metadata_id(node, xml)
|
67
|
-
|
59
|
+
docstatus = node.attr("status")
|
60
|
+
dn = node.attr("docnumber")
|
61
|
+
if docstatus
|
62
|
+
abbr = IsoDoc::Rsd::Metadata.new("en", "Latn", {}).
|
63
|
+
status_abbr(docstatus)
|
64
|
+
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
65
|
+
end
|
66
|
+
node.attr("copyright-year") and dn += ":#{node.attr("copyright-year")}"
|
67
|
+
xml.docidentifier dn, **{type: "rsd"}
|
68
|
+
xml.docnumber { |i| i << node.attr("docnumber") }
|
68
69
|
end
|
69
70
|
|
70
71
|
def metadata_copyright(node, xml)
|
@@ -84,6 +84,9 @@
|
|
84
84
|
<zeroOrMore>
|
85
85
|
<ref name="docidentifier"/>
|
86
86
|
</zeroOrMore>
|
87
|
+
<optional>
|
88
|
+
<ref name="docnumber"/>
|
89
|
+
</optional>
|
87
90
|
<zeroOrMore>
|
88
91
|
<ref name="bdate"/>
|
89
92
|
</zeroOrMore>
|
@@ -163,6 +166,9 @@
|
|
163
166
|
<zeroOrMore>
|
164
167
|
<ref name="docidentifier"/>
|
165
168
|
</zeroOrMore>
|
169
|
+
<optional>
|
170
|
+
<ref name="docnumber"/>
|
171
|
+
</optional>
|
166
172
|
<zeroOrMore>
|
167
173
|
<ref name="bdate"/>
|
168
174
|
</zeroOrMore>
|
data/lib/asciidoctor/rsd/rsd.rng
CHANGED
@@ -19,8 +19,7 @@
|
|
19
19
|
<div class="coverpage-doc-identity">
|
20
20
|
<div class="doc-number">
|
21
21
|
<span class="docnumber">{{ docnumber }}</span>
|
22
|
-
<span class="
|
23
|
-
<span class="docyear">{{ docyear }} {{ draftinfo }}</span>
|
22
|
+
<span class="docyear">{{ draftinfo }}</span>
|
24
23
|
</div>
|
25
24
|
|
26
25
|
<div class="coverpage-title">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<p class="MsoNormal" align="right" style='text-align:right'><b style='mso-bidi-font-weight:
|
2
|
-
normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ docnumber }}
|
2
|
+
normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ docnumber }} {{ draftinfo }}</span></b><b
|
3
3
|
style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:14.0pt'><o:p></o:p></span></b></p>
|
4
4
|
|
5
5
|
<p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB"
|
data/lib/isodoc/rsd/metadata.rb
CHANGED
@@ -25,18 +25,7 @@ module IsoDoc
|
|
25
25
|
|
26
26
|
def docid(isoxml, _out)
|
27
27
|
docnumber = isoxml.at(ns("//bibdata/docidentifier"))
|
28
|
-
|
29
|
-
dn = docnumber&.text
|
30
|
-
if docstatus
|
31
|
-
set(:status, status_print(docstatus.text))
|
32
|
-
abbr = status_abbr(docstatus.text)
|
33
|
-
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
34
|
-
end
|
35
|
-
set(:docnumber, dn)
|
36
|
-
end
|
37
|
-
|
38
|
-
def status_print(status)
|
39
|
-
status.split(/-/).map{ |w| w.capitalize }.join(" ")
|
28
|
+
set(:docnumber, docnumber&.text)
|
40
29
|
end
|
41
30
|
|
42
31
|
def status_abbr(status)
|
@@ -57,35 +57,6 @@ module IsoDoc
|
|
57
57
|
section_break(body)
|
58
58
|
end
|
59
59
|
|
60
|
-
def title(isoxml, _out)
|
61
|
-
main = isoxml&.at(ns("//title[@language='en']"))&.text
|
62
|
-
set_metadata(:doctitle, main)
|
63
|
-
end
|
64
|
-
|
65
|
-
def generate_header(filename, dir)
|
66
|
-
return unless @header
|
67
|
-
template = Liquid::Template.parse(File.read(@header, encoding: "UTF-8"))
|
68
|
-
meta = @meta.get
|
69
|
-
meta[:filename] = filename
|
70
|
-
params = meta.map { |k, v| [k.to_s, v] }.to_h
|
71
|
-
File.open("header.html", "w") { |f| f.write(template.render(params)) }
|
72
|
-
@files_to_delete << "header.html"
|
73
|
-
"header.html"
|
74
|
-
end
|
75
|
-
|
76
|
-
def header_strip(h)
|
77
|
-
h = h.to_s.gsub(%r{<br/>}, " ").sub(/<\/?h[12][^>]*>/, "")
|
78
|
-
h1 = to_xhtml_fragment(h.dup)
|
79
|
-
h1.traverse do |x|
|
80
|
-
x.replace(" ") if x.name == "span" &&
|
81
|
-
/mso-tab-count/.match(x["style"])
|
82
|
-
x.remove if x.name == "span" && x["class"] == "MsoCommentReference"
|
83
|
-
x.remove if x.name == "a" && x["epub:type"] == "footnote"
|
84
|
-
x.replace(x.children) if x.name == "a"
|
85
|
-
end
|
86
|
-
from_xhtml(h1)
|
87
|
-
end
|
88
|
-
|
89
60
|
def info(isoxml, out)
|
90
61
|
@meta.security isoxml, out
|
91
62
|
super
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-rsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
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-
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -247,6 +247,8 @@ extensions: []
|
|
247
247
|
extra_rdoc_files: []
|
248
248
|
files:
|
249
249
|
- ".gitignore"
|
250
|
+
- ".hound.yml"
|
251
|
+
- ".rubocop.yml"
|
250
252
|
- ".travis.yml"
|
251
253
|
- CODE_OF_CONDUCT.md
|
252
254
|
- Gemfile
|