Add support for indexing and auto-completing story notes

This commit is contained in:
Veronica Berglyd Olsen
2025-05-18 22:36:25 +02:00
parent f2f2e6cb46
commit f22f80dafd
3 changed files with 25 additions and 4 deletions
+4 -1
View File
@@ -316,6 +316,9 @@ class IndexHeading:
case "story" if key:
self._cache.story.add(key)
self._comments[f"story.{key}"] = str(text)
case "note" if key:
self._cache.note.add(key)
self._comments[f"note.{key}"] = str(text)
return
def setTag(self, tag: str) -> None:
@@ -395,7 +398,7 @@ class IndexHeading:
self.addReference(tag, keyword)
else:
raise ValueError("Heading reference contains an invalid keyword")
elif key == "summary" or key.startswith("story"):
elif key == "summary" or key.startswith(("story", "note")):
comment, _, kind = str(key).partition(".")
self.setComment(comment, compact(kind), str(entry))
else: