Module: IsoDoc::Function::Terms
- Included in:
- Common
- Defined in:
- lib/isodoc/function/terms.rb
Instance Method Summary collapse
- #admitted_term_parse(node, out) ⇒ Object
- #definition_parse(node, out) ⇒ Object
- #deprecated_term_parse(node, out) ⇒ Object
- #modification_parse(node, out) ⇒ Object
- #para_then_remainder(first, node, p, div) ⇒ Object
- #term_parse(node, out) ⇒ Object
- #termdef_parse(node, out) ⇒ Object
- #termdocsource_parse(_node, _out) ⇒ Object
- #termnote_delim ⇒ Object
- #termnote_parse(node, out) ⇒ Object
- #termref_parse(node, out) ⇒ Object
Instance Method Details
#admitted_term_parse(node, out) ⇒ Object
20 21 22 23 24 |
# File 'lib/isodoc/function/terms.rb', line 20 def admitted_term_parse(node, out) out.p **{ class: "AltTerms", style:"text-align:left;" } do |p| node.children.each { |c| parse(c, p) } end end |
#definition_parse(node, out) ⇒ Object
3 4 5 |
# File 'lib/isodoc/function/terms.rb', line 3 def definition_parse(node, out) node.children.each { |n| parse(n, out) } end |
#deprecated_term_parse(node, out) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/isodoc/function/terms.rb', line 13 def deprecated_term_parse(node, out) out.p **{ class: "DeprecatedTerms", style:"text-align:left;" } do |p| p << l10n("#{@i18n.deprecated}: ") node.children.each { |c| parse(c, p) } end end |
#modification_parse(node, out) ⇒ Object
7 8 9 10 11 |
# File 'lib/isodoc/function/terms.rb', line 7 def modification_parse(node, out) out << "[MODIFICATION]" para = node.at(ns("./p")) para.children.each { |n| parse(n, out) } end |
#para_then_remainder(first, node, p, div) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/isodoc/function/terms.rb', line 32 def para_then_remainder(first, node, p, div) if first.name == "p" first.children.each { |n| parse(n, p) } node.elements.drop(1).each { |n| parse(n, div) } else node.elements.each { |n| parse(n, div) } end end |
#term_parse(node, out) ⇒ Object
26 27 28 29 30 |
# File 'lib/isodoc/function/terms.rb', line 26 def term_parse(node, out) out.p **{ class: "Terms", style:"text-align:left;" } do |p| node.children.each { |c| parse(c, p) } end end |
#termdef_parse(node, out) ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/isodoc/function/terms.rb', line 66 def termdef_parse(node, out) name = node&.at(ns("./name"))&.remove out.p **{ class: "TermNum", id: node["id"] } do |p| name&.children&.each { |n| parse(n, p) } end set_termdomain("") node.children.each { |n| parse(n, out) } end |
#termdocsource_parse(_node, _out) ⇒ Object
75 76 |
# File 'lib/isodoc/function/terms.rb', line 75 def termdocsource_parse(_node, _out) end |
#termnote_delim ⇒ Object
41 42 43 |
# File 'lib/isodoc/function/terms.rb', line 41 def termnote_delim l10n(": ") end |
#termnote_parse(node, out) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/isodoc/function/terms.rb', line 45 def termnote_parse(node, out) name = node&.at(ns("./name"))&.remove out.div **note_attrs(node) do |div| div.p do |p| if name name.children.each { |n| parse(n, p) } p << termnote_delim end para_then_remainder(node.first_element_child, node, p, div) end end end |
#termref_parse(node, out) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/isodoc/function/terms.rb', line 58 def termref_parse(node, out) out.p do |p| p << "[TERMREF]" node.children.each { |n| parse(n, p) } p << "[/TERMREF]" end end |