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.
@@ -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(/</, "&lt;").gsub(/>/, "&gt;")
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("&nbsp;")
61
- h2.add_child(d.remove)
62
- end
63
- docxml
64
- end
65
- end
66
- end
67
- end
68
-