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)



181
182
183
184
185
186
187
188
189
# File 'lib/isodoc/presentation_function/block.rb', line 181

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