Skip to content

Conversation

@rickeylev
Copy link
Collaborator

@rickeylev rickeylev commented Oct 17, 2024

This switches the doc generation over to use rules_python's sphinxdocs. Sphinxdocs
is a set of rules for running Sphinx with special integrations for Starlark
doc generation and Read the Docs

Summary of changes:

  • Consolidate everything into docs/ (delete docgen, docs/source)
  • Use Sphinx {role}ref syntax instead of regular Markdown link syntax.
  • Add typedef markers
  • Remove # titles and/or replace them with {topic}. The # headers interfere
    with the TOC rendering.
  • Use Bazel 6 instead of Bazel 5 with CI

The main benefits of this switch are:

  • Sphinx is entirely run through Bazel (instead of a bespoke shell script
    to glue together outputs of Bazel invocations)
  • Sphinxdocs comes with a Sphinx plugin that allows defining Starlark objects
    as first-class objects to Sphinx. These are usually generated by the Stardoc
    integration, but can also be manually defined to document e.g. targets or flags.
  • Sphinxdocs supports defining "typedefs", which is a way to group a collection of
    objects and have them rendered similar to how a class is rendered in other languages.
    Part of what this change does is update all the subject "classes" to render as
    "typedefs".
  • Cross references are easier and more automatic. Because Sphinx understands the
    objects being defined, cross references have a more natural, concise, and expressive
    notation.
  • Sphinxdocs has helpers for interactively running docs for easier edit/run cycles
  • Sphinxdocs has helpers for using Bazel to build the docs as part of readthedocs
    workflows (this ensures what is built locally matches what is built by RTD).

@rickeylev rickeylev force-pushed the sphinxdocs branch 14 times, most recently from bfa18f9 to b65f21a Compare October 22, 2024 22:24
@rickeylev rickeylev force-pushed the sphinxdocs branch 4 times, most recently from a4f3e53 to ce1110c Compare October 26, 2024 19:48
@rickeylev rickeylev marked this pull request as ready for review October 26, 2024 20:03
@rickeylev rickeylev requested a review from comius as a code owner October 26, 2024 20:03
@rickeylev rickeylev added the ready to pull Required label for automatic import to Google label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull Required label for automatic import to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant