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

Support embedding Sphinx context variables #13

Open
fatalaa opened this issue Mar 3, 2020 · 1 comment
Open

Support embedding Sphinx context variables #13

fatalaa opened this issue Mar 3, 2020 · 1 comment

Comments

@fatalaa
Copy link

fatalaa commented Mar 3, 2020

It would be useful to have access for the Sphinx context variables.
I'd use this with conditional rendering(where Sphinx's ifconfig falls short) like:

.. jinja:: my_context

  {% if platform == 'something' %}
  * An element that is only available on the platform `something`
  {% endif %}

So i wouldn't have to write this in my conf.py:

jinja_contexts: {'my_context': {'platform': 'something'}}

as I'd pass the platform variable via command line to Sphinx.

I can implement this, I just like to have your approval on it.

@tardyp
Copy link
Owner

tardyp commented Mar 3, 2020

sounds like a good improvement. I'll merge it when you submit it.

thanks!

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

No branches or pull requests

2 participants