require "date" require "nokogiri" require "htmlentities" require "json" require "pathname" require "uuidtools" module Asciidoctor module Standoc module Utils def convert(node, transform = nil, opts = {}) transform ||= node.node_name opts.empty? ? (send transform, node) : (send transform, node, opts) end def document_ns_attributes(_doc) nil end NOKOHEAD = <<~HERE.freeze
def wrap_in_para(node, out) if node.blocks? then out << node.content else out.p { |p| p << node.content } end end SUBCLAUSE_XPATH = "//clause[not(parent::sections)]"\ "[not(ancestor::boilerplate)]".freeze def isodoc(lang, script, i18nyaml = nil) conv = html_converter(EmptyAttr.new) i18n = conv.i18n_init(lang, script, i18nyaml) conv.metadata_init(lang, script, i18n) conv end def default_script(lang) case lang when "ar", "fa" "Arab" when "ur" "Aran" when "ru", "bg" "Cyrl" when "hi" "Deva" when "el" "Grek" when "zh" "Hans" when "ko" "Kore" when "he" "Hebr" when "ja" "Jpan" else "Latn" end end class EmptyAttr def attr(_any_attribute) nil end def attributes {} end end end end end