Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A script to generate options reference pages for the docsite. #10387

Merged
merged 6 commits into from Jul 17, 2020

Conversation

benjyw
Copy link
Sponsor Contributor

@benjyw benjyw commented Jul 16, 2020

  • Uses mustache templates (plus some light munging in python) to
    generate the content.
  • The script can sync the pages to the docsite, or just render
    them locally, for ease of iteration and debugging.

Makes some small changes/refactors to the help info extracter,
to support the markdown/HTML generation.

Removes a docstring line in external_tool.py that contained
< > characters that rendered as >/< in the markdown.

[ci skip-rust-tests]

@benjyw
Copy link
Sponsor Contributor Author

benjyw commented Jul 16, 2020

See the result on the live docsite: https://www.pantsbuild.org/v2.0/docs/

@benjyw
Copy link
Sponsor Contributor Author

benjyw commented Jul 16, 2020

Screenshot 2020-07-16 16 59 45

- Uses mustache templates (plus some light munging in python) to
  generate the content.
- The script can sync the pages to the docsite, or just render
  them locally, for ease of iteration and debugging.

Makes some small changes/refactors to the help info extracter,
to support the markdown/HTML generation.

Removes a docstring line in external_tool.py that contained
< > characters that rendered as &gt;/&lt; in the markdown.

[ci skip-rust-tests]
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent!

build-support/bin/BUILD Outdated Show resolved Hide resolved
build-support/bin/generate_docs.py Outdated Show resolved Hide resolved
build-support/bin/generate_docs.py Outdated Show resolved Hide resolved
build-support/bin/generate_docs.py Show resolved Hide resolved
build-support/bin/generate_docs.py Outdated Show resolved Hide resolved
build-support/bin/generate_docs.py Outdated Show resolved Hide resolved
[ci skip-rust-tests]
# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
@stuhood
Copy link
Sponsor Member

stuhood commented Jul 17, 2020

So, readme's search is much, much better than our old search. But I still sortof wonder whether we should inline all related options into each goal's page so that you can truly see "all options that matter to test" at a glance. Ironically, a downside might be that it would make search results worse.

@Eric-Arellano
Copy link
Contributor

So, readme's search is much, much better than our old search. But I still sortof wonder whether we should inline all related options into each goal's page so that you can truly see "all options that matter to test" at a glance. Ironically, a downside might be that it would make search results worse.

I don't think so. Having related subsystems is already awesome. There isn't much benefit imo to inlining the related subsystem options, other than saving a click. The downsides are a) worse search, and b) much larger pages, which are less performant and imo a little overwhelming to look at.

@stuhood
Copy link
Sponsor Member

stuhood commented Jul 17, 2020

There isn't much benefit imo to inlining the related subsystem options, other than saving a click.

The benefit (afaict) is that when you want to figure out "how do I enable XML for the test goal", find in page on the test goal page will tell you that. Otherwise, you have to do a global site search for XML, and potentially find a bunch of matches that aren't related to test running at all. You would then manually filter those matches to figure out which of them are transitively used by test, maybe.

The same goes for the CLI I think (./pants help-advanced test should give you at least a hint of the names of options that might be relevant), but moreso because we don't have search there.


One option would be to inline a super abbreviated version with links to the actual help pages maybe...

Basic options
--[no-]test-debug
default: False
Run a single test target in an interactive process. This is necessary, for example, when you add breakpoints to your code.

<snip>

Related subsystem options

pytest
  --pytest-junit-xml-dir
  --pytest-timeout-default

... where each related subsystem option was a link to the page.

@benjyw
Copy link
Sponsor Contributor Author

benjyw commented Jul 17, 2020

Going to merge this, as we can and will modify the page content in any number of followups...

@benjyw benjyw merged commit 6b6a1dd into pantsbuild:master Jul 17, 2020
@benjyw benjyw deleted the docgen2 branch July 17, 2020 23:16
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.

None yet

3 participants