Skip to content

Commit 3ca1f90

Browse files
authored
DOP-2505: Give html5 id to chapter (#365)
1 parent 58e7ea5 commit 3ca1f90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

snooty/postprocess.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ class GuidesHandler(Handler):
732732

733733
@dataclass
734734
class ChapterData:
735+
id: str
735736
chapter_number: int
736737
description: Optional[str]
737738
guides: List[str]
@@ -853,7 +854,11 @@ def __handle_chapter(self, chapter: n.Directive, current_file: FileId) -> None:
853854
if not self.chapters.get(title):
854855
icon = chapter.options.get("icon")
855856
self.chapters[title] = GuidesHandler.ChapterData(
856-
len(self.chapters) + 1, description, guides, icon
857+
util.make_html5_id(title).lower(),
858+
len(self.chapters) + 1,
859+
description,
860+
guides,
861+
icon,
857862
)
858863
else:
859864
self.context.diagnostics[current_file].append(

0 commit comments

Comments
 (0)