Systematize builtins.fetchTree docs#9732
Conversation
|
This seems more productive than what I've been up to with a self-documenting codec abstraction, which may be too ambitious for something in C++. |
7c5e178 to
23476d8
Compare
cc8c940 to
a330689
Compare
|
OK @roberth @fricklerhandwerk @infinisil the infra here is now set up! Not sure whether we want to
|
builtins.fetchTree docsbuiltins.fetchTree docs
80aae23 to
d4e9043
Compare
|
I vote to merge as is, and agree it's a useful step forward. But I sigh loudly as well because it's adding notable tech debt. Now we have 5 (!) mechanisms for producing documentation:
Especially the additional document composition code path makes it substantially more messy. The ideal end state for me would be documentation living exclusively in C++ headers (with plain markdown files for optional free-form blurbs) and processing structured output – templating and such – happening exclusively in the Nix language, decoupled from building the all of Nix. Currently it's hacks on top of hacks and it takes forever to compile. |
|
I agree there are too many. I would like to replace the stuff we do with the interpreter inside Nix with this method, because then it will work with the store-only Nix. |
That would make it a lot harder to contribute to for most people, and I don't see why docs can't be built by a full Nix as a separate step, but let's discuss it somewhere else. |
|
Discussed during the maintainers meeting today. Deferred for the time being Details
Decision: Defer until commonmark/cmark#362 (comment) gets an answer. The the plan is to
|
Personally I want to state that such style of documentation for CLI tools is worst-case - it is neither man nor help, you're forcing user to pipe output to pager and leaving out man convetions (no one interested in following them because "help files" is written in Markdown, and typical markdown user is rarely even avare of existence of manual pages, and their conventions). Not to mention that you're forcing user to execute your command in order to get help (rather than "viewing static files" with man). (From here: commonmark/cmark#362). |
22112c1 to
f66a761
Compare
c374264 to
35f7e40
Compare
35f7e40 to
d3a64f4
Compare
This makes the output easier to compare with the new machine-generated lists in #9732. The hand-curated order did have the advantage of putting more important attributes at the top, but I don't think it is worth preserving that when `std::map` is so much easier to work with. The right solution to leading the reader to the more important attributes is to call them out in the intro texts.
d3a64f4 to
8fb8329
Compare
|
OK. With the aid of #14545 (which we should land first), I hand-diffed the |
|
🎉 All dependencies have been resolved ! |
541b0d6 to
73f9e39
Compare
73f9e39 to
594acd7
Compare
|
|
||
| std::string schemeDescription() const override | ||
| { | ||
| return stripIndentation(R"( |
There was a problem hiding this comment.
Maybe we can drop stripIndentation() here and have the caller do that?
There was a problem hiding this comment.
I would rather not do that because we have both the doc builder caller, and the main.cc caller that dumps the machine-readable JSON info.
And also render the docs nicely. I would like to use a markdown AST for this, but to avoid new deps (lowdown's AST doesn't suffice) I am just doing crude string manipulations for now.
594acd7 to
bae1ca2
Compare
Motivation
Render the docs nicely.
Context
I would like to use a markdown AST for this, but to avoid new deps (lowdown's AST doesn't suffice) I am just doing crude string manipulations for now.
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.