1
0
Fork 0

Support basic markdown in meta.comment

This commit is contained in:
Tim Van Baak 2023-09-12 17:31:04 -07:00
parent e683438ad0
commit d12b2dee97
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@ def main():
out = pathlib.Path(args.out)
md = markdown.Markdown(extensions=["attr_list", "footnotes", "md_in_html", "meta"])
comment_md = markdown.Markdown()
# Clean the output directory
if out.exists():
@ -108,7 +109,8 @@ def main():
if meta_comment := meta.get("comment"):
for comment in meta_comment:
aside = page.new_tag("aside")
aside.string = comment
html = bs4.BeautifulSoup(comment_md.convert(comment), features="html.parser")
aside.extend(html.p.contents)
page.header.append(aside)
# Write the fully templated page