Method: IsoDoc::PresentationXMLConvert#ol_depth

Defined in:
lib/isodoc/presentation_function/block.rb

#ol_depth(node) ⇒ Object

We don’t really want users to specify type of ordered list; we will use by default a fixed hierarchy as practiced by ISO (though not fully spelled out): a) 1) i) A) I)



136
137
138
139
140
141
142
143
144
# File 'lib/isodoc/presentation_function/block.rb', line 136

def ol_depth(node)
  depth = node.ancestors("ul, ol").size + 1
  type = :alphabet
  type = :arabic if [2, 7].include? depth
  type = :roman if [3, 8].include? depth
  type = :alphabet_upper if [4, 9].include? depth
  type = :roman_upper if [5, 10].include? depth
  type
end