Skip to content

Ai manpage - #4899

Open
bdbaddog wants to merge 5 commits into
SCons:masterfrom
bdbaddog:ai_manpage
Open

Ai manpage#4899
bdbaddog wants to merge 5 commits into
SCons:masterfrom
bdbaddog:ai_manpage

Conversation

@bdbaddog

@bdbaddog bdbaddog commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Added bin/scons-man-to-ai.py which translates the xml manpage into a minimized markdown file suitable for AI to use. (reduces from 230k (scons.1) or 337k (scons-man.html) to 113k tokens with scons-ai.md

Should this be built and checked into doc/man/scons-ai.md, or only built into build/doc/MD/scons-ai.md?

In the process of this work, found that there were a few variablelist's inside para's where there was nothing else in the para's so simplified those, to also simplify the markdown generation script

(Built with Claude Opus 5)

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

bdbaddog and others added 3 commits August 30, 2026 21:14
The scons(1) man page is too large for a language model to read in full:
the roff scons.1 is roughly 230k tokens and the generated HTML about 337k.
Add doc/man/scons-ai.md, a condensed Markdown reference of roughly 113k
tokens - about half the roff man page - which keeps every documented entry
(each option, tool, builder, function, construction variable, configure
context method and node attribute, with its description) but drops markup,
cross-reference chrome, code examples, Note blocks and version history.

The generator, bin/scons-man-to-ai.py, reads the checked-in DocBook source
doc/man/scons.xml rather than built documentation, so it needs no doc build
and works from a clean checkout. It resolves the parameter entities and
XIncludes that supply the bulk of the content, which requires lxml (already
a development dependency). The generated man page HTML is also accepted via
--input for comparison against the documentation toolchain; both inputs
produce the same set of entries.

Wire it into doc/SConscript as the 'ai-manpage' alias, also reachable from
the 'doc' alias. Because it builds from checked-in sources it is generated
even when SKIP_DOC is set and the rest of the doc build is skipped.

Also unwrap two <variablelist> elements in the Decider documentation that
were nested inside a <para>. That nesting is schema-valid but is a 2-of-214
anomaly, and the DocBook XSL hoists the list out of the paragraph, leaving
four empty <p></p> elements in the rendered HTML man page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WZmNvpfrD52gbqknUecffc
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WZmNvpfrD52gbqknUecffc
Install the condensed AI manpage alongside the other rendered documentation
formats, matching the HTML/PDF/EPUB/TEXT layout, and include it in the
documentation tarball.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WZmNvpfrD52gbqknUecffc
@bdbaddog
bdbaddog requested a review from mwichmann August 31, 2026 04:45
@mwichmann

Copy link
Copy Markdown
Collaborator

Guess it's okay. Since the result isn't human-friendly, nor human-intended, it's hard to say much about it.

How would this be provided? you planning to put it in doc/man even though it's "generated"?

@bdbaddog

Copy link
Copy Markdown
Contributor Author

Guess it's okay. Since the result isn't human-friendly, nor human-intended, it's hard to say much about it.

How would this be provided? you planning to put it in doc/man even though it's "generated"?

not sure. the .gen files are under doc/generated.. if we put it there and then referenced it in our agents.md maybe?

@mwichmann

Copy link
Copy Markdown
Collaborator

Guess it's okay. Since the result isn't human-friendly, nor human-intended, it's hard to say much about it.
How would this be provided? you planning to put it in doc/man even though it's "generated"?

not sure. the .gen files are under doc/generated.. if we put it there and then referenced it in our agents.md maybe?

I'd say that makes sense.

bdbaddog and others added 2 commits September 5, 2026 17:04
Build the condensed AI manpage directly to build/doc/MD/scons-ai.md rather
than writing it into doc/man and installing a copy. It is generated output,
so it does not belong in the source tree; remove the checked-in copy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WZmNvpfrD52gbqknUecffc
Render scons-ai.md into doc/generated/scons-ai.md, matching the
checked-in doc/generated/*.gen and *.mod files, instead of writing
directly into the build tree. The build now installs a copy into
build/doc/MD alongside the other rendered formats. Mark the generated
file Precious/NoClean so 'scons -c' does not delete the checked-in copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xrv6wmE3cfEhYmsTiZpnsZ
@bdbaddog
bdbaddog marked this pull request as ready for review September 6, 2026 00:27
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