MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / __init__

Method __init__

markdown/extensions/toc.py:105–120  ·  view source on GitHub ↗
(self, configs)

Source from the content-addressed store, hash-verified

103
104class TocExtension(markdown.Extension):
105 def __init__(self, configs):
106 self.config = { "marker" : ["[TOC]",
107 "Text to find and replace with Table of Contents -"
108 "Defaults to \"[TOC]\""],
109 "slugify" : [self.slugify,
110 "Function to generate anchors based on header text-"
111 "Defaults to a built in slugify function."],
112 "title" : [None,
113 "Title to insert into TOC <div> - "
114 "Defaults to None"],
115 "anchorlink" : [0,
116 "1 if header should be a self link"
117 "Defaults to 0"]}
118
119 for key, value in configs:
120 self.setConfig(key, value)
121
122 # This is exactly the same as Django's slugify
123 def slugify(self, value):

Callers

nothing calls this directly

Calls 1

setConfigMethod · 0.80

Tested by

no test coverage detected