Skip to content

Commit

Permalink
Clear towncrier output cache when rebuilding pages
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa committed Aug 7, 2024
1 parent 8a5b6fe commit 05213ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mkdocs-towncrier"
version = "0.1.1"
version = "0.1.2"
description = "An insanely small plugin to add towncrier changelog draft into mkdocs"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
6 changes: 6 additions & 0 deletions src/mkdocs_towncrier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class TowncrierPlugin(mkdocs.plugins.BasePlugin[TowncrierPluginConfig]):

directive_regex = re.compile(r"^:: towncrier-draft ?(?P<header>.+?)? *$", flags=re.MULTILINE)

def on_config(self, config: mkdocs.config.defaults.MkDocsConfig) -> mkdocs.config.defaults.MkDocsConfig | None:
"""See https://www.mkdocs.org/dev-guide/plugins/#on_config for more info."""
_generate_changelog_draft.cache_clear()

return config

def on_page_markdown(
self,
markdown: str,
Expand Down

0 comments on commit 05213ad

Please sign in to comment.