'none': 'none', 'upperLetter': 'upper-alpha', 'upperRoman': 'upper-roman', 'chineseCounting': 'cjk-ideographic', 'decimalZero': 'decimal-leading-zero', } def alphabet(val, lower=True): x = string.ascii_lowercase if lower else string.ascii_uppercase return x[(abs(val - 1)) % len(x)] alphabet_map = { 'lower-alpha':alphabet, 'upper-alpha':partial(alphabet, lower=False), 'lower-roman':lambda x:roman(x).lower(), 'upper-roman':roman, 'decimal-leading-zero': lambda x: '0%d' % x } class Level(object): def __init__(self, namespace, lvl=None): self.namespace = namespace self.restart = None self.start = 0 self.fmt = 'decimal' self.para_link = None self.paragraph_style = self.character_style = None self.is_numbered = False self.num_template = None
'none': 'none', 'upperLetter': 'upper-alpha', 'upperRoman': 'upper-roman', 'chineseCounting': 'cjk-ideographic', 'decimalZero': 'decimal-leading-zero', } def alphabet(val, lower=True): x = string.ascii_lowercase if lower else string.ascii_uppercase return x[(abs(val - 1)) % len(x)] alphabet_map = { 'lower-alpha':alphabet, 'upper-alpha':partial(alphabet, lower=False), 'lower-roman':lambda x:roman(x).lower(), 'upper-roman':roman, 'decimal-leading-zero': lambda x: '0%d' % x } class Level: def __init__(self, namespace, lvl=None): self.namespace = namespace self.restart = None self.start = 0 self.fmt = 'decimal' self.para_link = None self.paragraph_style = self.character_style = None self.is_numbered = False self.num_template = None
'upperLetter': 'upper-alpha', 'upperRoman': 'upper-roman', 'chineseCounting': 'cjk-ideographic', 'decimalZero': 'decimal-leading-zero', } def alphabet(val, lower=True): x = string.ascii_lowercase if lower else string.ascii_uppercase return x[(abs(val - 1)) % len(x)] alphabet_map = { 'lower-alpha': alphabet, 'upper-alpha': partial(alphabet, lower=False), 'lower-roman': lambda x: roman(x).lower(), 'upper-roman': roman, 'decimal-leading-zero': lambda x: '0%d' % x } class Level(object): def __init__(self, namespace, lvl=None): self.namespace = namespace self.restart = None self.start = 0 self.fmt = 'decimal' self.para_link = None self.paragraph_style = self.character_style = None self.is_numbered = False self.num_template = None