asciidoctor-m3d 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +44 -29
- data/asciidoctor-m3d.gemspec +3 -2
- data/lib/asciidoctor-m3d.rb +2 -1
- data/lib/asciidoctor/m3d/biblio.rng +35 -6
- data/lib/asciidoctor/m3d/converter.rb +39 -24
- data/lib/asciidoctor/m3d/isodoc.rng +1 -1
- data/lib/asciidoctor/m3d/isostandard.rng +64 -15
- data/lib/asciidoctor/m3d/m3d.rng +43 -23
- data/lib/asciidoctor/m3d/version.rb +1 -1
- data/lib/isodoc/m3d/html/dots-w@2x.png +0 -0
- data/lib/isodoc/m3d/html/dots@2x.png +0 -0
- data/lib/isodoc/m3d/html/header.html +219 -0
- data/lib/isodoc/m3d/html/html_m3d_intro.html +14 -0
- data/lib/isodoc/m3d/html/html_m3d_titlepage.html +95 -0
- data/lib/isodoc/m3d/html/htmlstyle.scss +940 -0
- data/lib/isodoc/m3d/html/m3d.scss +697 -0
- data/lib/isodoc/m3d/html/scripts.html +82 -0
- data/lib/isodoc/m3d/html/word_m3d_intro.html +10 -0
- data/lib/isodoc/m3d/html/word_m3d_titlepage.html +58 -0
- data/lib/isodoc/m3d/html/wordstyle.scss +1003 -0
- data/lib/isodoc/m3d/m3dhtmlconvert.rb +142 -0
- data/lib/isodoc/m3d/m3dhtmlrender.rb +68 -0
- data/lib/isodoc/m3d/m3dwordconvert.rb +88 -0
- data/lib/isodoc/m3d/m3wordrender.rb +68 -0
- data/lib/isodoc/m3d/metadata.rb +82 -0
- metadata +24 -8
- data/lib/asciidoctor/m3d/m3dconvert.rb +0 -135
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2f796b6eb0ec3b88d6cc2932585c61db7b591fb7ddd352e66e955b8bf25468d2
|
4
|
+
data.tar.gz: a953610472abcf575045b14b3f8054d30b35697791bdf6d4e2cb05357edf3b52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf31275e3c03d11b5c967563dbed2ecd68296276a88654a2fe3a8a1c4ad136d6d3754c6b17ec01a6ca2dcede0f6baacee6a8005c6a36cca3e7b41adf57f3d898
|
7
|
+
data.tar.gz: 1d6e010ac13c03ebd7fe0ba7a37ee432370e8f303167d61cc1bf409a33dde726004427d10945ad29e5c48af75f7d07d34fb75787d094f8edf4b6d4f5a68ebf77
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,25 +1,34 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/riboseinc/asciidoctor-iso
|
3
|
-
revision:
|
3
|
+
revision: 8e9f119ed5c38e7d75d975b1a945ebb069f94a27
|
4
4
|
specs:
|
5
|
-
asciidoctor-iso (0.
|
6
|
-
asciidoctor (~> 1.5.
|
7
|
-
|
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
|
-
|
18
|
+
image_size
|
19
|
+
mime-types
|
10
20
|
nokogiri
|
11
|
-
ruby-
|
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:
|
27
|
+
revision: cd4f1ecfcf31b0462f783159c8978007c929ceb8
|
19
28
|
specs:
|
20
|
-
isodoc (0.
|
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.
|
46
|
+
asciidoctor-m3d (0.2.6)
|
37
47
|
asciidoctor (~> 1.5.7)
|
38
|
-
asciidoctor-iso (>= 0.
|
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.
|
72
|
+
docile (1.3.1)
|
60
73
|
equivalent-xml (0.6.0)
|
61
74
|
nokogiri (>= 1.4.3)
|
62
|
-
ffi (1.9.
|
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.
|
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.
|
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.
|
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.
|
197
|
+
1.16.2
|
data/asciidoctor-m3d.gemspec
CHANGED
@@ -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
|
-
|
39
|
-
spec.add_dependency "
|
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"
|
data/lib/asciidoctor-m3d.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "asciidoctor" unless defined? Asciidoctor::Converter
|
2
2
|
require_relative "asciidoctor/m3d/converter"
|
3
|
-
require_relative "
|
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
|
-
<
|
445
|
+
<zeroOrMore>
|
446
446
|
<ref name="copyright"/>
|
447
|
-
</
|
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
|
-
|
493
|
-
<
|
494
|
-
<
|
495
|
-
|
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 "
|
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.
|
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
|
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
|
-
|
91
|
-
gsub(
|
92
|
-
|
93
|
-
|
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(
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
@@ -72,9 +72,9 @@
|
|
72
72
|
</oneOrMore>
|
73
73
|
<ref name="formattedref"/>
|
74
74
|
</choice>
|
75
|
-
<
|
75
|
+
<zeroOrMore>
|
76
76
|
<ref name="bsource"/>
|
77
|
-
</
|
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
|
-
<
|
99
|
+
<zeroOrMore>
|
100
100
|
<ref name="abstract"/>
|
101
|
-
</
|
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
|
-
<
|
133
|
+
<zeroOrMore>
|
131
134
|
<ref name="bsource"/>
|
132
|
-
</
|
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
|
-
<
|
157
|
+
<zeroOrMore>
|
155
158
|
<ref name="abstract"/>
|
156
|
-
</
|
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="
|
170
|
-
<element name="
|
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
|
-
<
|
173
|
-
|
174
|
-
|
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="
|
914
|
+
<ref name="CitationType"/>
|
871
915
|
</element>
|
872
916
|
</define>
|
873
917
|
<define name="ics">
|
874
918
|
<element name="ics">
|
875
|
-
<
|
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">
|