MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / __init__

Method __init__

markdown/extensions/toc.py:423–473  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

421 TreeProcessorClass = TocTreeprocessor
422
423 def __init__(self, **kwargs):
424 self.config = {
425 'marker': [
426 '[TOC]',
427 'Text to find and replace with Table of Contents. Set to an empty string to disable. '
428 'Default: `[TOC]`.'
429 ],
430 'title': [
431 '', 'Title to insert into TOC `<div>`. Default: an empty string.'
432 ],
433 'title_class': [
434 'toctitle', 'CSS class used for the title. Default: `toctitle`.'
435 ],
436 'toc_class': [
437 'toc', 'CSS class(es) used for the link. Default: `toclink`.'
438 ],
439 'anchorlink': [
440 False, 'True if header should be a self link. Default: `False`.'
441 ],
442 'anchorlink_class': [
443 'toclink', 'CSS class(es) used for the link. Defaults: `toclink`.'
444 ],
445 'permalink': [
446 0, 'True or link text if a Sphinx-style permalink should be added. Default: `False`.'
447 ],
448 'permalink_class': [
449 'headerlink', 'CSS class(es) used for the link. Default: `headerlink`.'
450 ],
451 'permalink_title': [
452 'Permanent link', 'Title attribute of the permalink. Default: `Permanent link`.'
453 ],
454 'permalink_leading': [
455 False,
456 'True if permalinks should be placed at start of the header, rather than end. Default: False.'
457 ],
458 'baselevel': ['1', 'Base level for headers. Default: `1`.'],
459 'slugify': [
460 slugify, 'Function to generate anchors based on header text. Default: `slugify`.'
461 ],
462 'separator': ['-', 'Word separator. Default: `-`.'],
463 'toc_depth': [
464 6,
465 'Define the range of section levels to include in the Table of Contents. A single integer '
466 '(b) defines the bottom section level (<h1>..<hb>) only. A string consisting of two digits '
467 'separated by a hyphen in between (`2-5`) defines the top (t) and the bottom (b) (<ht>..<hb>). '
468 'Default: `6` (bottom).'
469 ],
470 }
471 """ Default configuration options. """
472
473 super().__init__(**kwargs)
474
475 def extendMarkdown(self, md):
476 """ Register the processor.

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected