Render @section blocks in function and @rdname Rd output#16
Merged
Conversation
@section was parsed into tags$sections but only emitted by the package Rd generator. For ordinary exported functions and @Rdname groups the section was silently dropped, so a documented invariant (e.g. corteza's subagent_spawn Permissions section) never reached the generated Rd. Add a render_sections() helper and call it from generate_rd() and generate_rd_grouped() (after \details, like roxygen2), gathering sections from every member of an @Rdname group. Refactor generate_package_rd() to use the same helper. Fixes #10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
@section Name:blocks were parsed intotags$sectionsbyparse_tags(), but onlygenerate_package_rd()emitted them. For ordinary exported functions and@rdnamegroups, the section was silently dropped, so?fnshowed nothing. This bitcorteza::subagent_spawn(), whose@section Permissions:block (documenting the no-mid-run-escalation invariant) never reached the Rd.Changes
render_sections()helper that emits\section{title}{content}per parsed section (content passed through as Rd, consistent with tinyrox's no-markdown stance).generate_rd()andgenerate_rd_grouped()(after\details, matching roxygen2 placement). The grouped path concatenates sections from every member of the@rdnamegroup.generate_package_rd()to use the same helper (no output change there).Tests
test_rd.R: parse → generate round-trip for a single section (the issue's exact repro), a multi-word title, multiple ordered sections, and a no-section negative check.test_rdname.R: sections gathered from all members of an@rdnamegroup.Verified end-to-end on the issue's repro: generated Rd contains
\section{Permissions}{...}and parses clean viatools::parse_Rd(). Full suite: 173 pass, 0 fail.