Ejemplo n.º 1
0
 def _eval_counter(self, node, args):
   # These look like: "counter(chapter)" or "counter(chapter, upper-roman)"
   (name, numbering) = args
   v = 0
   if name in self.state.counters:
     v = self.state.counters[name]
   if v and name != 'page':
     return numbers.toString(v, numbering)
Ejemplo n.º 2
0
 def _eval_target_counter(self, node, args):
   (attr, name, numbering) = args
   n = node
   if self.is_pseudo(node):
     n = node.getparent()
   v = self.lookup_counter(n, attr, name)
   if v and name != 'page':
     # TODO: use numbering to customize how it's rendered (decimal, upper-roman, etc)
     return numbers.toString(v, numbering)