require "isodoc"
require "metanorma-iso"
module IsoDoc
module JIS
module BaseConvert
def middle_title(_isoxml, out)
middle_title_main(out)
middle_subtitle_main(out)
# middle_title_amd(out)
end
def middle_title_main(out)
out.p(class: "zzSTDTitle1") do |p|
p << @meta.get[:doctitleintro]
p << " — " if @meta.get[:doctitleintro] && @meta.get[:doctitlemain]
p << @meta.get[:doctitlemain]
p << " — " if @meta.get[:doctitlemain] && @meta.get[:doctitlepart]
end
a = @meta.get[:doctitlepart] and out.p(class: "zzSTDTitle1") do |p|
b = @meta.get[:doctitlepartlabel] and p << "#{b}: "
p << "
#{a}"
end
end
def middle_subtitle_main(out)
@meta.get[:docsubtitlemain] or return
out.p(class: "zzSTDTitle2") do |p|
p << @meta.get[:docsubtitleintro]
p << " — " if @meta.get[:docsubtitleintro] && @meta.get[:docsubtitlemain]
p << @meta.get[:docsubtitlemain]
p << " — " if @meta.get[:docsubtitlemain] && @meta.get[:docsubtitlepart]
end
a = @meta.get[:docsubtitlepart] and out.p(class: "zzSTDTitle2") do |p|
b = @meta.get[:docsubtitlepartlabel] and p << "#{b}: "
p << "
#{a}"
end
end
def termnote_parse(node, out)
name = node&.at(ns("./name"))&.remove
out.div **note_attrs(node) do |div|
div.p do |p|
if name
p.span class: "note_label" do |s|
name.children.each { |n| parse(n, s) }
end
p << termnote_delim
end
para_then_remainder(node.first_element_child, node, p, div)
end
end
end
def admonition_name_parse(_node, div, name)
div.span class: "note_label" do |s|
name.children.each { |n| parse(n, s) }
s << " — "
end
end
def admitted_term_parse(node, out)
out.p class: "Terms", style: "text-align:left;" do |p|
p << l10n("#{@i18n.alternative}: ")
node.children.each { |c| parse(c, p) }
end
end
def para_class(node)
super || node["class"]
end
def make_tr_attr(cell, row, totalrows, header, bordered)
cell["border"] == "0" and bordered = false
super
end
end
end
end