Skip to content

Commit a6ae445

Browse files
committed
Use stable marker for placeholder verification
Check for <!-- PLACEHOLDER --> marker instead of full text, so the explanatory message can be updated without breaking verification.
1 parent 5a9c708 commit a6ae445

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ icon: lucide/git-pull-request
99
<!-- print(readme_section("contributing")) -->
1010
<!-- CODE:END -->
1111
<!-- OUTPUT:START -->
12-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
12+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1313
<!-- OUTPUT:END -->
1414

1515
## Development Setup

docs/docs_gen.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
_MODULE_DIR = Path(__file__).parent
2626
README_PATH = _MODULE_DIR.parent / "README.md"
2727

28-
# Placeholder comment for OUTPUT sections in docs templates
29-
# This must be present in committed docs files (not in README.md)
30-
# Explains our template strategy: output is generated at build time, not committed
28+
# Placeholder for OUTPUT sections in docs templates
29+
# The marker is checked by verify_placeholders() to ensure we don't commit generated content
30+
OUTPUT_PLACEHOLDER_MARKER = "<!-- PLACEHOLDER -->"
3131
OUTPUT_PLACEHOLDER = (
32-
"<!-- ⚠️ This output is generated during CI build. "
33-
"We intentionally don't commit generated content to keep docs copyable "
34-
"and avoid recursion issues. See docs/docs_gen.py for details. -->"
32+
f"{OUTPUT_PLACEHOLDER_MARKER} "
33+
"Output is generated during CI build. We don't commit generated content "
34+
"to keep docs copyable and avoid recursion. See docs/docs_gen.py"
3535
)
3636

3737

@@ -205,7 +205,7 @@ def verify_placeholders(file_path: Path) -> list[int]:
205205
in_output = False
206206
elif in_output:
207207
# Check if this is the placeholder line
208-
if OUTPUT_PLACEHOLDER in line:
208+
if OUTPUT_PLACEHOLDER_MARKER in line:
209209
continue
210210
# Allow empty lines
211211
if not line.strip():

docs/examples.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Real-world examples demonstrating the power and flexibility of `markdown-code-ru
1111
<!-- print(readme_section("examples")) -->
1212
<!-- CODE:END -->
1313
<!-- OUTPUT:START -->
14-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
14+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1515
<!-- OUTPUT:END -->
1616
```
1717
@@ -23,7 +23,7 @@ This is an example of a simple code block:
2323
<!-- print('Hello, world!') -->
2424
<!-- CODE:END -->
2525
<!-- OUTPUT:START -->
26-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
26+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
2727
<!-- OUTPUT:END -->
2828
```
2929

@@ -38,7 +38,7 @@ First code block:
3838
<!-- print('Hello, world!') -->
3939
<!-- CODE:END -->
4040
<!-- OUTPUT:START -->
41-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
41+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
4242
<!-- OUTPUT:END -->
4343
```
4444

@@ -50,7 +50,7 @@ Second code block:
5050
<!-- print('Hello again!') -->
5151
<!-- CODE:END -->
5252
<!-- OUTPUT:START -->
53-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
53+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
5454
<!-- OUTPUT:END -->
5555
```
5656

@@ -65,7 +65,7 @@ First code block:
6565
<!-- print('Hello, world!') -->
6666
<!-- CODE:END -->
6767
<!-- OUTPUT:START -->
68-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
68+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
6969
<!-- OUTPUT:END -->
7070

7171
Second code block:
@@ -74,7 +74,7 @@ Second code block:
7474
<!-- print('Hello again!') -->
7575
<!-- CODE:END -->
7676
<!-- OUTPUT:START -->
77-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
77+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
7878
<!-- OUTPUT:END -->
7979
```
8080

@@ -92,7 +92,7 @@ Second code block:
9292
<!-- print(content) -->
9393
<!-- CODE:END -->
9494
<!-- OUTPUT:START -->
95-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
95+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
9696
<!-- OUTPUT:END -->
9797
```
9898
Which is rendered as:

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This guide will help you install and start using `markdown-code-runner` in minut
1313
<!-- print(readme_section("installation")) -->
1414
<!-- CODE:END -->
1515
<!-- OUTPUT:START -->
16-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
16+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1717
<!-- OUTPUT:END -->
1818

1919
You can also install with `uv`:
@@ -35,7 +35,7 @@ uv tool install markdown-code-runner
3535
<!-- print(readme_section("quick-start")) -->
3636
<!-- CODE:END -->
3737
<!-- OUTPUT:START -->
38-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
38+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
3939
<!-- OUTPUT:END -->
4040

4141
## Next Steps

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ icon: lucide/play
1515
<!-- print(readme_section("intro")) -->
1616
<!-- CODE:END -->
1717
<!-- OUTPUT:START -->
18-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
18+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1919
<!-- OUTPUT:END -->
2020

2121
<div style="text-align: center; margin: 2rem 0;">
@@ -34,7 +34,7 @@ icon: lucide/play
3434
<!-- print(readme_section("features")) -->
3535
<!-- CODE:END -->
3636
<!-- OUTPUT:START -->
37-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
37+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
3838
<!-- OUTPUT:END -->
3939

4040
## Why Use Markdown Code Runner?
@@ -44,7 +44,7 @@ icon: lucide/play
4444
<!-- print(readme_section("problem-statement")) -->
4545
<!-- CODE:END -->
4646
<!-- OUTPUT:START -->
47-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
47+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
4848
<!-- OUTPUT:END -->
4949

5050
## Quick Example
@@ -93,5 +93,5 @@ Hello, world!
9393
<!-- print(readme_section("license")) -->
9494
<!-- CODE:END -->
9595
<!-- OUTPUT:START -->
96-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
96+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
9797
<!-- OUTPUT:END -->

docs/usage/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This will process the file in-place, executing all code blocks and updating the
2424
<!-- print("```") -->
2525
<!-- CODE:END -->
2626
<!-- OUTPUT:START -->
27-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
27+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
2828
<!-- OUTPUT:END -->
2929

3030
## Options

docs/usage/github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Automate your Markdown updates with CI/CD workflows.
1313
<!-- print(readme_section("github-actions")) -->
1414
<!-- CODE:END -->
1515
<!-- OUTPUT:START -->
16-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
16+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1717
<!-- OUTPUT:END -->
1818

1919
## Workflow Breakdown

docs/usage/python-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ icon: lucide/code
99
<!-- print(readme_section("python-api")) -->
1010
<!-- CODE:END -->
1111
<!-- OUTPUT:START -->
12-
<!-- ⚠️ This output is generated during CI build. We intentionally don't commit generated content to keep docs copyable and avoid recursion issues. See docs/docs_gen.py for details. -->
12+
<!-- PLACEHOLDER --> Output is generated during CI build. We don't commit generated content to keep docs copyable and avoid recursion. See docs/docs_gen.py
1313
<!-- OUTPUT:END -->
1414

1515
## Function Reference

0 commit comments

Comments
 (0)