metanorma-csand 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/csand/biblio.rng +10 -0
- data/lib/asciidoctor/csand/converter.rb +10 -9
- data/lib/asciidoctor/csand/isodoc.rng +3 -0
- data/lib/asciidoctor/csand/isostandard.rng +6 -0
- data/lib/isodoc/csand/html/html_csand_titlepage.html +0 -2
- data/lib/isodoc/csand/html/htmlstyle.scss +5 -0
- data/lib/isodoc/csand/metadata.rb +2 -13
- data/lib/metanorma/csand/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: aaa18ba2049c946b9db17988b63c4137cf3db235aedaad050dad6dad2f31e47e
|
4
|
+
data.tar.gz: f2af1a2be2115d40f09a959e6a2822ce7f2ba2c3c68a447971e5577dfeec65a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f3835f9c4adaff9a3490c79b00b74493191fde0445df02e22ea2dc1ce40e072486a49b9d617b26cd707bf23fff1d500cd3c5fc1cadea7d24a6b52475178181
|
7
|
+
data.tar.gz: 7ee7a3824c0ead9b0cde7e7337d3623ed6759a37de33f3721fb804988f37bded40fe7661b7e5c2f21dbc5dd790e1ba4a514bef7ac6910a7fcd8a1c050dc38547
|
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>
|
@@ -45,20 +45,21 @@ module Asciidoctor
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
def title(node, xml)
|
49
|
-
["en"].each do |lang|
|
50
|
-
xml.title **{ language: lang, format: "plain" } do |t|
|
51
|
-
t << asciidoc_sub(node.attr("title"))
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
48
|
def metadata_status(node, xml)
|
57
49
|
xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
|
58
50
|
end
|
59
51
|
|
60
52
|
def metadata_id(node, xml)
|
61
|
-
|
53
|
+
docstatus = node.attr("status")
|
54
|
+
dn = node.attr("docnumber")
|
55
|
+
if docstatus
|
56
|
+
abbr = IsoDoc::Csand::Metadata.new("en", "Latn", {}).
|
57
|
+
status_abbr(docstatus)
|
58
|
+
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
59
|
+
end
|
60
|
+
node.attr("copyright-year") and dn += ":#{node.attr("copyright-year")}"
|
61
|
+
xml.docidentifier dn, **{type: "csand"}
|
62
|
+
xml.docnumber { |i| i << node.attr("docnumber") }
|
62
63
|
end
|
63
64
|
|
64
65
|
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>
|
@@ -27,19 +27,8 @@ module IsoDoc
|
|
27
27
|
|
28
28
|
|
29
29
|
def docid(isoxml, _out)
|
30
|
-
docnumber = isoxml.at(ns("//bibdata/docidentifier"))
|
31
|
-
|
32
|
-
dn = docnumber&.text
|
33
|
-
if docstatus
|
34
|
-
set(:status, status_print(docstatus.text))
|
35
|
-
abbr = status_abbr(docstatus.text)
|
36
|
-
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
37
|
-
end
|
38
|
-
set(:docnumber, dn)
|
39
|
-
end
|
40
|
-
|
41
|
-
def status_print(status)
|
42
|
-
status.split(/-/).map{ |w| w.capitalize }.join(" ")
|
30
|
+
docnumber = isoxml.at(ns("//bibdata/docidentifier[@type = 'csand']"))
|
31
|
+
set(:docnumber, docnumber&.text)
|
43
32
|
end
|
44
33
|
|
45
34
|
def status_abbr(status)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csand
|
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
|
@@ -345,6 +345,8 @@ extensions: []
|
|
345
345
|
extra_rdoc_files: []
|
346
346
|
files:
|
347
347
|
- ".gitignore"
|
348
|
+
- ".hound.yml"
|
349
|
+
- ".rubocop.yml"
|
348
350
|
- ".travis.yml"
|
349
351
|
- CODE_OF_CONDUCT.md
|
350
352
|
- Gemfile
|