module IsoDoc::NIST::Init
Public Instance Methods
fileloc(loc)
click to toggle source
# File lib/isodoc/nist/init.rb, line 21 def fileloc(loc) File.join(File.dirname(__FILE__), loc) end
i18n_init(lang, script, i18nyaml = nil)
click to toggle source
# File lib/isodoc/nist/init.rb, line 17 def i18n_init(lang, script, i18nyaml = nil) @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml) end
metadata_init(lang, script, labels)
click to toggle source
# File lib/isodoc/nist/init.rb, line 9 def metadata_init(lang, script, labels) @meta = Metadata.new(lang, script, labels) end
suppress_biblio_title(node)
click to toggle source
# File lib/isodoc/nist/init.rb, line 25 def suppress_biblio_title(node) return false unless node.parent.name == "annex" return false if node.parent.xpath("./references | ./clause | "\ "./terms | ./definitions").size > 1 title1 = node&.at(ns("./title"))&.text&.sub(/^[A-Z]\.(\d+\.)*/, "") return true unless title1 && !title1.empty? title2 = node&.parent&.at(ns("./title"))&.text&.sub(/^.*?— /, "") title1&.casecmp(title2) == 0 end
xref_init(lang, script, _klass, labels, options)
click to toggle source
# File lib/isodoc/nist/init.rb, line 13 def xref_init(lang, script, _klass, labels, options) @xrefs = Xref.new(lang, script, HtmlConvert.new(language: lang, script: script), labels, options) end