-
Notifications
You must be signed in to change notification settings - Fork 17
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
How to handle environment variables? #164
Comments
One idea: convert |
Another idea: collect all environment variables from all markup, and make sure that |
(https://ansible.fontein.de/collections/environment_variables.html is an example of a per-docsite autogenerated list of envvar directives; it copies the text from the options that have that environment variable listed in |
so are you saying this option is what you show at https://ansible.fontein.de/collections/environment_variables.html ? |
@samccann your first link points to the wrong target. |
Sorry - does the example page that lists all env variables the result of option 2. |
Yes, it would be something similar. The problem is that it would be just a long list of the environment variable names with no information for them (or just the same text everywhere, saying there is no more information), since we don't know what to show there. |
I've implemented option one in #166. |
With semantic markup, we have
E(...)
to reference environment variables. For RST output, the Sphinx:envvar:
role is used (https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-envvar). antsibull-docs uses the.. envvar::
directive (https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-envvar) for all environment variables that appear inenv:
plugin configs (and the Ansible/ansible-core docsite generates.. envvar::
directives for all ansible-core config values, see https://github.com/ansible/ansible/blob/devel/docs/templates/config.rst.j2#L223-L248). But for all other environment variables mentioned in text, there is no such (auto-generated) target.So either collections define their own targets, which can cause problems if multiple collections define targets that end up in the Ansible docsite, or they don't, and we end up with a list of
WARNING: 'envvar' reference target not found:
warnings. A good example is ansible-collections/community.docker#645 with its output https://github.com/ansible-collections/community.docker/actions/runs/5235637304/jobs/9452611330.This makes using
E(...)
inattractive or even outright impossible (for example in community.docker, the docsite build must have no errors for CI to pass). Manually defining.. envvar::
directives is not a good idea either (except in special cases). #75 would improve the situation a bit, but it won't happen anytime soon (core doesn't like it).I'm opening this issue so we can discuss what to do about this. Having a huge amount of new reference errors in the docsite build is something I'm pretty sure nobody wants. Just muting all these warnings (the one for env vars, not the general reference errors) isn't a good idea either IMO.
The text was updated successfully, but these errors were encountered: