Module: IsoDoc::Csd::BaseConvert
- Included in:
- HtmlConvert, WordConvert
- Defined in:
- lib/isodoc/csd/base_convert.rb
Instance Method Summary collapse
- #annex_name(annex, name, div) ⇒ Object
- #cleanup(docxml) ⇒ 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
11 12 13 14 15 16 17 18 19 |
# File 'lib/isodoc/csd/base_convert.rb', line 11 def annex_name(annex, name, div) div.h1 **{ class: "Annex" } do |t| t << "#{anchor(annex['id'], :label)} " t.br t.b do |b| name&.children&.each { |c2| parse(c2, b) } end end end |
#cleanup(docxml) ⇒ Object
26 27 28 29 |
# File 'lib/isodoc/csd/base_convert.rb', line 26 def cleanup(docxml) super term_cleanup(docxml) end |
#i18n_init(lang, script) ⇒ Object
21 22 23 24 |
# File 'lib/isodoc/csd/base_convert.rb', line 21 def i18n_init(lang, script) super @annex_lbl = "Appendix" end |
#metadata_init(lang, script, labels) ⇒ Object
7 8 9 |
# File 'lib/isodoc/csd/base_convert.rb', line 7 def (lang, script, labels) @meta = Metadata.new(lang, script, labels) end |
#term_cleanup(docxml) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/isodoc/csd/base_convert.rb', line 31 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 |