[wpt-sync] Sync PR 16851 - [docs] Automatically generate CLI documentation
Categories
(Testing :: web-platform-tests, defect, P4)
Tracking
(firefox69 fixed)
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync upstream error])
Sync web-platform-tests PR 16851 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/16851
Details from upstream follow.
Mike Pennisi <mike@mikepennisi.com> wrote:
[docs] Automatically generate CLI documentation
Command-line usage information was previously only available to users
who had successfully installed wptrunner. Consuming the information in
that form (e.g. navigating between sub-commands, scrolling through pages
of content and searching for keywords) also required some proficiency
with the command-line.Extend the documentation build process to include this information in
the project website. This makes it easier to consume for those with
limited experience using the command-line, and in particular, it adds
the content to the data indexed by the website's "search" feature.Because this content is generated from the state of the interface, it
avoids the need to maintain documentation separately.This is implemented via a new code path that eagerly load wptrunner's
complete command-line interface. The newcreate_complete_parseris
consumed by thesphinx-argparsemodule to produce the rendered
documentation.
Previously discussed in https://github.com/bocoup/wpt-docs/pull/12
The wptrunner CLI is built lazily based on the subcommand being executed. Even then, the task of argument parsing is split across unrelated
argparseinstances. These two details resist documentation generation (at least in the terms expected by thesphinx-argparsemodule).Facilitating this work required an artificial code path. I'm sensitive to creating branches that aren't used by contributors, but given the small size of the new function, I think the documentation may be valuable enough to justify the maintenance burden.
Here's what the new page looks like:
Like any other content on the Sphinx-powered site, it is indexed by the client-side "search" feature.
And the user's query is highlighted on the page itself
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 2•7 years ago
|
||
Comment 4•6 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•6 years ago
|
Description
•