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

feat: add basic sphinx docs #1711

Merged
merged 16 commits into from
Jul 2, 2024
Merged

feat: add basic sphinx docs #1711

merged 16 commits into from
Jul 2, 2024

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Jun 26, 2024

Adds a Sphinx documentation project and some basic documentation. The purpose is to allow automatic generation of certain reference documentation that would otherwise need to be manually generated for juju.is.

This includes using the Starcraft standard starbase sphinx docs, A command documentation generator from rockcraft, and additions to some pydantic models to copy documentation out of what's on juju.is.

Fixes #1692

@lengau lengau marked this pull request as ready for review June 28, 2024 15:18
@lengau lengau requested review from tigarmo and mr-cal June 28, 2024 15:19
docs/_static/css/custom.css Outdated Show resolved Hide resolved
docs/conf.py Show resolved Hide resolved
docs/conf.py Show resolved Hide resolved
docs/explanation/index.rst Outdated Show resolved Hide resolved
docs/howto/index.rst Outdated Show resolved Hide resolved
docs/index.rst Show resolved Hide resolved
docs/reference/commands.rst Outdated Show resolved Hide resolved
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mostly copied this from rockcraft

tox.ini Show resolved Hide resolved
Copy link
Contributor

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

great!

tools/gen_cli_docs.py Show resolved Hide resolved
Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Overall looks good but I found some minor bugs.

The nav bar is rendering with SDK docs in a odd way:
image

Should "ask on discourse" in the footer link to charmhub's discourse forum?
image

runner = ignore_env_name_mismatch
source_dir = {tox_root}/{project_name}

[testenv:build-docs]
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the CI for this PR, this reminds me of something I did in Snapcraft that I haven't upstreamed: https://github.com/canonical/snapcraft/blob/676e391446225901b5a09cfbfb4d11c186ce752d/.github/workflows/tox.yaml#L42

The problem is that if a command's docstring contains invalid RST text, it won't get caught by lint-docs in CI. The biggest offender in Snapcraft was single backticks instead of double backticks.

Think it's worthwhile to upstream to starbase?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably worth it with a comment about why we're building them :-)

tools/gen_cli_docs.py Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Building the docs is giving me a few warnings, one of which is extensions-commands.rst not being included here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

:maxdepth: 2

commands
models/index
Copy link
Contributor

Choose a reason for hiding this comment

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

This link 404's for me from the nav bar

@lengau lengau requested a review from mr-cal June 28, 2024 20:25
@lengau lengau force-pushed the work/CRAFT-2981/sphinx branch from 677f28a to 6f32246 Compare June 28, 2024 20:37
Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Looks great!!

@lengau lengau merged commit b48ef73 into main Jul 2, 2024
16 of 17 checks passed
@lengau lengau deleted the work/CRAFT-2981/sphinx branch July 2, 2024 18:44
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.

Set up reference documentation with Sphinx
3 participants