This commit is contained in:
Julio Castillo
2023-07-28 17:10:49 +02:00
parent 1800d3e617
commit 7fb656b8ae

View File

@@ -324,7 +324,7 @@ def format_variables(items, show_extra=True):
def create_toc(readme):
'Create a Markdown table of contents a Markdown table of contents.'
'Create a Markdown table of contents a for README.'
doc = marko.parse(readme)
lines = []
headings = [x for x in doc.children if x.get_type() == 'Heading']
@@ -344,7 +344,7 @@ def create_toc(readme):
def get_doc(readme):
'Check if README file is marked, and return current doc.'
m = re.search("(?sm)%s(.*)%s" % (MARK_BEGIN, MARK_END), readme)
m = re.search('(?sm)%s(.*)%s' % (MARK_BEGIN, MARK_END), readme)
if not m:
return
return {'doc': m.group(1).strip(), 'start': m.start(), 'end': m.end()}
@@ -352,7 +352,7 @@ def get_doc(readme):
def get_toc(readme):
'Check if README file is marked, and return current toc.'
t = re.search("(?sm)%s(.*)%s" % (TOC_BEGIN, TOC_END), readme)
t = re.search('(?sm)%s(.*)%s' % (TOC_BEGIN, TOC_END), readme)
if not t:
return
return {'toc': t.group(1).strip(), 'start': t.start(), 'end': t.end()}