Method: IsoDoc::Function::Lists#ol_depthx

Defined in:
lib/isodoc/function/lists.rb

#ol_depthx(node) ⇒ Object

We don’t really want users to specify type of ordered list; we will use a fixed hierarchy as practiced by ISO (though not fully spelled out): a) 1) i) A) I) Fallback, this is now being done in Presentation XML KILL



42
43
44
45
46
47
48
49
50
# File 'lib/isodoc/function/lists.rb', line 42

def ol_depthx(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
  ol_style(type)
end