Class: IsoDoc::Iec::Xref
- Inherits:
-
IsoDoc::Iso::Xref
- Object
- IsoDoc::Iso::Xref
- IsoDoc::Iec::Xref
- Defined in:
- lib/isodoc/iec/xref.rb
Instance Method Summary collapse
- #annex_name_lbl(clause, num) ⇒ Object
- #clausesep ⇒ Object
- #initial_anchor_names(docxml) ⇒ Object
- #introduction_names(clause) ⇒ Object
- #parse(docxml) ⇒ Object
- #terms_iev_names(docxml) ⇒ Object
Instance Method Details
#annex_name_lbl(clause, num) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/isodoc/iec/xref.rb', line 51 def annex_name_lbl(clause, num) obl = l10n("(#{@labels['inform_annex']})") clause["obligation"] == "normative" and obl = l10n("(#{@labels['norm_annex']})") obl = "<span class='fmt-obligation'>#{l10n obl}</fmt>" s = labelled_autonum(@labels["annex"], num) l10n("<strong><span class='fmt-caption-label'>#{s}</span></strong><br/>#{obl}") end |
#clausesep ⇒ Object
45 46 47 48 49 |
# File 'lib/isodoc/iec/xref.rb', line 45 def clausesep if @terms_iev_names then "-" else super end end |
#initial_anchor_names(docxml) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/isodoc/iec/xref.rb', line 16 def initial_anchor_names(docxml) super return unless @is_iev if @parse_settings.empty? || @parse_settings[:clauses] @terms_iev_names = true terms_iev_names(docxml) @terms_iev_names = false end end |
#introduction_names(clause) ⇒ Object
12 13 14 |
# File 'lib/isodoc/iec/xref.rb', line 12 def introduction_names(clause) super unless @is_iev end |
#parse(docxml) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/isodoc/iec/xref.rb', line 4 def parse(docxml) id = docxml&.at(ns("//bibdata/docnumber"))&.text @is_iev = id == "60050" id = docxml&.at(ns("//bibdata/docidentifier[@type = 'ISO']"))&.text m = /60050-(\d+)/.match(id) and @iev_part = m[1] super end |
#terms_iev_names(docxml) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/isodoc/iec/xref.rb', line 27 def terms_iev_names(docxml) docxml.xpath(ns("//sections/clause/terms")).each_with_index do |t, i| num = semx(t, "#{@iev_part}-%02d" % [i + 1]) @anchors[t["id"]] = { label: num, xref: labelled_autonum(@labels["section_iev"], num), level: 2, type: "clause", elem: @labels["section_iev"] } j = 0 t.xpath(ns("./term")).each do |c| c["unnumbered"] == "true" and next num2 = semx(c, "%02d" % [j + 1]) # section_names1(c, "#{num}#{delim_wrap("-")}#{num2}", 3) section_names1(c, num, num2, 3) j += 1 end end end |