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

Review documentation of individual plugins #2657

Open
happz opened this issue Jan 30, 2024 · 0 comments
Open

Review documentation of individual plugins #2657

happz opened this issue Jan 30, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@happz
Copy link
Collaborator

happz commented Jan 30, 2024

Rules

General ones

  • design the docstrings and help texts as if they are destined to be rendered by Sphinx, i.e. make use of ReST goodies: literals for literals - metavars, values, envvar names, commands, keys, etc., code-block for blocks of code or examples. It leads to better HTML docs and we will have a nice CLI renderer as well, there is no need to compromise for the sake of CLI.
  • use full sentences, i.e. capital letters at the beginning & a full stop at the end.
  • use Python's multiline strings rather than joining multiple strings.

Plugin docs

  • plugin docstring provides the bulk of its CLI help and HTML documentation. It should describe what the plugin does.
  • less than trivial use cases and keys deserve an example or two.
  • unless there's an important difference, describe the plugin's configuration in terms of fmf rather than CLI. It's easy to map fmf to CLI options, fmf makes a better example for someone writing fmf files.

Plugin fields

  • when referring to fields in user-facing docs, speak about "keys", i.e. "playbook key of prepare/ansible plugin". Keys are mapped 1:1 to CLI options, but let's make sure we avoid "fields", "settings" and other synonyms.
  • metavar should represent the semantic of the expected value, i.e. --file PATH is better than --file FILE, --playbook PATH|URL is better than --playbook PLAYBOOK.
  • if there's a default value, it belongs to the default= key of field(), and the help text should not mention it as the "Default is ..." can be easily added automatically and rendered correctly with show_default=True.
  • when showing an example of how something is expressed, include also an example for the command line:
    Run a single playbook on the guest:
    
    .. code-block:: yaml
    
        prepare:
            how: ansible
            playbook: ansible/packages.yml
    
    .. code-block:: shell
    
        prepare --how ansible --playbook ansible/packages.yml
    Do not use :caption: directive, it is parsed by Sphinx only and docutils package cannot handle it.

Pull requests

  • discover
    • fmf
    • shell
  • execute
    • internal
    • upgrade
  • finish
    • ansible
    • shell
  • prepare
  • provision
    • artemis
    • connect
    • local
    • mrack
    • podman
    • testcloud
  • report
    • display
    • html
    • junit
    • polarion
    • reportportal
  • checks
    • avc
    • dmesg
    • watchdog
@happz happz added the documentation Improvements or additions to documentation label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant