-
Notifications
You must be signed in to change notification settings - Fork 55
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
docs: combine CLI reference pages into a single page #530
Conversation
@IronCore864, @benhoyt this is a draft PR so that you can follow along with progress of creating a single CLI reference page. WIP page here: https://canonical-pebble--530.com.readthedocs.build/en/530/reference/cli-commands-wip/ The WIP page wasn't generated from the script. I'll update the script when we're happy with the structure of the page A couple of things to note on the WIP page:
My next actions:
|
Done:
New CLI reference page: https://canonical-pebble--530.com.readthedocs.build/en/530/reference/cli-commands/ The docs check is failing because I haven't updated the CI script yet Next actions:
|
The current preview looks good in general. 3 small things bother me:
|
I wasn't sure about that. But I do quite like the logical grouping. However, I think the alpha grouping is useful in the page itself and in the right-hand ToC. So I suggest keeping as is but maybe making explicit what's going on. For example, at the top, say "The pebble command has the following subcommands, ordered by logical group:" and then below that, "Below are the commands ordered alphabetically:"
I disagree here. I think the right-hand ToC is quite nice. You can either Ctrl-F or use the ToC. And it's consistent with other long Canonical docs pages.
I agree with this -- let's drop the "Examples" and "How it works" level. |
+1 for dropping the "Examples" and "How it works" level from the right-hand TOC. I'll work on that now For the command listing at the top - I'll make it clearer what's going on. I also propose dropping the code font from these links. It's not ambiguous that these are the command names, and the uniform sea of code font makes it harder to parse quickly |
FYI, I think this script might need some refactoring because we removed those separate pages, see this error here. |
Yep I'll update that as part of this PR too - thanks! |
I've updated the generator script to account for the new format & location of the CLI reference. Previously the script created .md files for commands that didn't have .md files. Now that the commands are in a single .md file, I've removed this functionality (which let me simplify the script quite a bit). If we release a new command in the future, we'll need to manually add a corresponding section in /docs/reference/cli-commands.md. Next actions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise this is only a draft, but I had a quick look. Nice work! The CLI command reference has only been around for a few months, so I'm not worried about breaking those links -- probably not worth the time trade-off.
docs/generate_command_docs.py
Outdated
logger.info("Processing doc for command %s.", cmd) | ||
markers = Markers(cmd) | ||
if markers.start not in text: | ||
logger.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this an exception now? I'm concerned that if we add a new Pebble command and run this, it'll just log something, whereas that should probably be a hard failure so we don't forget to add it.
Or, better, the script should add it to the right place (though that might be a bit more work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Having the script adding a missing command is going to be complex, because it would also need adding to the logical grouping of commands if we wanted to fully automate. I don't think it's worth the effort really - and this is surely going to be a rare situation
I'd rather break the build if there's a command missing from the doc. I'll change the script so that we raise an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that sounds fine to me for now -- thanks.
That's fair - I'll spend a few minutes to understand the redirect mechanism, then stop if it's going to be a lot of work to set up |
…o cause test to fail)
All changes are done. I can't find a convenient way to add command-level redirects in the code, so we'll leave this out Thank you very much @IronCore864 & @benhoyt for your advice and reviews! |
The purpose of this PR is to combine the pages under https://canonical-pebble.readthedocs-hosted.com/en/latest/reference/cli-commands/cli-commands/ into a single page