Class: IsoDoc::Bipm::HtmlConvert
- Inherits:
-
Generic::HtmlConvert
- Object
- Generic::HtmlConvert
- IsoDoc::Bipm::HtmlConvert
- Includes:
- BaseConvert, Init
- Defined in:
- lib/isodoc/bipm/html_convert.rb
Instance Attribute Summary
Attributes included from BaseConvert
Instance Method Summary collapse
Methods included from Init
#amd?, #bibrenderer, #i18n_init, #metadata_init, #xref_init
Methods included from BaseConvert
#configuration, #convert1, #middle_clause, #table_footnote?, #term_cleanup
Instance Method Details
#counter_reset(node) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/isodoc/bipm/html_convert.rb', line 9 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 |
#ol_attrs(node) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/isodoc/bipm/html_convert.rb', line 16 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), style: style, class: klass)) end |