Skip to content

daslib/rst_comment: add --detail_output flag for non-default doc trees#2640

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/rst-comment-detail-output
May 13, 2026
Merged

daslib/rst_comment: add --detail_output flag for non-default doc trees#2640
borisbat merged 1 commit into
masterfrom
bbatkin/rst-comment-detail-output

Conversation

@borisbat
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new optional --detail_output Y CLI flag to daslib/rst_comment.das's comment reader. When set, per-function //! detail snippets are written to Y/detail/ instead of get_das_root() + /doc/source/stdlib/generated/detail/.
  • Lets a downstream consumer that vendors the daslang RST tooling (e.g. dasImgui's utils/imgui2rst.das, dasimgui-game's doc build) route detail snippets at its own topic_root. Set topic_root = Y and --detail_output Y; reads at {topic_root}/detail/... and writes at Y/detail/ line up cleanly — no /index/ segment required.
  • Existing --docs_output X (which appends /index/detail/, load-bearing for Eden / dasimgui-game style invocations that pair --docs_output X with topic_root = X/index) is unchanged.
  • Default behavior (no flag) is byte-identical to before. daslang's own das2rst doesn't pass either flag, so the daslang doc build is unaffected.

Test plan

  • Local daslang build + daslang's own das2rst regenerates doc/source/stdlib/generated/detail/ to the same content as master (no diff in tracked detail files for daslang's own doc tree).
  • dasImgui's utils/imgui2rst.das -- --detail_output modules/dasImgui/doc/source/stdlib/generated lands per-function details in the correct dasImgui-side tree; sphinx-build -W on the dasImgui doc tree builds clean with no broken substitutions.
  • CI green (doc.yml + pages.yml + build matrix).

Notes for review

  • One-file change, ~7 lines added in daslib/rst_comment.das write_to_detail method.
  • The flag is consumer-facing only; no internal call sites in daslang need updating.
  • Will unblock the dasImgui Phase 6 documentation site (separate downstream change in borisbat/dasImgui).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 13, 2026 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a consumer-facing CLI option to the rst_comment comment reader so downstream projects can redirect where per-symbol detail/*.rst snippets are written, without changing the default daslang doc build behavior.

Changes:

  • Add --detail_output Y flag to write detail snippets to Y/detail/.
  • Keep existing --docs_output X behavior (X/index/detail/) as a fallback when the new flag is not present.
  • Preserve the default output location when neither flag is provided.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread daslib/rst_comment.das
Lets a consumer (e.g. dasImgui's utils/imgui2rst.das, or any other
project that vendors daslang's RST tooling) redirect the per-function
detail snippets at a custom location matching its own topic_root.

`--detail_output Y` writes per-symbol details to `Y/detail/`, matching
the natural read path `{topic_root}/detail/...` so the consumer can
set `topic_root = Y` and have writes and reads line up without the
existing `--docs_output X` flag's `/index/` segment (which is
load-bearing for the Eden / dasimgui-game style invocation pattern
that pairs `--docs_output X` with `topic_root = X/index`).

Default behavior (no flag) and `--docs_output` semantics are
unchanged. daslang's own das2rst doesn't pass either flag, so the
default daslang doc build is byte-identical.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@borisbat borisbat force-pushed the bbatkin/rst-comment-detail-output branch from ff79ec1 to 85fffe0 Compare May 13, 2026 09:58
@borisbat borisbat merged commit f4f6659 into master May 13, 2026
28 checks passed
@borisbat borisbat deleted the bbatkin/rst-comment-detail-output branch May 14, 2026 15:59
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.

2 participants