Help model: roff (man-page) backend (#154) - #377
Merged
Conversation
Completes the backend trio (plain / markdown / roff) over help_model: RoffBackend renders a Document to man-page source - .TH/.SH/.SS structure, upper-cased section headings, .TP entries, code/strong -> \fB, emphasis -> \fI, SEE ALSO -> .BR, and the RoffEscape() escaper (hyphens, backslashes, leading control chars). The model counterpart of manpage.cc's RoffRenderer. Additive: --man still uses the DocRenderer walk. Note the port will not be byte-identical - BuildReference() parses backticks in entry details, which the old RoffRenderer emitted literally, so the ported man page renders those as bold (an improvement). Wiring --man/--markdown/--help onto the model therefore regenerates XFF.md + the man golden, which is the next slice (gated on the output-format decision).
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.
Adds
RoffBackendover thehelp_modelAST, completing the backend trio (plain / markdown / roff).Renders a Document to man-page source:
.TH/.SH/.SSstructure, upper-cased section headings (man convention),.TPentries, inline code/strong ->\fB, emphasis ->\fI, SEE ALSO ->.BR name (sec), plus theRoffEscape()escaper (hyphens, backslashes, leading./'control chars). The model counterpart ofmanpage.cc'sRoffRenderer.Additive -
--manstill renders through theDocRendererwalk. Note: the eventual--manport will not be byte-identical, becauseBuildReference()parses backticks in entry details (the old renderer emitted them literally), so those become bold - an improvement. Wiring the CLI onto the model therefore regeneratesXFF.md+ the man golden; that's the next slice, gated on the output-format decision.bazel test //xff/cli:roff_backend_testpasses.