Module: IsoDoc::UN::BaseConvert
- Included in:
- HtmlConvert, WordConvert
- Defined in:
- lib/isodoc/un/base_convert.rb
Instance Method Summary collapse
- #admonition_parse(node, out) ⇒ Object
- #bibliography_xpath ⇒ Object
- #convert_i18n_init1(docxml) ⇒ Object
- #inline_header_title(out, _node, title) ⇒ Object
- #middle_clause(_docxml) ⇒ Object
- #norm_ref(node, out) ⇒ Object
- #norm_ref_xpath ⇒ Object
- #plenary?(docxml) ⇒ Boolean
Instance Method Details
#admonition_parse(node, out) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/isodoc/un/base_convert.rb', line 19 def admonition_parse(node, out) name = node.at(ns("./name")) out.div **admonition_attrs(node) do |t| admonition_name_parse(node, t, name) if name node.children.each do |n| parse(n, t) unless n.name == "name" end end end |
#bibliography_xpath ⇒ Object
14 15 16 17 |
# File 'lib/isodoc/un/base_convert.rb', line 14 def bibliography_xpath "//bibliography/clause[.//references] | " \ "//bibliography/references" end |
#convert_i18n_init1(docxml) ⇒ Object
47 48 49 50 |
# File 'lib/isodoc/un/base_convert.rb', line 47 def convert_i18n_init1(docxml) super docxml.xpath(ns("//bibdata/language")).size > 1 and @lang = "en" end |
#inline_header_title(out, _node, title) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/isodoc/un/base_convert.rb', line 29 def inline_header_title(out, _node, title) out.span class: "zzMoveToFollowing inline-header" do |s| title&.children&.each { |c2| parse(c2, s) } clausedelimspace(_node, out) if /\S/.match?(title&.text) end end |
#middle_clause(_docxml) ⇒ Object
6 7 8 |
# File 'lib/isodoc/un/base_convert.rb', line 6 def middle_clause(_docxml) "//clause[parent::sections]" end |
#norm_ref(node, out) ⇒ Object
43 44 45 |
# File 'lib/isodoc/un/base_convert.rb', line 43 def norm_ref(node, out) bibliography(node, out) end |
#norm_ref_xpath ⇒ Object
10 11 12 |
# File 'lib/isodoc/un/base_convert.rb', line 10 def norm_ref_xpath "//null" end |
#plenary?(docxml) ⇒ Boolean
36 37 38 39 40 41 |
# File 'lib/isodoc/un/base_convert.rb', line 36 def plenary?(docxml) return true if %w(plenary agenda budgetary).include?(@doctype) return true if docxml&.at(ns("//bibdata/ext/session/*")) false end |