diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1da26b0..fa99309 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,13 +17,13 @@ repos: args: ["--autofix", "--no-sort-keys"] - repo: "https://github.com/codespell-project/codespell" - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell args: ["--ignore-regex", "https://[^\\s]*"] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.36.0 + rev: 0.37.4 hooks: - id: check-github-workflows - id: check-jsonschema @@ -37,7 +37,7 @@ repos: - id: alphabetize-codeowners - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.5.1 hooks: - id: black diff --git a/support/build-doc-bundle.py b/support/build-doc-bundle.py index 3d35b20..0b563b1 100755 --- a/support/build-doc-bundle.py +++ b/support/build-doc-bundle.py @@ -137,31 +137,24 @@ def render_example_index_doc( def prepend_preamble( config: ExampleDocBuildConfig, ide_link: str | None, content: bytes ) -> bytes: - preamble = textwrap.dedent( - f"""\ + preamble = textwrap.dedent(f"""\ --- menu_weight: {config.menu_weight} --- - """ - ) + """) if ide_link is not None: - preamble += textwrap.dedent( - f""" + preamble += textwrap.dedent(f""" :flows_ide_link: {ide_link} - """ - ) + """) return preamble.encode("utf-8") + content def append_source_blocks(content: bytes) -> bytes: - return ( - content - + textwrap.dedent( - """ + return content + textwrap.dedent(""" == Source code [.accordionize] @@ -199,13 +192,10 @@ def append_source_blocks(content: bytes) -> bytes: ---- ==== -- - """ - ).encode("utf-8") - ) + """).encode("utf-8") -INDEX_TEMPLATE = jinja2.Template( - """\ +INDEX_TEMPLATE = jinja2.Template("""\ --- menu_weight: 180 --- @@ -217,8 +207,7 @@ def append_source_blocks(content: bytes) -> bytes: + {{ item.short_description | replace("\n\n", "\n+\n") }} {% endfor %} -""" -) +""") def build_index_doc(configs: list[ExampleDocBuildConfig]) -> bytes: