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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98b99e88b32c3e2d17a6afc7b45fd10faaac409883603438a8a31cde40eb5054
4
- data.tar.gz: 2186f48f7fcc6108ba1bb0fc0c7f259e254b43c3e41eb90605a9c54fdddcf97e
3
+ metadata.gz: 00b3faf336bcf41627e1d1ef606370b69f61ee557d57f62b48fa8725d186a3c3
4
+ data.tar.gz: 93a068bf291392e7726b26dc9d7e47d670fd96d3ea33282f4373ce7b28400ae7
5
5
  SHA512:
6
- metadata.gz: d096176eea24e61432d283604596f3dc4d38d7dc761d7041c9af23605a8588c1ef2cb4618e0c66e46eb9aff160e3848144bf3e84fc23d241d43aa65fb14438ff
7
- data.tar.gz: 9033dcc1afc7be2924018b9a23013d331ebecc2730d6fd4adece1a1425982885f693d846641b40a01ab4e11f46a817b15a145b3ccd51a159a57c4d8c8b07310f
6
+ metadata.gz: 3be851a5cae952ce487faa7fddc11badc94a0e4ab4db38b9b676d7dbedaf600767d5ae18c30ad78e69e13a355bebff2ab91c245a59171f0930d0d5a018d2df27
7
+ data.tar.gz: cfc15d586a6323688fcb2cadd645cbafc0f82f81c82e603ab9c773521fd888451a0cd460db7a03b4f9faa52a45effaa1a138283e99b9f3eb5062c9a1852af1a6
data/.hound.yml ADDED
@@ -0,0 +1,3 @@
1
+ ruby:
2
+ Enabled: true
3
+ config_file: .rubocop.yml
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
- xml.docidentifier { |i| i << node.attr("docnumber") }
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)
@@ -1034,6 +1034,9 @@
1034
1034
  <zeroOrMore>
1035
1035
  <ref name="docidentifier"/>
1036
1036
  </zeroOrMore>
1037
+ <optional>
1038
+ <ref name="docnumber"/>
1039
+ </optional>
1037
1040
  <zeroOrMore>
1038
1041
  <ref name="bdate"/>
1039
1042
  </zeroOrMore>
@@ -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>
@@ -140,6 +140,9 @@
140
140
  <zeroOrMore>
141
141
  <ref name="docidentifier"/>
142
142
  </zeroOrMore>
143
+ <optional>
144
+ <ref name="docnumber"/>
145
+ </optional>
143
146
  <zeroOrMore>
144
147
  <ref name="bdate"/>
145
148
  </zeroOrMore>
@@ -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="docnumber-separator">:</span>
23
- <span class="docyear">{{ docyear }} {{ draftinfo }}</span>
22
+ <span class="docyear">{{ draftinfo }}</span>
24
23
  </div>
25
24
 
26
25
  <div class="coverpage-title">
@@ -518,7 +518,7 @@ p.document-stage {
518
518
  }
519
519
 
520
520
  ul li:before {
521
- content: "";
521
+ content: "\2014";
522
522
  display: inline-block; width: 1em;
523
523
  margin-left: -1.2em;
524
524
  }
@@ -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 }}:{{ docyear }} {{ draftinfo }}</span></b><b
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"
@@ -25,18 +25,7 @@ module IsoDoc
25
25
 
26
26
  def docid(isoxml, _out)
27
27
  docnumber = isoxml.at(ns("//bibdata/docidentifier"))
28
- docstatus = isoxml.at(ns("//bibdata/status"))
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
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Rsd
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
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.7
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-10-27 00:00:00.000000000 Z
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