Skip to content

Commit

Permalink
Add documentation for renderer heading when TOC enabled
Browse files Browse the repository at this point in the history
ref: #251
  • Loading branch information
lepture committed Apr 5, 2022
1 parent 799cd11 commit 76dec68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Here is a a list of available renderer functions::
# block level
paragraph(self, text)
heading(self, text, level)
heading(self, text, level, tid) # when TOC directive is enabled
thematic_break(self)
block_text(self, text)
block_code(self, code, info=None)
Expand Down
11 changes: 11 additions & 0 deletions docs/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ TOC plugin::
plugins=[DirectiveToc()]
)

If **TOC** directive is enabled, the ``heading`` method of renderer will accept
one more paramter::

def heading(self, text, level):
# without TOC directive
return ''

def heading(self, text, level, tid):
# with TOC directive
return ''

Include
-------

Expand Down

0 comments on commit 76dec68

Please sign in to comment.