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

Include reST label for default variables #230

Open
ypid opened this issue Oct 23, 2016 · 3 comments
Open

Include reST label for default variables #230

ypid opened this issue Oct 23, 2016 · 3 comments

Comments

@ypid
Copy link
Member

ypid commented Oct 23, 2016

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 :)

@drybjed
Copy link
Member

drybjed commented Oct 23, 2016

This makes the header kinda big... But I suppose that if there's no other way and the header doesn't work (any idea why?), then we could go with this solution.

@ypid
Copy link
Member Author

ypid commented Oct 23, 2016

I am not sure why it does not work. I thought that I had used something like this before but when I tried it was always kind of unreliable so a label would be best.

@ypid
Copy link
Member Author

ypid commented Oct 24, 2016

Ok, lets leave this issue open for now. I used the proposed label in https://github.com/debops/ansible-cryptsetup/pull/18 but until the need in other places arises we do not need to make this the default just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants