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 anchor to each parameter row #66895

Merged
merged 4 commits into from Feb 3, 2020

Conversation

dnmvisser
Copy link
Contributor

Addresses #66893

@ansibot
Copy link
Contributor

ansibot commented Jan 29, 2020

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 29, 2020
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jan 29, 2020
Co-Authored-By: Felix Fontein <felix@fontein.de>
@dnmvisser dnmvisser changed the title Add anchor to each paramater row Add anchor to each parameter row Jan 30, 2020
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

LGTM

@samccann
Copy link
Contributor

Hmm.. I generated this locally (make webdocs off this branch) and I'm not seeing any additional anchors on the parameters of a module...

@@ -106,7 +106,7 @@ Parameters
<th width="100%">Comments</th>
</tr>
{% for key, value in options|dictsort recursive %}
<tr>
<tr id="parameter-@{ key }@">
Copy link
Contributor

Choose a reason for hiding this comment

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

There's one downside: this will only work well for top-level options. Nested options might create collisions since their ID doesn't contain the keys of the options in which they are nested.

@felixfontein
Copy link
Contributor

I've added two commits to this PR:

  1. The first adds some preprocessing to make sure that the "full keys" are around (i.e. a list of parent keys followed by the key itself). These can be used to generate proper IDs which are unique per module.
  2. The second adds graphical link indicators similar to the one used for headers by the sphinx_rtd_theme theme. I had to extract some CSS from that theme and add it with different selectors; I used a new name (ansibleOptionLink) to make sure it is not confused with something from the theme.

Copy link
Contributor

@samccann samccann left a comment

Choose a reason for hiding this comment

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

LGTM

@felixfontein felixfontein merged commit 5b93a14 into ansible:devel Feb 3, 2020
@felixfontein
Copy link
Contributor

@dnmvisser thanks for getting this started!
@samccann thanks for testing this!

felixfontein pushed a commit to felixfontein/ansible that referenced this pull request Feb 3, 2020
* Add anchor to each paramater row

* Update docs/templates/plugin.rst.j2

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Insert full keys into plugin docs.

* Added visible links.

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5b93a14)
acozine pushed a commit that referenced this pull request Feb 5, 2020
* Add anchor to each paramater row
* Update docs/templates/plugin.rst.j2
* Insert full keys into plugin docs.
* Added visible links.

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5b93a14)

Co-authored-by: Dick Visser <dick.visser@geant.org>
@ansible ansible locked and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. has_issue new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants