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

Add examples as separate pages #5645

Merged
merged 20 commits into from
Oct 16, 2024
Merged

Conversation

s-makin
Copy link
Contributor

@s-makin s-makin commented Aug 30, 2024

Proposed Commit Message

docs: split example page into example library

*What does it do?*
Create a single library of yaml examples. There are currently
examples in three places:
- the modules page
- doc/examples
- the yaml examples page

Here I collect ALL existing examples into a single "example library".
The yaml examples page is now a landing page/directory.

* Examples grouped (roughly) by operation or function.
* Standardised formatting across pages.
* Links to relevant module(s) included on all pages.
* Comments extracted from yaml files for better formatting.

Note: not all examples have descriptive titles or explanations
(yet). To be addressed in future work.

*Why is this done?*
* Improved module discoverability/usability for newer users.
* Streamlining.
  - We can now remove examples from the modules page, instead linking to
    relevant examples in the library. We can then remove tabs on the module
    page, to facilitate use of ctrl+f searching for long-time users.
  - We can remove the examples from `doc/examples`, so that examples are
    all in a single place. 

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@github-actions github-actions bot added the documentation This Pull Request changes documentation label Aug 30, 2024
@TheRealFalcon TheRealFalcon self-assigned this Sep 9, 2024
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Overall, this is a really good change. I left comments inline.

Beyond those I do have a few other concerns.

  1. While I think we're certainly aiding "browseability" here, I do wonder if we're harming "findability". If I already have an idea of what I'm looking for, rather than searching through a big examples page, I would now need to find the right section heading and hope something I might be looking for lives under the right page, and if not, I might have to do a lot of clicking around.
  2. The modules examples vs the dedicated examples page served different purposes in my mind. The modules examples were about a basic "here's how to use some of relevant keys in isolation", whereas the examples page was more about "here's how to accomplish a larger common goal". Even though there was a large amount of overlap between the two, I worry that having modules linking to the examples library might diminish the simple and isolated use case over time...and now that I think of it, some of my suggestions in the inline comments to combine pages might not work if we need to link to them from different modules.

Neither of these concerns are blockers, but I do think they are things we should keep thinking about as our documentation evolves.

doc/rtd/explanation/about-cloud-config.rst Outdated Show resolved Hide resolved
doc/rtd/explanation/about-cloud-config.rst Outdated Show resolved Hide resolved
doc/rtd/explanation/about-cloud-config.rst Outdated Show resolved Hide resolved
doc/rtd/explanation/about-cloud-config.rst Outdated Show resolved Hide resolved
doc/rtd/explanation/about-cloud-config.rst Outdated Show resolved Hide resolved
doc/rtd/reference/yaml_examples/apt.rst Outdated Show resolved Hide resolved
doc/rtd/reference/yaml_examples/archive.rst Outdated Show resolved Hide resolved
doc/rtd/reference/yaml_examples/archive_launch_index.rst Outdated Show resolved Hide resolved
@s-makin
Copy link
Contributor Author

s-makin commented Sep 20, 2024

Overall, this is a really good change. I left comments inline.

Thanks for the thorough review James, and sorry again for the size of the change. I think both of the concerns you raise are totally valid.

One thing we could do to address the first one is to make this transition in two stages - leave the original examples page in-situ, and add this "library" separately (instead of replacing the one with the other). In that way, we can track how they are used over time and give users time to adjust. It will look a bit weird as a setup to anyone driving past, but would allow us to gauge whether the library is an improvement.

The examples shown on the modules page haven't changed - and the same examples are also in the examples library (i.e., duplicated from the same yaml source files, following the module generation overhaul). It's not necessary for us to remove the module page examples, but since there have been some concerns raised about the tab setup we currently have making it hard to ctrl+f through the content it is something I've been thinking about how to solve. I think we could; 1) remove the examples from the module page and instead provide links to all relevant examples in the library, 2) keep the examples on the module page but also provide links to the examples library or 3) keep the content of the module page exactly as it is (with no added links), but rethink the presentation. Currently I'm leaning towards the third option - in my mind the module page and library serve two distinct use cases, rather than being cross-supporting. The library is intended to help newer users to discover what modules they should be looking at according to the task they want to accomplish (which is why I linked to the modules from the library but not vice versa). More experienced users already know how to find what they're looking for.

Sorry for the tl:dr lol, let me know what you think

Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Way fewer comments this time 😃

One thing we could do to address the first one is to make this transition in two stages - leave the original examples page in-situ, and add this "library" separately (instead of replacing the one with the other). In that way, we can track how they are used over time and give users time to adjust. It will look a bit weird as a setup to anyone driving past, but would allow us to gauge whether the library is an improvement.

This sounds good to me.

  1. keep the content of the module page exactly as it is (with no added links), but rethink the presentation. Currently I'm leaning towards the third option - in my mind the module page and library serve two distinct use cases, rather than being cross-supporting. The library is intended to help newer users to discover what modules they should be looking at according to the task they want to accomplish (which is why I linked to the modules from the library but not vice versa). More experienced users already know how to find what they're looking for.

This also sounds good to me.

Run vendor scripts
******************

Scripts can be run by cloud-init by ensuring that the scripts are placed in
Copy link
Member

Choose a reason for hiding this comment

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

This explanation isn't entirely accurate. Vendors can't really directly place scripts in the vendor directory, and if they do, the user data keys mentioned here won't prevent them from running. I think this should be something more along the lines of

Control vendor data usage
***********************

Execution of [vendor data](link to our vendor data explanation page) may be controlled by the user. It may be disabled or executed with an optional prefix.

For a full list of keys...

Examples
...

and just FYI, I also filed #5765

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted - I've changed this to adopt your suggestion (albeit with some rewording to avoid use of the word "execute").

doc/rtd/reference/yaml_examples/index_security.rst Outdated Show resolved Hide resolved
doc/rtd/reference/yaml_examples/snap.rst Show resolved Hide resolved
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM!

@TheRealFalcon TheRealFalcon merged commit 5819c94 into canonical:main Oct 16, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This Pull Request changes documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants