asciidoctor-m3d 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 842e662db881efd542ce7d9212b641a29f7d0e09
4
- data.tar.gz: 726174ec00747868c445e860e4ee14823496d3d9
2
+ SHA256:
3
+ metadata.gz: 2f796b6eb0ec3b88d6cc2932585c61db7b591fb7ddd352e66e955b8bf25468d2
4
+ data.tar.gz: a953610472abcf575045b14b3f8054d30b35697791bdf6d4e2cb05357edf3b52
5
5
  SHA512:
6
- metadata.gz: 47d301acc7da5911dcc256392ebbb85c5fd84f305127f5a5bdca58aac7b489f03110ab90391495a80572778cfb67f36d083a3d79f05a7e913e0f07be996be1a8
7
- data.tar.gz: ac46f2e039e772a2056c71e76573cfa82d795617365ab5e5b850eef524f3238baa4987af58fa60f49eb3ceeb43d439428b15f31b5ff002a7c30d9cf5174fb740
6
+ metadata.gz: bf31275e3c03d11b5c967563dbed2ecd68296276a88654a2fe3a8a1c4ad136d6d3754c6b17ec01a6ca2dcede0f6baacee6a8005c6a36cca3e7b41adf57f3d898
7
+ data.tar.gz: 1d6e010ac13c03ebd7fe0ba7a37ee432370e8f303167d61cc1bf409a33dde726004427d10945ad29e5c48af75f7d07d34fb75787d094f8edf4b6d4f5a68ebf77
@@ -0,0 +1,7 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.3
5
+ before_install:
6
+ - gem install bundler -v 1.16.1
7
+ - unset _JAVA_OPTIONS
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: acb439aa79a102bff01f876b6f19bdf468a47861
3
+ revision: 8e9f119ed5c38e7d75d975b1a945ebb069f94a27
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: 71a0d3a0f6ed4c001968949187103247de97a879
27
+ revision: cd4f1ecfcf31b0462f783159c8978007c929ceb8
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-m3d (0.2.5)
46
+ asciidoctor-m3d (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.3.0)
72
+ docile (1.3.1)
60
73
  equivalent-xml (0.6.0)
61
74
  nokogiri (>= 1.4.3)
62
- ffi (1.9.23)
75
+ ffi (1.9.25)
63
76
  formatador (0.2.5)
64
77
  guard (2.14.2)
65
78
  formatador (>= 0.2.4)
@@ -75,17 +88,17 @@ 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)
@@ -108,7 +121,7 @@ GEM
108
121
  parallel (1.12.1)
109
122
  parser (2.5.1.0)
110
123
  ast (~> 2.4.0)
111
- powerpack (0.1.1)
124
+ powerpack (0.1.2)
112
125
  pry (0.11.3)
113
126
  coderay (~> 1.1.0)
114
127
  method_source (~> 0.9.0)
@@ -131,7 +144,8 @@ 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.56.0)
147
+ rubocop (0.57.2)
148
+ jaro_winkler (~> 1.5.1)
135
149
  parallel (~> 1.10)
136
150
  parser (>= 2.5)
137
151
  powerpack (~> 0.1)
@@ -157,20 +171,21 @@ GEM
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.2)
174
+ unicode-display_width (1.4.0)
161
175
  uuidtools (2.1.5)
162
176
 
163
177
  PLATFORMS
164
178
  ruby
165
179
 
166
180
  DEPENDENCIES
167
- asciidoctor-m3d!
168
181
  asciidoctor-iso!
182
+ asciidoctor-m3d!
169
183
  bundler (~> 1.15)
170
184
  byebug (~> 9.1)
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/m3d/converter"
3
- require_relative "asciidoctor/m3d/m3dconvert"
3
+ require_relative "isodoc/m3d/m3dhtmlconvert"
4
+ require_relative "isodoc/m3d/m3dwordconvert"
4
5
  require_relative "asciidoctor/m3d/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/m3d/version"
3
- require "asciidoctor/m3d/m3dconvert"
3
+ require "isodoc/m3d/m3dhtmlconvert"
4
+ require "isodoc/m3d/m3dwordconvert"
4
5
  require "asciidoctor/iso/converter"
5
6
 
6
7
  module Asciidoctor
@@ -33,7 +34,7 @@ module Asciidoctor
33
34
 
34
35
  def metadata_committee(node, xml)
35
36
  xml.editorialgroup do |a|
36
- a.technical_committee node.attr("technical-committee"),
37
+ a.committee node.attr("technical-committee"),
37
38
  **attr_code(type: node.attr("technical-committee-type"))
38
39
  end
39
40
  end
@@ -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}.include? d
90
+ warn "#{d} is not a legal document type: reverting to 'report'"
91
+ d = "report"
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
- M3dConvert.new(
130
- htmlstylesheet: generate_css(html_doc_path("htmlstyle.scss"), true),
131
- standardstylesheet: generate_css(html_doc_path("m3d.scss"), true),
132
- htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
133
- htmlintropage: html_doc_path("html_m3d_intro.html"),
134
- scripts: html_doc_path("scripts.html"),
141
+ def html_converter(node)
142
+ IsoDoc::M3d::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::M3d::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">