canonical / open-documentation-academy

Learn open-source software documentation skills with Canonical
https://canonical.com/documentation
Apache License 2.0
48 stars 28 forks source link

Netplan: Create snippet files for single-sourcing repetitive instructions #107

Open rkratky opened 1 week ago

rkratky commented 1 week ago

Context

Three of the how-to guides for Netplan feature very similar scenarios, and all of them include certain instructions that are completely the same. In order to simplify maintenance and to ensure consistency, the instructions should be single-sourced from common source. This requires creating a separate file (or files) with these instruction snippets and including them in the how-tos. These are the how-tos:

Task

  1. Identify substantial parts of the how-tos that are exactly the same (always at least a section -- not just individual instruction steps or other small parts) and create a separate (.md) files from them. The content needs to be repeated in at least two of the how-tos (if in three, even better).

  2. Remove the respective parts from the how-tos and substitute them for include statements that will render the snippets in those places. See Embed & Include Content for instructions on how to do that in Markdown using the MyST extension.

Reference