Skip to content

Commit

Permalink
Fix role docs section levels (#367)
Browse files Browse the repository at this point in the history
* Fix role docs section levels.

* Collection links should stay as before, so they do not show up in TOC, same as for plugins.
  • Loading branch information
felixfontein authored Dec 29, 2024
1 parent 1003bcb commit f931674
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 21 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/367-role-headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- "Fix role section heading levels. Examples and attributes should be below role entrypoints
(https://github.com/ansible-community/antsibull-docs/issues/366, https://github.com/ansible-community/antsibull-docs/pull/367)."
4 changes: 2 additions & 2 deletions src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Parameters
{% if ep_doc['attributes'] %}

Attributes
----------
^^^^^^^^^^

@{ attributes_rst(ep_doc['attributes'], attribute_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
{% endif %}
Expand Down Expand Up @@ -194,7 +194,7 @@ See Also

{% if ep_doc['examples'] and ep_doc['examples'] | trim -%}
Examples
--------
^^^^^^^^

.. code-block:: @{ ep_doc['examples_format'] | rst_format(for_sphinx=true) }@

Expand Down
4 changes: 2 additions & 2 deletions src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Parameters
{% if ep_doc['attributes'] %}

Attributes
----------
^^^^^^^^^^

@{ attributes_rst(ep_doc['attributes'], role_entrypoint=entry_point) }@
{% endif %}
Expand Down Expand Up @@ -152,7 +152,7 @@ See Also

{% if ep_doc['examples'] and ep_doc['examples'] | trim -%}
Examples
--------
^^^^^^^^

.. code-block:: @{ ep_doc['examples_format'] | rst_format }@

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Synopsis
Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Parameters
Attributes
----------
^^^^^^^^^^

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Expand Down Expand Up @@ -283,7 +283,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Synopsis
Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Parameters
Attributes
----------
^^^^^^^^^^

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Expand Down Expand Up @@ -283,7 +283,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Parameters
Attributes
----------
^^^^^^^^^^

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Expand Down Expand Up @@ -280,7 +280,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Parameters


Attributes
----------
^^^^^^^^^^

.. list-table::
:widths: auto
Expand Down Expand Up @@ -134,7 +134,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Synopsis


Examples
--------
^^^^^^^^

.. code-block:: yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Parameters


Attributes
----------
^^^^^^^^^^

.. list-table::
:widths: auto
Expand Down Expand Up @@ -134,7 +134,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/baseline-squash-hierarchy/foo_role.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Parameters
Attributes
----------
^^^^^^^^^^

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Expand Down Expand Up @@ -283,7 +283,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Parameters
Attributes
----------
^^^^^^^^^^

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Expand Down Expand Up @@ -236,7 +236,7 @@ See Also
The official documentation on the **ns2.col.foo** module.

Examples
--------
^^^^^^^^

.. code-block:: yaml+jinja

Expand Down

0 comments on commit f931674

Please sign in to comment.