-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Details
- Read the Docs project URL: https://readthedocs.org/projects/openvidu/
- Build URL (if applicable): https://readthedocs.org/projects/openvidu/builds/14834239/
- Read the Docs username (if applicable):
Our project is using:
-
MkDocs 1.2.2
-
Extra Context option in
mkdocs.yml, with the ENV syntax to read environment variables, making theREADTHEDOCSvars available to the template context:extra: READTHEDOCS: !ENV [READTHEDOCS, "(no var)"] READTHEDOCS_VERSION: !ENV [READTHEDOCS_VERSION, "(no var)"] READTHEDOCS_PROJECT: !ENV [READTHEDOCS_PROJECT, "(no var)"] -
Attempting to read the RtD environment variables as explained in Build environment and How do I change behavior when building with Read the Docs?.
Expected Result
-
The
cat mkdocs.ymlbuild step should show proper values for env varsREADTHEDOCS,READTHEDOCS_VERSION, andREADTHEDOCS_PROJECT. -
A test html file with these contents:
console.log("config.extra: {{ config.extra }}"); console.log("config.extra.READTHEDOCS: {{ config.extra.READTHEDOCS }}"); console.log("config.extra.READTHEDOCS_VERSION: {{ config.extra.READTHEDOCS_VERSION }}");should print something similar to this in the browser console:
config.extra: {'READTHEDOCS': True, 'READTHEDOCS_VERSION': 1.2.3, 'READTHEDOCS_PROJECT': openvidu} config.extra.READTHEDOCS: True config.extra.READTHEDOCS_VERSION: 1.2.3
Actual Result
-
The
cat mkdocs.ymlbuild step shows thatREADTHEDOCS,READTHEDOCS_VERSION, andREADTHEDOCS_PROJECTare allnull:extra: READTHEDOCS: null READTHEDOCS_PROJECT: null READTHEDOCS_VERSION: null -
The browser console shows this output:
config.extra: {'READTHEDOCS': None, 'READTHEDOCS_PROJECT': None, 'READTHEDOCS_VERSION': None} config.extra.READTHEDOCS: None config.extra.READTHEDOCS_VERSION: None
Extra
Question / potential extra bug in the documentation: the technique shown in How do I change behavior when building with Read the Docs? would not really work with MkDocs, would it?
The sample is:
{% if READTHEDOCS %}
Woo
{% endif %}
but in MkDocs the READTHEDOCS is not directly available, is it expected to be? (sorry to ask here but is just a yes/no question that seems very relevant given the topic of the issue)