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

Docs: Add a "seealso" section to the module docs #45949

Merged
merged 2 commits into from
Dec 12, 2018

Conversation

dagwieers
Copy link
Contributor

@dagwieers dagwieers commented Sep 21, 2018

SUMMARY

Something I wanted for a longer time was a separate section to list related modules and/or related references. This clears up the notes section for things that are actual notes.

So you can add a section in your module documentation and four types of references are possible.

seealso:

# Reference by module name
- module: aci_tenant

# Reference by module name, including description
- module: aci_tenant
  description: ACI module to create tenants on a Cisco ACI fabric.

# Reference by rST documentation anchor
- ref: aci_guide
  description: Detailed information on how to manage your ACI infrastructure using Ansible.

# Reference by Internet resource
- name: APIC Management Information Model reference
  description: Complete reference of the APIC object model.
  link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

  • Implements ansible-doc support
  • Implements schema support for the seealso options
  • Updates to the development documentation
  • Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
    • This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
  • We fixed the possible suboption types (which was limited to 'bool' only)
ISSUE TYPE
  • Docs Pull Request
  • Feature Pull Request
COMPONENT NAME

Module docs

ANSIBLE VERSION

v2.8

ADDITIONAL INFORMATION

Before:
screenshot from 2018-09-21 03-09-14

After:
screenshot from 2018-09-21 03-30-55

ansible-doc output

SEE ALSO:
      * Module aci_bd
           The official documentation on the aci_bd module.
           https://docs.ansible.com/ansible/devel/modules/aci_bd_module.html
      * Module aci_tenant
           The official documentation on the aci_tenant module.
           https://docs.ansible.com/ansible/devel/modules/aci_tenant_module.html
      * Ansible documentation [aci_guide]
           Detailed information on how to manage your ACI infrastructure using Ansible.
           https://docs.ansible.com/ansible/latest/#stq=aci_guide&stp=1
      * Ansible documentation [aci_dev_guide]
           Detailed guide on how to write your own Cisco ACI modules to contribute.
           https://docs.ansible.com/ansible/latest/#stq=aci_dev_guide&stp=1

The documentation for this feature looks like this:
screenshot from 2018-09-21 17-24-07

TODO (see #45985):

  • Currently ref-type references cannot be converted to a title + link, as Sphinx takes care of this internally. The solution is to make a searchable link that brings the user to the document based on the reference name.

@ansibot
Copy link
Contributor

ansibot commented Sep 21, 2018

@ansibot ansibot added aci Cisco ACI community affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 21, 2018
@dagwieers
Copy link
Contributor Author

dagwieers commented Sep 21, 2018

cc @felixfontein

@dagwieers dagwieers added this to To do in OLD Ansible Documentation via automation Sep 21, 2018
@dagwieers dagwieers force-pushed the doc-seealso branch 4 times, most recently from 2948904 to ccacf51 Compare September 21, 2018 02:08
@ansibot
Copy link
Contributor

ansibot commented Sep 21, 2018

@ansibot ansibot added the test This PR relates to tests. label Sep 21, 2018
@ansibot

This comment has been minimized.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 21, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Sep 21, 2018
Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

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

This looks like a good addition. We will review in more detail after AnsibleFest

schema.py and /developing_modules_documenting will also need updating

Added to https://etherpad.openstack.org/p/ansible-summit-october-2018-documentation

@dagwieers

This comment has been minimized.

@gundalow gundalow changed the title Docs: Add a "seealso" section to the module docs [WIP] Docs: Add a "seealso" section to the module docs Sep 21, 2018
@dagwieers dagwieers force-pushed the doc-seealso branch 3 times, most recently from a0cf081 to d563d92 Compare September 21, 2018 13:46
@ansibot ansibot added the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Sep 21, 2018
@gundalow
Copy link
Contributor

Dag, good point. Let's stick with /latest/

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 1, 2018
@dagwieers
Copy link
Contributor Author

Ok, so anything else needed before we can merge this ?

@acozine
Copy link
Contributor

acozine commented Nov 29, 2018

@dagwieers could the seealso section use the existing, documented link syntax to link to URLs and module docs? (U(https:external_url) for links and M(module_name) for modules)

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. core_review In order to be merged, this PR must follow the core review workflow. labels Nov 29, 2018
@dagwieers
Copy link
Contributor Author

@acozine It is a YAML dictionary, not a free text-field. Because we don't let the user do the markup, it is a listing of information we present depending on where it is being used. So it doesn't make sense.

For instance, for the module entry we depend on the Sphinx references to automatically fill in the title.

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 30, 2018
@ansibot ansibot added docsite This issue/PR relates to the documentation website. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 8, 2018
@acozine acozine merged commit baf0ad2 into ansible:devel Dec 12, 2018
@dagwieers
Copy link
Contributor Author

@acozine @gundalow I would like to implement seealso: now for the windows/python modules that relate to each other (we now use notes) and for the modules that relate to each other (typically copy + template, copy + rsync, command + shell + raw +script, etc...) and for the ACI modules.

We probably want to communicate this to other authors too.

kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
* Docs: Add a separate  "seealso" section to the module docs
to list related modules and/or related references. This clears up the notes
section for things that are actual notes.

So you can add a section in your module documentation and four types of
references are possible.

    seealso:

    # Reference by module name
    - module: aci_tenant

    # Reference by module name, including description
    - module: aci_tenant
      description: ACI module to create tenants on a Cisco ACI fabric.

    # Reference by rST documentation anchor
    - ref: aci_guide
      description: Detailed information on how to manage your ACI infrastructure using Ansible.

    # Reference by Internet resource
    - name: APIC Management Information Model reference
      description: Complete reference of the APIC object model.
      link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

- Implements ansible-doc support
- Implements schema support for the seealso options
- Updates to the development documentation
- Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
  - This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
- We fixed the possible suboption types (which was limited to 'bool' only)

* Use latest stable instead of devel docs
@acozine acozine moved this from To do to Backport to 2.7 in OLD Ansible Documentation Jan 28, 2019
acozine pushed a commit to acozine/ansible that referenced this pull request Jan 28, 2019
* Docs: Add a separate  "seealso" section to the module docs
to list related modules and/or related references. This clears up the notes
section for things that are actual notes.

So you can add a section in your module documentation and four types of
references are possible.

    seealso:

    # Reference by module name
    - module: aci_tenant

    # Reference by module name, including description
    - module: aci_tenant
      description: ACI module to create tenants on a Cisco ACI fabric.

    # Reference by rST documentation anchor
    - ref: aci_guide
      description: Detailed information on how to manage your ACI infrastructure using Ansible.

    # Reference by Internet resource
    - name: APIC Management Information Model reference
      description: Complete reference of the APIC object model.
      link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

- Implements ansible-doc support
- Implements schema support for the seealso options
- Updates to the development documentation
- Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
  - This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
- We fixed the possible suboption types (which was limited to 'bool' only)

* Use latest stable instead of devel docs

(cherry picked from commit baf0ad2)
abadger pushed a commit that referenced this pull request Jan 28, 2019
* Docs: Add a separate  "seealso" section to the module docs
to list related modules and/or related references. This clears up the notes
section for things that are actual notes.

So you can add a section in your module documentation and four types of
references are possible.

    seealso:

    # Reference by module name
    - module: aci_tenant

    # Reference by module name, including description
    - module: aci_tenant
      description: ACI module to create tenants on a Cisco ACI fabric.

    # Reference by rST documentation anchor
    - ref: aci_guide
      description: Detailed information on how to manage your ACI infrastructure using Ansible.

    # Reference by Internet resource
    - name: APIC Management Information Model reference
      description: Complete reference of the APIC object model.
      link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

- Implements ansible-doc support
- Implements schema support for the seealso options
- Updates to the development documentation
- Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
  - This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
- We fixed the possible suboption types (which was limited to 'bool' only)

* Use latest stable instead of devel docs

(cherry picked from commit baf0ad2)
@acozine acozine moved this from Backport to 2.7 to Done in OLD Ansible Documentation Jan 29, 2019
@dagwieers dagwieers added the cisco Cisco technologies label Feb 23, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aci Cisco ACI community affects_2.8 This issue/PR affects Ansible v2.8 cisco Cisco technologies core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. docsite This issue/PR relates to the documentation website. module This issue/PR relates to a module. networking Network category support:certified This issue/PR relates to certified code. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants