Class: IsoDoc::BIPM::HtmlConvert
- Inherits:
-
Generic::HtmlConvert
- Object
- Generic::HtmlConvert
- IsoDoc::BIPM::HtmlConvert
show all
- Includes:
- BaseConvert, Init
- Defined in:
- lib/isodoc/bipm/html_convert.rb
Constant Summary
Constants included
from BaseConvert
BaseConvert::TOP_ELEMENTS
Instance Attribute Summary
Attributes included from BaseConvert
#jcgm
Instance Method Summary
collapse
Methods included from Init
#amd?, #bibrenderer, #i18n_init, #metadata_init, #omit_docid_prefix, #xref_init
#blacksquare_parse, #configuration, #convert1, #error_parse, #implicit_reference, #middle_clause, #render_identifier, #term_cleanup, #top_element_render
Instance Method Details
#counter_reset(node) ⇒ Object
18
19
20
21
22
23
|
# File 'lib/isodoc/bipm/html_convert.rb', line 18
def counter_reset(node)
s = node["start"]
return nil unless s && !s.empty? && !s.to_i.zero?
"counter-reset: #{node['type']} #{s.to_i - 1};"
end
|
#doccontrol(elem, out) ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'lib/isodoc/bipm/html_convert.rb', line 9
def doccontrol(elem, out)
out.div **attr_code(class: "doccontrol") do |div|
clause_parse_title(elem, div, elem.at(ns("./title")), out)
elem.children.reject { |c1| c1.name == "title" }.each do |c1|
parse(c1, div)
end
end
end
|
#ol_attrs(node) ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/isodoc/bipm/html_convert.rb', line 25
def ol_attrs(node)
klass, style = if (node["type"] == "roman" &&
!node.at("./ancestor::xmlns:ol[@type = 'roman']")) ||
(node["type"] == "alphabet" &&
!node.at("./ancestor::xmlns:ol[@type = 'alphabet']"))
[node["type"], counter_reset(node)]
end
super.merge(attr_code(type: ol_style((node["type"] || "arabic").to_sym),
start: node["start"]), style: style, class: klass)
end
|