asciidoctor-rsd 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -1
- data/Gemfile +0 -4
- data/README.adoc +1 -0
- data/asciidoctor-rsd.gemspec +3 -11
- data/lib/asciidoctor-rsd.rb +3 -2
- data/lib/asciidoctor/rsd.rb +3 -1
- data/lib/asciidoctor/rsd/converter.rb +14 -4
- data/lib/asciidoctor/rsd/isodoc.rng +8 -2
- data/lib/asciidoctor/rsd/rsd.rng +101 -23
- data/lib/asciidoctor/rsd/version.rb +1 -1
- data/lib/isodoc/rsd/html/html_rsd_titlepage.html +10 -5
- data/lib/isodoc/rsd/html/htmlstyle.scss +226 -80
- data/lib/isodoc/rsd/html/rsd.scss +41 -18
- data/lib/isodoc/rsd/html/word_rsd_titlepage.html +13 -1
- data/lib/isodoc/rsd/html/wordstyle.scss +172 -20
- data/lib/isodoc/rsd/html_convert.rb +198 -0
- data/lib/isodoc/rsd/metadata.rb +7 -4
- data/lib/isodoc/rsd/{rsdhtmlconvert.rb → pdf_convert.rb} +69 -4
- data/lib/isodoc/rsd/{rsdwordconvert.rb → word_convert.rb} +71 -5
- data/lib/metanorma/rsd/processor.rb +3 -0
- metadata +16 -119
- data/Gemfile.lock +0 -273
- data/lib/asciidoctor/rsd/m3d.rng +0 -154
- data/lib/isodoc/rsd/html/dots-w@2x.png +0 -0
- data/lib/isodoc/rsd/html/dots@2x.png +0 -0
- data/lib/isodoc/rsd/rsdhtmlrender.rb +0 -68
- data/lib/isodoc/rsd/rsdwordrender.rb +0 -68
@@ -1,68 +0,0 @@
|
|
1
|
-
module IsoDoc
|
2
|
-
module Rsd
|
3
|
-
# A {Converter} implementation that generates CSAND output, and a document
|
4
|
-
# schema encapsulation of the document for validation
|
5
|
-
class WordConvert < IsoDoc::WordConvert
|
6
|
-
def annex_name(annex, name, div)
|
7
|
-
div.h1 **{ class: "Annex" } do |t|
|
8
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
9
|
-
t << "<b>#{name.text}</b>"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def annex_name_lbl(clause, num)
|
14
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
15
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
16
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
17
|
-
end
|
18
|
-
|
19
|
-
def pre_parse(node, out)
|
20
|
-
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
21
|
-
end
|
22
|
-
|
23
|
-
def term_defs_boilerplate(div, source, term, preface)
|
24
|
-
if source.empty? && term.nil?
|
25
|
-
div << @no_terms_boilerplate
|
26
|
-
else
|
27
|
-
div << term_defs_boilerplate_cont(source, term)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def i18n_init(lang, script)
|
32
|
-
super
|
33
|
-
@annex_lbl = "Appendix"
|
34
|
-
end
|
35
|
-
|
36
|
-
def error_parse(node, out)
|
37
|
-
# catch elements not defined in ISO
|
38
|
-
case node.name
|
39
|
-
when "pre"
|
40
|
-
pre_parse(node, out)
|
41
|
-
when "keyword"
|
42
|
-
out.span node.text, **{ class: "keyword" }
|
43
|
-
else
|
44
|
-
super
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def fileloc(loc)
|
49
|
-
File.join(File.dirname(__FILE__), loc)
|
50
|
-
end
|
51
|
-
|
52
|
-
def cleanup(docxml)
|
53
|
-
super
|
54
|
-
term_cleanup(docxml)
|
55
|
-
end
|
56
|
-
|
57
|
-
def term_cleanup(docxml)
|
58
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
59
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
60
|
-
h2.add_child(" ")
|
61
|
-
h2.add_child(d.remove)
|
62
|
-
end
|
63
|
-
docxml
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|