def setConfig(self, key, value): """ Set a config setting for `key` with the given `value`. """ if isinstance(self.config[key][0], bool): value = parseBoolValue(value) if self.config[key][0] is None: value = parseBoolValue(value, preserve_none=True) self.config[key][0] = value
def _get_meta(self): """ Return meta data suported by this ext as a tuple """ level = int(self.config['level']) - 1 force = parseBoolValue(self.config['forceid']) if hasattr(self.md, 'Meta'): if 'header_level' in self.md.Meta: level = int(self.md.Meta['header_level'][0]) - 1 if 'header_forceid' in self.md.Meta: force = parseBoolValue(self.md.Meta['header_forceid'][0]) return level, force
def __init__(self, md, config): super(TocTreeprocessor, self).__init__(md) self.marker = config["marker"] self.title = config["title"] self.base_level = int(config["baselevel"]) - 1 self.slugify = config["slugify"] self.sep = config["separator"] self.use_anchors = parseBoolValue(config["anchorlink"]) self.use_permalinks = parseBoolValue(config["permalink"], False) if self.use_permalinks is None: self.use_permalinks = config["permalink"] self.header_rgx = re.compile("[Hh][23456]")
def __init__(self, md, config): super(TocTreeprocessor, self).__init__(md) self.marker = config["marker"] self.title = config["title"] self.base_level = int(config["baselevel"]) - 1 self.slugify = config["slugify"] self.sep = config["separator"] self.use_anchors = parseBoolValue(config["anchorlink"]) self.use_permalinks = parseBoolValue(config["permalink"], False) if self.use_permalinks is None: self.use_permalinks = config["permalink"] self.header_rgx = re.compile("[Hh][123456]")
def __init__(self, md, config): super().__init__(md) self.marker = config["marker"] self.title = config["title"] self.confluence_title = config["confluence_title"] self.base_level = int(config["baselevel"]) - 1 self.slugify = config["slugify"] self.sep = config["separator"] self.use_anchors = parseBoolValue(config["anchorlink"]) self.anchorlink_class = config["anchorlink_class"] self.use_permalinks = parseBoolValue(config["permalink"], False) if self.use_permalinks is None: self.use_permalinks = config["permalink"] self.permalink_class = config["permalink_class"] self.permalink_title = config["permalink_title"] self.header_rgx = re.compile("[Hh][123456]") if isinstance(config["toc_depth"], str) and '-' in config["toc_depth"]: self.toc_top, self.toc_bottom = [int(x) for x in config["toc_depth"].split('-')] else: self.toc_top = 1 self.toc_bottom = int(config["toc_depth"])