Skip to content

docs: write example reports under output/ so they stay untracked - #981

Merged
tschm merged 1 commit into
mainfrom
docs/report-output-dir
Sep 8, 2026
Merged

tschm merged 1 commit into
mainfrom
docs/report-output-dir

Conversation

@tschm

@tschm tschm commented Sep 8, 2026

Copy link
Copy Markdown
Member

Why

Following the README quickstart leaves a stray untracked report.html at the repo root. That was noticed before and fixed by adding the file to .gitignore in 909bb71 — but .gitignore is rhiza-managed (.rhiza/template.lock:31), and the v1.3.0 sync (7152802) deleted the line again. Any local .gitignore fix has the same fate.

What

Point the doc examples at output/ instead. The template .gitignore already ignores it (line 8, "HTML outputs from docstring examples"), and src/jquantstats/_reports/_portfolio.py:201 and book/shots/generate.py:209 already write there. No template-owned file is touched, so a sync cannot undo this.

File Change
README.md:331 collapsed to pf.report.to_html(path="output/report.html")
docs/getting_started.md:196 same
docs/gallery.md:232 explicit write kept, gains mkdir(parents=True, exist_ok=True)
docs/MIGRATION.md:355 path string only

docs/index.md is --8<-- "README.md", so the landing page follows automatically.

For the Portfolio route to_html(path=...) creates the parent directory itself (_portfolio.py:331), so no mkdir is needed. data.reports.full() only returns a str, which is why the gallery example keeps a manual write.

Verified

Ran the rewritten README example in an empty directory: output/ was created and a 101 KB report written. Docs-only otherwise — no doc code blocks are executed by the suite (no doctest/mktestdocs/markdown-exec configured).

Not in scope

docs/paper/jquantstats.tex:785 writes strategy_report.html to the cwd. It is a published paper, so I left it alone — say the word if you want it aligned.

🤖 Generated with Claude Code

The quickstart examples wrote report.html into the working directory, so
anyone following the README ends up with a stray untracked file at the repo
root. `report.html` was added to .gitignore once for exactly this reason
(909bb71), but .gitignore is rhiza-managed and the v1.3.0 sync (7152802)
removed the line again.

Point the examples at output/ instead, which the template .gitignore already
ignores for docstring-example artefacts, and which `_reports/_portfolio.py`
and `book/shots/generate.py` already use. No managed file is touched, so a
sync cannot undo it.

For the Portfolio route this collapses to `to_html(path=...)`, which mkdirs
the parent itself; `data.reports.full()` only returns a str, so the gallery
example keeps an explicit write and gains the mkdir.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tschm
tschm merged commit 5a33e2e into main Sep 8, 2026
47 checks passed
@tschm
tschm deleted the docs/report-output-dir branch September 8, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant