markdown.markdown.heading

Functions about Markdown headings
from fastcore.test import *

source

heading_level

 heading_level (heading_str:str)

Return the level of the heading string.

Type Details
heading_str str A str representing a markdown heading. Starts with 1 to 6 sharps '#'.
Returns int Between 1 and 6, inclusive.
test_eq(heading_level('## Title'), 2)

source

heading_title

 heading_title (heading_str:str)

Return the heading title, without the starting sharps.

Type Details
heading_str str A str representing a markdown heading. Starts with 1 to 6 sharps '#'.
Returns str
test_eq(heading_title('# Separable isogeny '), 'Separable isogeny')
test_eq(heading_title('#  Test title#'),  'Test title#')