asciidoctor-csd 0.3.1 → 0.3.2

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: b06c2d35d54cc92d44d34fa6296309026c2c2382cd06da0a0a873ada81b990ca
4
- data.tar.gz: a65cfd2752777e4ae4fd017ff4133cb8448372f3450132a9d37241ec0373fd67
3
+ metadata.gz: 4f757bd08755b310566b64e9cc50010499b1941864540e50e12fa6dea344144f
4
+ data.tar.gz: 4eb350a9af73db640aed094df5e4960de0f83ef3cba1ee0f803141385932afa5
5
5
  SHA512:
6
- metadata.gz: 13a7a0feb7ea66a63482da6b3a9535425a87289060a9abc0b7d9ba6f9267892490164fd4aa7ababc7b50567293d5ddfb9fd90ae2b5259265618e6e88d52af331
7
- data.tar.gz: 6b87c74a7a50fd2e932cf4090493ac79c1436b505b1bb6526f7768039899e84ba41e3d4bfcc9f3c1f43703dbdce3f5959fda269b64a1c9c25a9ea48cd05979c5
6
+ metadata.gz: 23813c54c0cb4bd2c0035e75cb7d2481a02084ad814eb68977d6cb58f5032c984b44c1f8a393747b5632ef2b0d200f9fa17b816c874dcb0133ff79a0ae19e7d3
7
+ data.tar.gz: 325a8920f50768a6fc7eac4b265884791497d249dc9a952d1365b4ebace438299b4e88b10affc6babafe0571d5ee2509b1ab051f97ec2a86cbc768e781ea69ae
data/Gemfile.lock CHANGED
@@ -25,7 +25,7 @@ GEM
25
25
  docile (1.3.1)
26
26
  equivalent-xml (0.6.0)
27
27
  nokogiri (>= 1.4.3)
28
- ffi (1.9.24)
28
+ ffi (1.9.25)
29
29
  formatador (0.2.5)
30
30
  guard (2.14.2)
31
31
  formatador (>= 0.2.4)
@@ -53,15 +53,15 @@ GEM
53
53
  htmlentities (4.3.4)
54
54
  httpclient (2.8.3)
55
55
  image_size (2.0.0)
56
- iso-bib-item (0.1.3)
56
+ iso-bib-item (0.1.5)
57
57
  isoics (~> 0.1.6)
58
58
  nokogiri
59
- isobib (0.1.4)
59
+ isobib (0.1.5)
60
60
  algoliasearch
61
61
  iso-bib-item (~> 0.1.2)
62
62
  isodoc (0.7.0)
63
63
  asciimath
64
- html2doc
64
+ html2doc (>= 0.7.1)
65
65
  htmlentities (~> 4.3.4)
66
66
  image_size
67
67
  liquid
@@ -73,6 +73,7 @@ GEM
73
73
  thread_safe
74
74
  uuidtools
75
75
  isoics (0.1.6)
76
+ jaro_winkler (1.5.1)
76
77
  json (2.1.0)
77
78
  liquid (4.0.0)
78
79
  listen (3.1.5)
@@ -95,7 +96,7 @@ GEM
95
96
  parallel (1.12.1)
96
97
  parser (2.5.1.0)
97
98
  ast (~> 2.4.0)
98
- powerpack (0.1.1)
99
+ powerpack (0.1.2)
99
100
  pry (0.11.3)
100
101
  coderay (~> 1.1.0)
101
102
  method_source (~> 0.9.0)
@@ -118,7 +119,8 @@ GEM
118
119
  diff-lcs (>= 1.2.0, < 2.0)
119
120
  rspec-support (~> 3.7.0)
120
121
  rspec-support (3.7.1)
121
- rubocop (0.56.0)
122
+ rubocop (0.57.2)
123
+ jaro_winkler (~> 1.5.1)
122
124
  parallel (~> 1.10)
123
125
  parser (>= 2.5)
124
126
  powerpack (~> 0.1)
@@ -144,7 +146,7 @@ GEM
144
146
  thor (0.20.0)
145
147
  thread_safe (0.3.6)
146
148
  timecop (0.9.1)
147
- unicode-display_width (1.3.3)
149
+ unicode-display_width (1.4.0)
148
150
  uuidtools (2.1.5)
149
151
 
150
152
  PLATFORMS
@@ -47,7 +47,7 @@ module Asciidoctor
47
47
  end
48
48
 
49
49
  def metadata_status(node, xml)
50
- xml.status **{ format: "plain" } { |s| s << node.attr("status") }
50
+ xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
51
51
  end
52
52
 
53
53
  def metadata_id(node, xml)
@@ -95,9 +95,9 @@ module Asciidoctor
95
95
  end
96
96
 
97
97
  # deactivating biblio caching for now
98
- def open_cache_biblio(node, global)
99
- nil
100
- end
98
+ #def open_cache_biblio(node, global)
99
+ #nil
100
+ #end
101
101
 
102
102
  def pdf_convert(filename)
103
103
  url = "#{Dir.pwd}/#{filename}.html"
@@ -127,10 +127,6 @@ module Asciidoctor
127
127
  File.join(File.dirname(__FILE__), "csd.rng"))
128
128
  end
129
129
 
130
- def html_doc_path(file)
131
- File.join(File.dirname(__FILE__), File.join("html", file))
132
- end
133
-
134
130
  def literal(node)
135
131
  noko do |xml|
136
132
  xml.figure **id_attr(node) do |f|
@@ -114,6 +114,9 @@
114
114
  <zeroOrMore>
115
115
  <ref name="ics"/>
116
116
  </zeroOrMore>
117
+ <optional>
118
+ <ref name="allParts"/>
119
+ </optional>
117
120
  </define>
118
121
  <define name="BibData">
119
122
  <optional>
@@ -165,6 +168,9 @@
165
168
  <zeroOrMore>
166
169
  <ref name="ics"/>
167
170
  </zeroOrMore>
171
+ <optional>
172
+ <ref name="allParts"/>
173
+ </optional>
168
174
  </define>
169
175
  <define name="bdate">
170
176
  <element name="date">
@@ -852,6 +858,11 @@
852
858
  <ref name="FormattedString"/>
853
859
  </element>
854
860
  </define>
861
+ <define name="allParts">
862
+ <element name="allParts">
863
+ <data type="boolean"/>
864
+ </element>
865
+ </define>
855
866
  <define name="clause-hanging-paragraph-with-footnote">
856
867
  <element name="clause">
857
868
  <optional>
@@ -905,7 +916,12 @@
905
916
  </define>
906
917
  <define name="ics">
907
918
  <element name="ics">
908
- <text/>
919
+ <element name="code">
920
+ <text/>
921
+ </element>
922
+ <element name="text">
923
+ <text/>
924
+ </element>
909
925
  </element>
910
926
  </define>
911
927
  <define name="term-clause">
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Csd
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require "isodoc"
2
+ require_relative "metadata"
2
3
 
3
4
  module IsoDoc
4
5
  module Csd
@@ -16,7 +17,6 @@ module IsoDoc
16
17
  @htmlcoverpage = html_doc_path("html_csd_titlepage.html")
17
18
  @htmlintropage = html_doc_path("html_csd_intro.html")
18
19
  @scripts = html_doc_path("scripts.html")
19
- set_metadata(:status, "XXX")
20
20
  end
21
21
 
22
22
  def default_fonts(options)
@@ -30,49 +30,8 @@ module IsoDoc
30
30
  "$bodyfont: #{b};\n$headerfont: #{h};\n$monospacefont: #{m};\n"
31
31
  end
32
32
 
33
- def init_metadata
34
- super
35
- end
36
-
37
- def title(isoxml, _out)
38
- main = isoxml&.at(ns("//title[@language='en']"))&.text
39
- set_metadata(:doctitle, main)
40
- end
41
-
42
- def subtitle(_isoxml, _out)
43
- nil
44
- end
45
-
46
- def author(isoxml, _out)
47
- set_metadata(:tc, "XXXX")
48
- tc = isoxml.at(ns("//editorialgroup/technical-committee"))
49
- set_metadata(:tc, tc.text) if tc
50
- end
51
-
52
- def docid(isoxml, _out)
53
- docnumber = isoxml.at(ns("//bibdata/docidentifier"))
54
- docstatus = isoxml.at(ns("//bibdata/status"))
55
- dn = docnumber&.text
56
- if docstatus
57
- set_metadata(:status, status_print(docstatus.text))
58
- abbr = status_abbr(docstatus.text)
59
- dn = "#{dn}(#{abbr})" unless abbr.empty?
60
- end
61
- set_metadata(:docnumber, dn)
62
- end
63
-
64
- def status_print(status)
65
- status.split(/-/).map{ |w| w.capitalize }.join(" ")
66
- end
67
-
68
- def status_abbr(status)
69
- case status
70
- when "working-draft" then "wd"
71
- when "committee-draft" then "cd"
72
- when "draft-standard" then "d"
73
- else
74
- ""
75
- end
33
+ def metadata_init(lang, script, labels)
34
+ @meta = Metadata.new(lang, script, labels)
76
35
  end
77
36
 
78
37
  def annex_name(annex, name, div)
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  </div>
40
40
 
41
- <div class="WordSection11">
41
+ <div class="title-section1">
42
42
  <div class="coverpage-stage-block" >
43
43
  <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">Calconnect {{ doctype }}</span>
44
44
  </div>
@@ -91,7 +91,7 @@ dd {
91
91
  grid-column-start: 2;
92
92
  }
93
93
 
94
- dd p {
94
+ dd p, dt p {
95
95
  margin-top: 0px;
96
96
  }
97
97
 
@@ -802,11 +802,11 @@ p {
802
802
  padding-right: 1em;
803
803
  }
804
804
 
805
- .WordSection11 {
805
+ .title-section1 {
806
806
  padding: 0 2em 0 3em;
807
807
  }
808
808
 
809
- .WordSection2 {
809
+ .prefatory-section {
810
810
  padding: 0 3em 0 6em;
811
811
  }
812
812
 
@@ -939,7 +939,7 @@ a.anchorjs-link:hover {
939
939
  }
940
940
 
941
941
  @media print {
942
- h1, .WordSection11 {page-break-before: always;}
942
+ h1, .title-section1 {page-break-before: always;}
943
943
  #toggle, .document-stage-band,
944
944
  .document-type-band,#myBtn {display: none;}
945
945
  .container {padding-left: 0;}
@@ -0,0 +1,56 @@
1
+ require "isodoc"
2
+
3
+ module IsoDoc
4
+ module Csd
5
+ # A {Converter} implementation that generates CSD output, and a document
6
+ # schema encapsulation of the document for validation
7
+ class Metadata < IsoDoc::Metadata
8
+ def initialize(lang, script, labels)
9
+ super
10
+ set(:status, "XXX")
11
+ end
12
+
13
+ def title(isoxml, _out)
14
+ main = isoxml&.at(ns("//title[@language='en']"))&.text
15
+ set(:doctitle, main)
16
+ end
17
+
18
+ def subtitle(_isoxml, _out)
19
+ nil
20
+ end
21
+
22
+ def author(isoxml, _out)
23
+ set(:tc, "XXXX")
24
+ tc = isoxml.at(ns("//editorialgroup/technical-committee"))
25
+ set(:tc, tc.text) if tc
26
+ end
27
+
28
+ def docid(isoxml, _out)
29
+ docnumber = isoxml.at(ns("//bibdata/docidentifier"))
30
+ docstatus = isoxml.at(ns("//bibdata/status"))
31
+ dn = docnumber&.text
32
+ if docstatus
33
+ set(:status, status_print(docstatus.text))
34
+ abbr = status_abbr(docstatus.text)
35
+ dn = "#{dn}(#{abbr})" unless abbr.empty?
36
+ end
37
+ set(:docnumber, dn)
38
+ end
39
+
40
+ def status_print(status)
41
+ status.split(/-/).map{ |w| w.capitalize }.join(" ")
42
+ end
43
+
44
+ def status_abbr(status)
45
+ case status
46
+ when "working-draft" then "wd"
47
+ when "committee-draft" then "cd"
48
+ when "draft-standard" then "d"
49
+ else
50
+ ""
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-csd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
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-06-03 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor-iso
@@ -217,6 +217,7 @@ files:
217
217
  - lib/isodoc/csd/html/html_csd_titlepage.html
218
218
  - lib/isodoc/csd/html/htmlstyle.scss
219
219
  - lib/isodoc/csd/html/scripts.html
220
+ - lib/isodoc/csd/metadata.rb
220
221
  homepage: https://github.com/riboseinc/asciidoctor-csd
221
222
  licenses:
222
223
  - MIT
@@ -237,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
238
  version: '0'
238
239
  requirements: []
239
240
  rubyforge_project:
240
- rubygems_version: 2.7.7
241
+ rubygems_version: 2.7.6
241
242
  signing_key:
242
243
  specification_version: 4
243
244
  summary: asciidoctor-csd lets you write CSD in AsciiDoc.