Skip to content

Commit d451c44

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d8f47f2 commit d451c44

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

support/build-doc-bundle.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,31 +137,24 @@ def render_example_index_doc(
137137
def prepend_preamble(
138138
config: ExampleDocBuildConfig, ide_link: str | None, content: bytes
139139
) -> bytes:
140-
preamble = textwrap.dedent(
141-
f"""\
140+
preamble = textwrap.dedent(f"""\
142141
---
143142
menu_weight: {config.menu_weight}
144143
---
145144
146-
"""
147-
)
145+
""")
148146

149147
if ide_link is not None:
150-
preamble += textwrap.dedent(
151-
f"""
148+
preamble += textwrap.dedent(f"""
152149
:flows_ide_link: {ide_link}
153150
154-
"""
155-
)
151+
""")
156152

157153
return preamble.encode("utf-8") + content
158154

159155

160156
def append_source_blocks(content: bytes) -> bytes:
161-
return (
162-
content
163-
+ textwrap.dedent(
164-
"""
157+
return content + textwrap.dedent("""
165158
== Source code
166159
167160
[.accordionize]
@@ -199,13 +192,10 @@ def append_source_blocks(content: bytes) -> bytes:
199192
----
200193
====
201194
--
202-
"""
203-
).encode("utf-8")
204-
)
195+
""").encode("utf-8")
205196

206197

207-
INDEX_TEMPLATE = jinja2.Template(
208-
"""\
198+
INDEX_TEMPLATE = jinja2.Template("""\
209199
---
210200
menu_weight: 180
211201
---
@@ -217,8 +207,7 @@ def append_source_blocks(content: bytes) -> bytes:
217207
+
218208
{{ item.short_description | replace("\n\n", "\n+\n") }}
219209
{% endfor %}
220-
"""
221-
)
210+
""")
222211

223212

224213
def build_index_doc(configs: list[ExampleDocBuildConfig]) -> bytes:

0 commit comments

Comments
 (0)