Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
27 changes: 8 additions & 19 deletions support/build-doc-bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
---
Expand All @@ -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:
Expand Down
Loading