asciidoctor-m3d 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/asciidoctor-m3d.gemspec +2 -2
- data/lib/asciidoctor/m3d/converter.rb +11 -4
- data/lib/asciidoctor/m3d/isodoc.rng +43 -25
- data/lib/asciidoctor/m3d/isostandard.rng +8 -8
- data/lib/asciidoctor/m3d/version.rb +1 -1
- data/lib/isodoc/m3d/m3dhtmlconvert.rb +18 -17
- data/lib/isodoc/m3d/m3dwordconvert.rb +24 -19
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c187f43da3255bc153970ebfc350cd1f5805651db163825e3daec3acc6b88aa3
|
4
|
+
data.tar.gz: f9e507017ff918a9c21121f11a495da133d383694deec07990c46d234e730d40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77998d580f213145f8638904868087cad5ab5db539e6c3a73e3bda76ce20ec804f0443fd68b98fddc8e8a273ac7390f2b221c5adebac197e1b3ab20430f813c7
|
7
|
+
data.tar.gz: '068f628dbc31bc240ff49ab77ccffe75a8163bb3e55888d7b77225ff3d75f1ec06891df233dbb6024bdc889247c6fe97af7bc907f39c0ee83738a13f51c8512f'
|
data/Gemfile
CHANGED
data/asciidoctor-m3d.gemspec
CHANGED
@@ -36,8 +36,8 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_dependency "thread_safe"
|
37
37
|
spec.add_dependency "uuidtools"
|
38
38
|
|
39
|
-
spec.add_dependency "asciidoctor-iso", "
|
40
|
-
spec.add_dependency "isodoc", "
|
39
|
+
spec.add_dependency "asciidoctor-iso", "~> 0.10.2"
|
40
|
+
spec.add_dependency "isodoc", "~> 0.8.8"
|
41
41
|
|
42
42
|
spec.add_development_dependency "bundler", "~> 1.15"
|
43
43
|
spec.add_development_dependency "byebug", "~> 9.1"
|
@@ -133,10 +133,6 @@ module Asciidoctor
|
|
133
133
|
File.join(File.dirname(__FILE__), "m3d.rng"))
|
134
134
|
end
|
135
135
|
|
136
|
-
def html_doc_path(file)
|
137
|
-
File.join(File.dirname(__FILE__), File.join("html", file))
|
138
|
-
end
|
139
|
-
|
140
136
|
def literal(node)
|
141
137
|
noko do |xml|
|
142
138
|
xml.figure **id_attr(node) do |f|
|
@@ -166,6 +162,10 @@ module Asciidoctor
|
|
166
162
|
titlefont: node.attr("title-font"),
|
167
163
|
i18nyaml: node.attr("i18nyaml"),
|
168
164
|
scope: node.attr("scope"),
|
165
|
+
htmlstylesheet: node.attr("htmlstylesheet"),
|
166
|
+
htmlcoverpage: node.attr("htmlcoverpage"),
|
167
|
+
htmlintropage: node.attr("htmlintropage"),
|
168
|
+
scripts: node.attr("scripts"),
|
169
169
|
)
|
170
170
|
end
|
171
171
|
|
@@ -178,6 +178,13 @@ module Asciidoctor
|
|
178
178
|
titlefont: node.attr("title-font"),
|
179
179
|
i18nyaml: node.attr("i18nyaml"),
|
180
180
|
scope: node.attr("scope"),
|
181
|
+
wordstylesheet: node.attr("wordstylesheet"),
|
182
|
+
standardstylesheet: node.attr("standardstylesheet"),
|
183
|
+
header: node.attr("header"),
|
184
|
+
wordcoverpage: node.attr("wordcoverpage"),
|
185
|
+
wordintropage: node.attr("wordintropage"),
|
186
|
+
ulstyle: node.attr("ulstyle"),
|
187
|
+
olstyle: node.attr("olstyle"),
|
181
188
|
)
|
182
189
|
end
|
183
190
|
|
@@ -18,7 +18,21 @@
|
|
18
18
|
of this.
|
19
19
|
-->
|
20
20
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
|
-
<include href="biblio.rng"
|
21
|
+
<include href="biblio.rng">
|
22
|
+
<define name="status">
|
23
|
+
<element name="status">
|
24
|
+
<choice>
|
25
|
+
<value>proposal</value>
|
26
|
+
<value>working_draft</value>
|
27
|
+
<value>committee_draft</value>
|
28
|
+
<value>draft_standard</value>
|
29
|
+
<value>final_draft</value>
|
30
|
+
<value>published</value>
|
31
|
+
<value>withdrawn</value>
|
32
|
+
</choice>
|
33
|
+
</element>
|
34
|
+
</define>
|
35
|
+
</include>
|
22
36
|
<start>
|
23
37
|
<ref name="standard-document"/>
|
24
38
|
</start>
|
@@ -28,9 +42,10 @@
|
|
28
42
|
<optional>
|
29
43
|
<ref name="version"/>
|
30
44
|
</optional>
|
31
|
-
<
|
32
|
-
<ref name="
|
33
|
-
</
|
45
|
+
<optional>
|
46
|
+
<ref name="preface"/>
|
47
|
+
</optional>
|
48
|
+
<ref name="sections"/>
|
34
49
|
<zeroOrMore>
|
35
50
|
<ref name="annex"/>
|
36
51
|
</zeroOrMore>
|
@@ -44,11 +59,6 @@
|
|
44
59
|
<ref name="BibData"/>
|
45
60
|
</element>
|
46
61
|
</define>
|
47
|
-
<define name="status">
|
48
|
-
<element name="status">
|
49
|
-
<ref name="FormattedString"/>
|
50
|
-
</element>
|
51
|
-
</define>
|
52
62
|
<define name="version">
|
53
63
|
<element name="version">
|
54
64
|
<optional>
|
@@ -77,6 +87,13 @@
|
|
77
87
|
<text/>
|
78
88
|
</element>
|
79
89
|
</define>
|
90
|
+
<define name="preface">
|
91
|
+
<element name="preface">
|
92
|
+
<oneOrMore>
|
93
|
+
<ref name="content"/>
|
94
|
+
</oneOrMore>
|
95
|
+
</element>
|
96
|
+
</define>
|
80
97
|
<define name="sections">
|
81
98
|
<element name="sections">
|
82
99
|
<oneOrMore>
|
@@ -104,7 +121,9 @@
|
|
104
121
|
</define>
|
105
122
|
<define name="section-title">
|
106
123
|
<element name="title">
|
107
|
-
<
|
124
|
+
<zeroOrMore>
|
125
|
+
<ref name="TextElement"/>
|
126
|
+
</zeroOrMore>
|
108
127
|
</element>
|
109
128
|
</define>
|
110
129
|
<define name="content">
|
@@ -324,7 +343,7 @@
|
|
324
343
|
<attribute name="id">
|
325
344
|
<data type="ID"/>
|
326
345
|
</attribute>
|
327
|
-
<ref name="
|
346
|
+
<ref name="paragraph"/>
|
328
347
|
</element>
|
329
348
|
</define>
|
330
349
|
<define name="termsource">
|
@@ -423,7 +442,7 @@
|
|
423
442
|
<data type="ID"/>
|
424
443
|
</attribute>
|
425
444
|
<oneOrMore>
|
426
|
-
<ref name="paragraph
|
445
|
+
<ref name="paragraph"/>
|
427
446
|
</oneOrMore>
|
428
447
|
</element>
|
429
448
|
</define>
|
@@ -690,21 +709,20 @@
|
|
690
709
|
<ref name="tname"/>
|
691
710
|
</optional>
|
692
711
|
<choice>
|
693
|
-
<
|
712
|
+
<ref name="image"/>
|
713
|
+
<zeroOrMore>
|
694
714
|
<ref name="figure"/>
|
695
|
-
</
|
696
|
-
<group>
|
697
|
-
<zeroOrMore>
|
698
|
-
<ref name="TextElement"/>
|
699
|
-
</zeroOrMore>
|
700
|
-
<zeroOrMore>
|
701
|
-
<ref name="note"/>
|
702
|
-
</zeroOrMore>
|
703
|
-
<optional>
|
704
|
-
<ref name="dl"/>
|
705
|
-
</optional>
|
706
|
-
</group>
|
715
|
+
</zeroOrMore>
|
707
716
|
</choice>
|
717
|
+
<zeroOrMore>
|
718
|
+
<ref name="fn"/>
|
719
|
+
</zeroOrMore>
|
720
|
+
<optional>
|
721
|
+
<ref name="dl"/>
|
722
|
+
</optional>
|
723
|
+
<zeroOrMore>
|
724
|
+
<ref name="note"/>
|
725
|
+
</zeroOrMore>
|
708
726
|
</element>
|
709
727
|
</define>
|
710
728
|
<define name="TextElement">
|
@@ -681,6 +681,14 @@
|
|
681
681
|
<ref name="paragraph"/>
|
682
682
|
</element>
|
683
683
|
</define>
|
684
|
+
<define name="preface">
|
685
|
+
<element name="preface">
|
686
|
+
<ref name="foreword"/>
|
687
|
+
<optional>
|
688
|
+
<ref name="introduction"/>
|
689
|
+
</optional>
|
690
|
+
</element>
|
691
|
+
</define>
|
684
692
|
</include>
|
685
693
|
<!-- end overrides -->
|
686
694
|
<!--
|
@@ -706,14 +714,6 @@
|
|
706
714
|
<ref name="bibliography"/>
|
707
715
|
</element>
|
708
716
|
</define>
|
709
|
-
<define name="preface">
|
710
|
-
<element name="preface">
|
711
|
-
<ref name="foreword"/>
|
712
|
-
<optional>
|
713
|
-
<ref name="introduction"/>
|
714
|
-
</optional>
|
715
|
-
</element>
|
716
|
-
</define>
|
717
717
|
<define name="bibliography">
|
718
718
|
<element name="bibliography">
|
719
719
|
<oneOrMore>
|
@@ -1,41 +1,42 @@
|
|
1
1
|
require "isodoc"
|
2
2
|
require_relative "metadata"
|
3
3
|
require_relative "m3dhtmlrender"
|
4
|
+
require "fileutils"
|
4
5
|
|
5
6
|
module IsoDoc
|
6
7
|
module M3d
|
7
8
|
# A {Converter} implementation that generates CSAND output, and a document
|
8
9
|
# schema encapsulation of the document for validation
|
9
10
|
class HtmlConvert < IsoDoc::HtmlConvert
|
10
|
-
def html_doc_path(file)
|
11
|
-
File.join(File.dirname(__FILE__), File.join("html", file))
|
12
|
-
end
|
13
|
-
|
14
11
|
def add_image(filenames)
|
15
12
|
filenames.each do |filename|
|
16
|
-
system "cp #{html_doc_path(filename)} #{filename}"
|
13
|
+
#system "cp #{html_doc_path(filename)} #{filename}"
|
14
|
+
FileUtils.cp html_doc_path(filename), filename
|
17
15
|
@files_to_delete << filename
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
21
19
|
def initialize(options)
|
20
|
+
@libdir = File.dirname(__FILE__)
|
22
21
|
super
|
23
|
-
@htmlstylesheet = generate_css(html_doc_path("htmlstyle.scss"), true, default_fonts(options))
|
24
|
-
@htmlcoverpage = html_doc_path("html_m3d_titlepage.html")
|
25
|
-
@htmlintropage = html_doc_path("html_m3d_intro.html")
|
26
|
-
@scripts = html_doc_path("scripts.html")
|
27
22
|
add_image(%w(logo.jpg m3-logo.png))
|
28
23
|
end
|
29
24
|
|
30
25
|
def default_fonts(options)
|
31
|
-
|
32
|
-
(options[:script] == "Hans" ? '"SimSun",serif' :
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
{
|
27
|
+
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
|
28
|
+
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
|
29
|
+
monospacefont: '"Space Mono",monospace'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_file_locations(_options)
|
34
|
+
{
|
35
|
+
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
36
|
+
htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
|
37
|
+
htmlintropage: html_doc_path("html_m3d_intro.html"),
|
38
|
+
scripts: html_doc_path("scripts.html"),
|
39
|
+
}
|
39
40
|
end
|
40
41
|
|
41
42
|
def metadata_init(lang, script, labels)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "isodoc"
|
2
2
|
require_relative "m3wordrender"
|
3
|
+
require "fileutils"
|
3
4
|
|
4
5
|
module IsoDoc
|
5
6
|
module M3d
|
@@ -7,30 +8,34 @@ module IsoDoc
|
|
7
8
|
# schema encapsulation of the document for validation
|
8
9
|
|
9
10
|
class WordConvert < IsoDoc::WordConvert
|
10
|
-
def html_doc_path(file)
|
11
|
-
File.join(File.dirname(__FILE__), File.join("html", file))
|
12
|
-
end
|
13
|
-
|
14
11
|
def initialize(options)
|
12
|
+
@libdir = File.dirname(__FILE__)
|
15
13
|
super
|
16
|
-
|
17
|
-
|
18
|
-
@header = html_doc_path("header.html")
|
19
|
-
@wordintropage = html_doc_path("word_m3d_intro.html")
|
20
|
-
@ulstyle = "l3"
|
21
|
-
@olstyle = "l2"
|
22
|
-
system "cp #{html_doc_path('logo.jpg')} logo.jpg"
|
14
|
+
#system "cp #{html_doc_path('logo.jpg')} logo.jpg"
|
15
|
+
FileUtils.cp html_doc_path("logo.jpg"), "logo.jpg"
|
23
16
|
end
|
24
17
|
|
25
18
|
def default_fonts(options)
|
26
|
-
|
27
|
-
(options[:script] == "Hans" ? '"SimSun",serif' :
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
19
|
+
{
|
20
|
+
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Garamond",serif'),
|
21
|
+
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Garamond",serif'),
|
22
|
+
monospacefont: '"Courier New",monospace'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def default_file_locations(_options)
|
27
|
+
{
|
28
|
+
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
29
|
+
htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
|
30
|
+
htmlintropage: html_doc_path("html_m3d_intro.html"),
|
31
|
+
scripts: html_doc_path("scripts.html"),
|
32
|
+
wordstylesheet: html_doc_path("wordstyle.scss"),
|
33
|
+
standardstylesheet: html_doc_path("m3d.scss"),
|
34
|
+
header: html_doc_path("header.html"),
|
35
|
+
wordintropage: html_doc_path("word_m3d_intro.html"),
|
36
|
+
ulstyle: "l3",
|
37
|
+
olstyle: "l2",
|
38
|
+
}
|
34
39
|
end
|
35
40
|
|
36
41
|
def metadata_init(lang, script, labels)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-m3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
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-08-
|
11
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -154,30 +154,30 @@ dependencies:
|
|
154
154
|
name: asciidoctor-iso
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
159
|
+
version: 0.10.2
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
166
|
+
version: 0.10.2
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: isodoc
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.8.
|
173
|
+
version: 0.8.8
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.8.
|
180
|
+
version: 0.8.8
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: bundler
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|