Skip to content

Include reST label for default variables #230

@ypid

Description

@ypid

Currently the header of default/main.yml files looks something like this:

---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker

# debops.cryptsetup default variables [[[
# =======================================

# .. contents:: Sections
#    :local:
#
# .. include:: includes/all.rst

However one might want to refer to the default variables section from other parts of the documentation. I thought that the unique section name debops.cryptsetup default variables could be used directly from other parts using the ref role but I just tried it with v1.4.6 and it seems that it is not possible. As documented for the ref role, sections should be referred to by label. I therefore would propose to add such a label by default which could look like this:

---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker

# .. _cryptsetup__ref_default_variables:
#
# debops.cryptsetup default variables [[[
# =======================================

# .. contents:: Sections
#    :local:
#
# .. include:: includes/all.rst

This allows to refer to the section like this:

Now, after having peeked at the :ref:`cryptsetup__ref_default_variables` you can

Fortunately, that header update can easily by automated by yaml4rst and debops-optimize :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions