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

Method __init__

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

Source from the content-addressed store, hash-verified

450 TreeProcessorClass = TocTreeprocessor
451
452 def __init__(self, **kwargs):
453 self.config = {
454 'marker': [
455 '[TOC]',
456 'Text to find and replace with Table of Contents. Set to an empty string to disable. '
457 'Default: `[TOC]`.'
458 ],
459 'title': [
460 '', 'Title to insert into TOC `<div>`. Default: an empty string.'
461 ],
462 'title_class': [
463 'toctitle', 'CSS class used for the title. Default: `toctitle`.'
464 ],
465 'toc_class': [
466 'toc', 'CSS class(es) used for the link. Default: `toclink`.'
467 ],
468 'anchorlink': [
469 False, 'True if header should be a self link. Default: `False`.'
470 ],
471 'anchorlink_class': [
472 'toclink', 'CSS class(es) used for the link. Defaults: `toclink`.'
473 ],
474 'permalink': [
475 0, 'True or link text if a Sphinx-style permalink should be added. Default: `False`.'
476 ],
477 'permalink_class': [
478 'headerlink', 'CSS class(es) used for the link. Default: `headerlink`.'
479 ],
480 'permalink_title': [
481 'Permanent link', 'Title attribute of the permalink. Default: `Permanent link`.'
482 ],
483 'permalink_leading': [
484 False,
485 'True if permalinks should be placed at start of the header, rather than end. Default: False.'
486 ],
487 'baselevel': ['1', 'Base level for headers. Default: `1`.'],
488 'slugify': [
489 slugify, 'Function to generate anchors based on header text. Default: `slugify`.'
490 ],
491 'separator': ['-', 'Word separator. Default: `-`.'],
492 'toc_depth': [
493 6,
494 'Define the range of section levels to include in the Table of Contents. A single integer '
495 '(b) defines the bottom section level (<h1>..<hb>) only. A string consisting of two digits '
496 'separated by a hyphen in between (`2-5`) defines the top (t) and the bottom (b) (<ht>..<hb>). '
497 'Default: `6` (bottom).'
498 ],
499 }
500 """ Default configuration options. """
501
502 super().__init__(**kwargs)
503
504 def extendMarkdown(self, md):
505 """ Register the processor.

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected