Skip to content

Documentation: structural improvements #1797

Closed
@cspotcode

Description

@cspotcode

I wanted to make a bunch of improvements to our docs. The resulting diff would have been way too big and overlapping to review in a single PR.

So I used "stacked PRs." A PR stack is a single chain of commits. This means each subset of code changes can be reviewed in isolation, but the end of the chain includes all code changes.

For reviewers

Do not merge any of these PRs! Only review!
It's a PR stack, so you will definitely break something if you click "merge" Please don't!

To see the end result of all these PRs combined:
https://api.arcade.academy/en/doc_structural_improvements/

To review a single PR, look at the description for that PR in the list below.

Quick list

All PRs, same as the ones linked in the list below:

PR Descriptions

PR: Fix website rendering #1856

  • fix readthedocs rendering by re-adding docs dependency group

PR: Sidebar #1863

PR: Docstring standards: Misc #1859

  • Replace all lingering "Attributes" tables with standard autodoc for attributes, properties, methods
    Already done, Convert tilemap attribute docs to docstrings which produce better autodocs #1785 was the last one(?)
  • show inheritance for all classes via :show-inheritance:
  • Add from __future__ import annotations to all files so that we can use | union syntax everywhere, forward references work without quoting
  • group members by type (method, attribute) then alphabetically
  • Disable "property" prefix on properties in the API docs, so they render identical to attributes. Reduces visual noise in docs

PR: UX Polish #1860

  • "Quick index" page: Collapse 3x tables into 1
    Currently, is 3x, but the split hurts rather than helps readers.
    Try using that page yourself, and see the kind of scrolling you need to do to understand what is shown. Not clear there are additional text boxes.
    • The arcade module (but also includes many other things: arcade.easing, arcade.geometry, arcade.isometric, arcade.math, etc)
    • The arcade.gui module
    • The arcade.tilemap module
  • Always show grey highlight behind signatures, makes the doc sections easier to visually navigate, removes need for redundant headers
  • Remove all those redundant headers from API doc pages
  • Hide ClassName. prefix from members in right-hand TOC navigation

PR: Sphinx infra: manual doc layout #1861

Empty PR! At first I created this PR, but then I decided not to do it; it's einarf's baby. I only mention it here in case anyone is confused why the PR exists. Yes, it's in the stack, no it does not have any code changes.

PR: Sphinx infra: no types in docstrings #1862

  • Remove all typehints from docstrings, convert to real typehints
    vanilla sphinx already renders typehints in signatures
  • [wont do] sphinx_autodoc_typehints can copy types into reST
  • Use cspotcode's config to strip -> None from __init__
    -> None in docs is wrong from the user's perspective, because calling a class returns an instance of the class, not None

PR: Docstring standards: Google-style #1858

This PR only enables the napoleon plugin, it does not rewrite any docstrings. I talked to pushfoo and we agreed he'll do the docstring changes in separate PRs.

PR: Sphinx infra: special method docs #1855


https://github.com/yoloseem/awesome-sphinxdoc

readthedocs render status: https://readthedocs.org/projects/arcade-library/builds

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions