Module: IsoDoc::M3AAWG::BaseRender
- Included in:
- HtmlConvert, WordConvert
- Defined in:
- lib/isodoc/m3aawg/base_convert.rb
Instance Method Summary collapse
-
#annex_name(annex, name, div) ⇒ Object
end.
- #cleanup(docxml) ⇒ Object
- #fileloc(loc) ⇒ Object
- #i18n_init(lang, script) ⇒ Object
- #metadata_init(lang, script, labels) ⇒ Object
- #term_cleanup(docxml) ⇒ Object
Instance Method Details
#annex_name(annex, name, div) ⇒ Object
end
18 19 20 21 22 23 24 25 26 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 18 def annex_name(annex, name, div) div.h1 **{ class: "Annex" } do |t| t << "#{@xrefs.anchor(annex['id'], :label)} " t.br t.b do |b| name&.children&.each { |c2| parse(c2, b) } end end end |
#cleanup(docxml) ⇒ Object
38 39 40 41 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 38 def cleanup(docxml) super term_cleanup(docxml) end |
#fileloc(loc) ⇒ Object
34 35 36 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 34 def fileloc(loc) File.join(File.dirname(__FILE__), loc) end |
#i18n_init(lang, script) ⇒ Object
28 29 30 31 32 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 28 def i18n_init(lang, script) super @annex_lbl = "Appendix" @labels["annex"] = "Appendix" end |
#metadata_init(lang, script, labels) ⇒ Object
7 8 9 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 7 def (lang, script, labels) @meta = Metadata.new(lang, script, labels) end |
#term_cleanup(docxml) ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/isodoc/m3aawg/base_convert.rb', line 43 def term_cleanup(docxml) docxml.xpath("//p[@class = 'Terms']").each do |d| h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]") h2.add_child(" ") h2.add_child(d.remove) end docxml end |