Skip to content

Commit 5b07233

Browse files
committed
Add TOC processing - levels (v1.1.4)
1 parent 8b76379 commit 5b07233

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hastie/content.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import frontmatter
1010
from markdown import markdown
11+
from markdown.extensions.toc import TocExtension
1112

1213
import hastie.utils as utils
1314

@@ -48,7 +49,7 @@ def read_page(filename: Path, config: dict[str, Any] | None = None) -> dict[str,
4849

4950
def process_markdown(md: str) -> str:
5051
"""Take markdown content and process to HTML."""
51-
exts = ["codehilite", "fenced_code", "tables", "toc"]
52+
exts = ["codehilite", "fenced_code", "tables", TocExtension(baselevel=2,toc_depth="2-3")]
5253
html = markdown(md, extensions=exts)
5354
return html
5455

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[project]
33
name = "hastie"
4-
version = "1.1.2"
4+
version = "1.1.4"
55
description = "A static site generator"
66
authors = [{name = "Marcus Kazmierczak", email = "marcus@mkaz.com"}]
77
license = {text = "MIT"}

0 commit comments

Comments
 (0)