asciidoctor-rsd 0.2.5 → 0.2.6

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
- SHA1:
3
- metadata.gz: d9114d458a4618ee4a37a30188f66e58317e5d82
4
- data.tar.gz: 58c1554bca805adeedac7803d434c849d8ec46cf
2
+ SHA256:
3
+ metadata.gz: 125e4e4e5bd3ba63730512aed41030e1e94494d057555508f8881f0f93449574
4
+ data.tar.gz: fb16064348b81d89aea374e9081ca3b2d1167ccabc7fdd1d8e24f40541136553
5
5
  SHA512:
6
- metadata.gz: f89e93f29f1e6a4b2a5c73867191a4853a67b670371801294a4f465dc73352004e95a9363150ecdfbe7f18d7e374222435ed67fb30d51505508946aa6c1ae417
7
- data.tar.gz: 84b03de0c69348bf619459edbf592695d9241f40bf559b37c7946d3d0a2fb27b4ce0b749485e37fdc29f9568868f53a8e0476e23c90f80eecd10bc3ebef0175b
6
+ metadata.gz: dc1fa1e54d189d87c6420c018cf932f667bcd519278b03c29a91118d3e0c915d558000881f7c32eabcdab9bfecf841770e2f2a77997afba67b07cbfb6eb68681
7
+ data.tar.gz: 0a7e8c0277b0309970f8121931606837aca23d934ecf5745609006f054c1cd9f1062c3276003bd5741b064e0ce290f21402ba97c643650358cdcaab4f1142b78
data/Gemfile CHANGED
@@ -3,5 +3,6 @@ git_source(:github) {|repo| "https://github.com/#{repo}" }
3
3
 
4
4
  gem "isodoc", github: "riboseinc/isodoc"
5
5
  gem "asciidoctor-iso", github: "riboseinc/asciidoctor-iso"
6
+ gem "html2doc", github: "riboseinc/html2doc"
6
7
 
7
8
  gemspec
@@ -1,25 +1,34 @@
1
1
  GIT
2
2
  remote: https://github.com/riboseinc/asciidoctor-iso
3
- revision: f5e46b7dda5fb043b5872e166806f672fe70b909
3
+ revision: 975b5652397e67bbb5e48746882760c0745f163e
4
4
  specs:
5
- asciidoctor-iso (0.7.5)
6
- asciidoctor (~> 1.5.6)
7
- html2doc
5
+ asciidoctor-iso (0.8.1)
6
+ asciidoctor (~> 1.5.7)
7
+ isobib (~> 0.1.4)
8
+ isodoc (>= 0.7.0)
9
+ ruby-jing
10
+
11
+ GIT
12
+ remote: https://github.com/riboseinc/html2doc
13
+ revision: ae15cfc0a4c8ebeb74193a8aa4a7884938a08434
14
+ specs:
15
+ html2doc (0.8.0)
16
+ asciimath
8
17
  htmlentities (~> 4.3.4)
9
- isodoc
18
+ image_size
19
+ mime-types
10
20
  nokogiri
11
- ruby-jing
12
- sass
21
+ ruby-xslt
13
22
  thread_safe
14
23
  uuidtools
15
24
 
16
25
  GIT
17
26
  remote: https://github.com/riboseinc/isodoc
18
- revision: 871fc62c0249e81f2dba3ebb64e0109e6f7b25c8
27
+ revision: 8cdd3243c0479eb35e6a28d044759477f6fb2f44
19
28
  specs:
20
- isodoc (0.5.9)
29
+ isodoc (0.7.0)
21
30
  asciimath
22
- html2doc
31
+ html2doc (>= 0.7.1)
23
32
  htmlentities (~> 4.3.4)
24
33
  image_size
25
34
  liquid
@@ -27,19 +36,20 @@ GIT
27
36
  nokogiri
28
37
  roman-numerals
29
38
  ruby-xslt
39
+ sass
30
40
  thread_safe
31
41
  uuidtools
32
42
 
33
43
  PATH
34
44
  remote: .
35
45
  specs:
36
- asciidoctor-rsd (0.2.4)
46
+ asciidoctor-rsd (0.2.6)
37
47
  asciidoctor (~> 1.5.7)
38
- asciidoctor-iso (>= 0.7.5)
48
+ asciidoctor-iso (>= 0.8.0)
39
49
  asciimath
40
50
  htmlentities (~> 4.3.4)
41
51
  image_size
42
- isodoc
52
+ isodoc (>= 0.7.0)
43
53
  mime-types
44
54
  nokogiri
45
55
  ruby-jing
@@ -50,16 +60,19 @@ PATH
50
60
  GEM
51
61
  remote: https://rubygems.org/
52
62
  specs:
63
+ algoliasearch (1.22.0)
64
+ httpclient (~> 2.8, >= 2.8.3)
65
+ json (>= 1.5.1)
53
66
  asciidoctor (1.5.7.1)
54
67
  asciimath (1.0.4)
55
68
  ast (2.4.0)
56
69
  byebug (9.1.0)
57
70
  coderay (1.1.2)
58
71
  diff-lcs (1.3)
59
- docile (1.1.5)
72
+ docile (1.3.1)
60
73
  equivalent-xml (0.6.0)
61
74
  nokogiri (>= 1.4.3)
62
- ffi (1.9.18)
75
+ ffi (1.9.25)
63
76
  formatador (0.2.5)
64
77
  guard (2.14.2)
65
78
  formatador (>= 0.2.4)
@@ -75,24 +88,24 @@ GEM
75
88
  guard (~> 2.1)
76
89
  guard-compat (~> 1.1)
77
90
  rspec (>= 2.99.0, < 4.0)
78
- html2doc (0.7.0)
79
- asciimath
80
- htmlentities (~> 4.3.4)
81
- image_size
82
- mime-types
83
- nokogiri
84
- ruby-xslt
85
- thread_safe
86
- uuidtools
87
91
  htmlentities (4.3.4)
92
+ httpclient (2.8.3)
88
93
  image_size (2.0.0)
94
+ iso-bib-item (0.1.5)
95
+ isoics (~> 0.1.6)
96
+ nokogiri
97
+ isobib (0.1.5)
98
+ algoliasearch
99
+ iso-bib-item (~> 0.1.2)
100
+ isoics (0.1.6)
101
+ jaro_winkler (1.5.1)
89
102
  json (2.1.0)
90
103
  liquid (4.0.0)
91
104
  listen (3.1.5)
92
105
  rb-fsevent (~> 0.9, >= 0.9.4)
93
106
  rb-inotify (~> 0.9, >= 0.9.7)
94
107
  ruby_dep (~> 1.2)
95
- lumberjack (1.0.12)
108
+ lumberjack (1.0.13)
96
109
  method_source (0.9.0)
97
110
  mime-types (3.1)
98
111
  mime-types-data (~> 3.2015)
@@ -106,15 +119,15 @@ GEM
106
119
  shellany (~> 0.0)
107
120
  optout (0.0.2)
108
121
  parallel (1.12.1)
109
- parser (2.4.0.2)
110
- ast (~> 2.3)
111
- powerpack (0.1.1)
122
+ parser (2.5.1.0)
123
+ ast (~> 2.4.0)
124
+ powerpack (0.1.2)
112
125
  pry (0.11.3)
113
126
  coderay (~> 1.1.0)
114
127
  method_source (~> 0.9.0)
115
128
  rainbow (3.0.0)
116
- rake (12.3.0)
117
- rb-fsevent (0.10.2)
129
+ rake (12.3.1)
130
+ rb-fsevent (0.10.3)
118
131
  rb-inotify (0.9.10)
119
132
  ffi (>= 0.5.0, < 2)
120
133
  roman-numerals (0.3.0)
@@ -131,9 +144,10 @@ GEM
131
144
  diff-lcs (>= 1.2.0, < 2.0)
132
145
  rspec-support (~> 3.7.0)
133
146
  rspec-support (3.7.1)
134
- rubocop (0.52.1)
147
+ rubocop (0.57.2)
148
+ jaro_winkler (~> 1.5.1)
135
149
  parallel (~> 1.10)
136
- parser (>= 2.4.0.2, < 3.0)
150
+ parser (>= 2.5)
137
151
  powerpack (~> 0.1)
138
152
  rainbow (>= 2.2.2, < 4.0)
139
153
  ruby-progressbar (~> 1.7)
@@ -149,15 +163,15 @@ GEM
149
163
  rb-fsevent (~> 0.9, >= 0.9.4)
150
164
  rb-inotify (~> 0.9, >= 0.9.7)
151
165
  shellany (0.0.1)
152
- simplecov (0.15.1)
153
- docile (~> 1.1.0)
166
+ simplecov (0.16.1)
167
+ docile (~> 1.1)
154
168
  json (>= 1.8, < 3)
155
169
  simplecov-html (~> 0.10.0)
156
170
  simplecov-html (0.10.2)
157
171
  thor (0.20.0)
158
172
  thread_safe (0.3.6)
159
173
  timecop (0.9.1)
160
- unicode-display_width (1.3.0)
174
+ unicode-display_width (1.4.0)
161
175
  uuidtools (2.1.5)
162
176
 
163
177
  PLATFORMS
@@ -171,6 +185,7 @@ DEPENDENCIES
171
185
  equivalent-xml (~> 0.6)
172
186
  guard (~> 2.14)
173
187
  guard-rspec (~> 4.7)
188
+ html2doc!
174
189
  isodoc!
175
190
  rake (~> 12.0)
176
191
  rspec (~> 3.6)
@@ -179,4 +194,4 @@ DEPENDENCIES
179
194
  timecop (~> 0.9)
180
195
 
181
196
  BUNDLED WITH
182
- 1.16.1
197
+ 1.16.2
@@ -35,8 +35,9 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "ruby-xslt"
36
36
  spec.add_dependency "thread_safe"
37
37
  spec.add_dependency "uuidtools"
38
- spec.add_dependency "asciidoctor-iso", ">= 0.7.5"
39
- spec.add_dependency "isodoc"
38
+
39
+ spec.add_dependency "asciidoctor-iso", ">= 0.8.0"
40
+ spec.add_dependency "isodoc", ">= 0.7.0"
40
41
 
41
42
  spec.add_development_dependency "bundler", "~> 1.15"
42
43
  spec.add_development_dependency "byebug", "~> 9.1"
@@ -1,4 +1,5 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/rsd/converter"
3
- require_relative "asciidoctor/rsd/rsdconvert"
3
+ require_relative "isodoc/rsd/rsdhtmlconvert"
4
+ require_relative "isodoc/rsd/rsdwordconvert"
4
5
  require_relative "asciidoctor/rsd/version"
@@ -442,9 +442,9 @@
442
442
  <optional>
443
443
  <ref name="status"/>
444
444
  </optional>
445
- <optional>
445
+ <zeroOrMore>
446
446
  <ref name="copyright"/>
447
- </optional>
447
+ </zeroOrMore>
448
448
  <zeroOrMore>
449
449
  <ref name="docrelation"/>
450
450
  </zeroOrMore>
@@ -489,10 +489,31 @@
489
489
  <value>issued</value>
490
490
  </choice>
491
491
  </attribute>
492
- <ref name="bfrom"/>
493
- <optional>
494
- <ref name="bto"/>
495
- </optional>
492
+ <!-- ( ( bfrom, bto? ) | date_on ) -->
493
+ <choice>
494
+ <group>
495
+ <element name="from">
496
+ <choice>
497
+ <data type="gYear"/>
498
+ <data type="date"/>
499
+ </choice>
500
+ </element>
501
+ <optional>
502
+ <element name="to">
503
+ <choice>
504
+ <data type="gYear"/>
505
+ <data type="date"/>
506
+ </choice>
507
+ </element>
508
+ </optional>
509
+ </group>
510
+ <element name="on">
511
+ <choice>
512
+ <data type="gYear"/>
513
+ <data type="date"/>
514
+ </choice>
515
+ </element>
516
+ </choice>
496
517
  </element>
497
518
  </define>
498
519
  <define name="bfrom">
@@ -511,6 +532,14 @@
511
532
  </choice>
512
533
  </element>
513
534
  </define>
535
+ <define name="date_on">
536
+ <element name="on">
537
+ <choice>
538
+ <data type="gYear"/>
539
+ <data type="date"/>
540
+ </choice>
541
+ </element>
542
+ </define>
514
543
  <define name="docidentifier">
515
544
  <element name="docidentifier">
516
545
  <optional>
@@ -1,6 +1,7 @@
1
1
  require "asciidoctor"
2
2
  require "asciidoctor/rsd/version"
3
- require "asciidoctor/rsd/rsdconvert"
3
+ require "isodoc/rsd/rsdhtmlconvert"
4
+ require "isodoc/rsd/rsdwordconvert"
4
5
  require "asciidoctor/iso/converter"
5
6
 
6
7
  module Asciidoctor
@@ -47,7 +48,7 @@ module Asciidoctor
47
48
  end
48
49
 
49
50
  def metadata_status(node, xml)
50
- xml.status **{ format: "plain" } { |s| s << node.attr("status") }
51
+ xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
51
52
  end
52
53
 
53
54
  def metadata_id(node, xml)
@@ -83,14 +84,26 @@ module Asciidoctor
83
84
  ret1
84
85
  end
85
86
 
87
+ def doctype(node)
88
+ d = node.attr("doctype")
89
+ unless %w{policy best-practices supporting-document report legal directives}.include? d
90
+ warn "#{d} is not a legal document type: reverting to 'standard'"
91
+ d = "standard"
92
+ end
93
+ d
94
+ end
95
+
86
96
  def document(node)
87
97
  init(node)
88
98
  ret1 = makexml(node)
89
99
  ret = ret1.to_xml(indent: 2)
90
- filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
91
- gsub(%r{^.*/}, "")
92
- File.open(filename, "w") { |f| f.write(ret) }
93
- html_converter(node).convert filename unless node.attr("nodoc")
100
+ unless node.attr("nodoc") || !node.attr("docfile")
101
+ filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
102
+ gsub(%r{^.*/}, "")
103
+ File.open(filename, "w") { |f| f.write(ret) }
104
+ html_converter(node).convert filename unless node.attr("nodoc")
105
+ word_converter(node).convert filename unless node.attr("nodoc")
106
+ end
94
107
  @files_to_delete.each { |f| system "rm #{f}" }
95
108
  ret
96
109
  end
@@ -125,25 +138,28 @@ module Asciidoctor
125
138
  return
126
139
  end
127
140
 
128
- def html_converter(_node)
129
- RsdConvert.new(
130
- htmlstylesheet: generate_css(html_doc_path("htmlstyle.scss"), true),
131
- standardstylesheet: generate_css(html_doc_path("rsd.scss"), true),
132
- htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
133
- htmlintropage: html_doc_path("html_rsd_intro.html"),
134
- scripts: html_doc_path("scripts.html"),
141
+ def html_converter(node)
142
+ IsoDoc::Rsd::Convert.new(
143
+ script: node.attr("script"),
144
+ bodyfont: node.attr("body-font"),
145
+ headerfont: node.attr("header-font"),
146
+ monospacefont: node.attr("monospace-font"),
147
+ titlefont: node.attr("title-font"),
148
+ i18nyaml: node.attr("i18nyaml"),
149
+ scope: node.attr("scope"),
135
150
  )
136
151
  end
137
152
 
138
- def default_fonts(node)
139
- b = node.attr("body-font") ||
140
- (node.attr("script") == "Hans" ? '"SimSun",serif' :
141
- '"Overpass",sans-serif')
142
- h = node.attr("header-font") ||
143
- (node.attr("script") == "Hans" ? '"SimHei",sans-serif' :
144
- '"Overpass",sans-serif')
145
- m = node.attr("monospace-font") || '"Space Mono",monospace'
146
- "$bodyfont: #{b};\n$headerfont: #{h};\n$monospacefont: #{m};\n"
153
+ def word_converter(node)
154
+ IsoDoc::Rsd::WordConvert.new(
155
+ script: node.attr("script"),
156
+ bodyfont: node.attr("body-font"),
157
+ headerfont: node.attr("header-font"),
158
+ monospacefont: node.attr("monospace-font"),
159
+ titlefont: node.attr("title-font"),
160
+ i18nyaml: node.attr("i18nyaml"),
161
+ scope: node.attr("scope"),
162
+ )
147
163
  end
148
164
 
149
165
  def inline_quoted(node)
@@ -168,7 +184,6 @@ module Asciidoctor
168
184
  end
169
185
  end.join
170
186
  end
171
-
172
187
  end
173
188
  end
174
189
  end
@@ -729,7 +729,7 @@
729
729
  </define>
730
730
  <define name="source">
731
731
  <element name="source">
732
- <data type="anyURI"/>
732
+ <ref name="TypedUri"/>
733
733
  </element>
734
734
  </define>
735
735
  <define name="em">
@@ -72,9 +72,9 @@
72
72
  </oneOrMore>
73
73
  <ref name="formattedref"/>
74
74
  </choice>
75
- <optional>
75
+ <zeroOrMore>
76
76
  <ref name="bsource"/>
77
- </optional>
77
+ </zeroOrMore>
78
78
  <zeroOrMore>
79
79
  <ref name="docidentifier"/>
80
80
  </zeroOrMore>
@@ -96,9 +96,9 @@
96
96
  <zeroOrMore>
97
97
  <ref name="script"/>
98
98
  </zeroOrMore>
99
- <optional>
99
+ <zeroOrMore>
100
100
  <ref name="abstract"/>
101
- </optional>
101
+ </zeroOrMore>
102
102
  <optional>
103
103
  <ref name="status"/>
104
104
  </optional>
@@ -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>
@@ -127,9 +130,9 @@
127
130
  <optional>
128
131
  <ref name="formattedref"/>
129
132
  </optional>
130
- <optional>
133
+ <zeroOrMore>
131
134
  <ref name="bsource"/>
132
- </optional>
135
+ </zeroOrMore>
133
136
  <zeroOrMore>
134
137
  <ref name="docidentifier"/>
135
138
  </zeroOrMore>
@@ -151,9 +154,9 @@
151
154
  <zeroOrMore>
152
155
  <ref name="script"/>
153
156
  </zeroOrMore>
154
- <optional>
157
+ <zeroOrMore>
155
158
  <ref name="abstract"/>
156
- </optional>
159
+ </zeroOrMore>
157
160
  <optional>
158
161
  <ref name="status"/>
159
162
  </optional>
@@ -165,13 +168,49 @@
165
168
  <zeroOrMore>
166
169
  <ref name="ics"/>
167
170
  </zeroOrMore>
171
+ <optional>
172
+ <ref name="allParts"/>
173
+ </optional>
168
174
  </define>
169
- <define name="bfrom">
170
- <element name="from">
175
+ <define name="bdate">
176
+ <element name="date">
177
+ <attribute name="type">
178
+ <choice>
179
+ <value>published</value>
180
+ <value>accessed</value>
181
+ <value>created</value>
182
+ <value>implemented</value>
183
+ <value>obsoleted</value>
184
+ <value>confirmed</value>
185
+ <value>updated</value>
186
+ <value>issued</value>
187
+ </choice>
188
+ </attribute>
189
+ <!-- ( ( bfrom, bto? ) | date_on ) -->
171
190
  <choice>
172
- <data type="gYear"/>
173
- <data type="date"/>
174
- <value>--</value>
191
+ <group>
192
+ <element name="from">
193
+ <choice>
194
+ <data type="gYear"/>
195
+ <data type="date"/>
196
+ </choice>
197
+ </element>
198
+ <optional>
199
+ <element name="to">
200
+ <choice>
201
+ <data type="gYear"/>
202
+ <data type="date"/>
203
+ </choice>
204
+ </element>
205
+ </optional>
206
+ </group>
207
+ <element name="on">
208
+ <choice>
209
+ <data type="gYear"/>
210
+ <data type="date"/>
211
+ <value>--</value>
212
+ </choice>
213
+ </element>
175
214
  </choice>
176
215
  </element>
177
216
  </define>
@@ -819,6 +858,11 @@
819
858
  <ref name="FormattedString"/>
820
859
  </element>
821
860
  </define>
861
+ <define name="allParts">
862
+ <element name="allParts">
863
+ <data type="boolean"/>
864
+ </element>
865
+ </define>
822
866
  <define name="clause-hanging-paragraph-with-footnote">
823
867
  <element name="clause">
824
868
  <optional>
@@ -867,12 +911,17 @@
867
911
  </define>
868
912
  <define name="termdocsource">
869
913
  <element name="termdocsource">
870
- <ref name="erefType"/>
914
+ <ref name="CitationType"/>
871
915
  </element>
872
916
  </define>
873
917
  <define name="ics">
874
918
  <element name="ics">
875
- <text/>
919
+ <element name="code">
920
+ <text/>
921
+ </element>
922
+ <element name="text">
923
+ <text/>
924
+ </element>
876
925
  </element>
877
926
  </define>
878
927
  <define name="term-clause">