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

Add ability to override computed template context variables #743

Closed
svisser opened this issue Mar 20, 2014 · 5 comments
Closed

Add ability to override computed template context variables #743

svisser opened this issue Mar 20, 2014 · 5 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Milestone

Comments

@svisser
Copy link
Contributor

svisser commented Mar 20, 2014

There seems to be no straightforward way to override already computed template context variables, such as "display_github". It is computed here: doc_builder.backends.sphinx.Builder._whitelisted and I want to set it to False (use case: using the existing theme but removing the "Edit on GitHub" button).

However, reviewing RTD_CONF_ADDITIONS shows that all I can do is define a variable called "html_context" and add the already computed template context to that. But there seems no way to let the Builder compute all the Github values and set display_github to False afterwards.

@gregmuellegger
Copy link
Contributor

Is this solved for you? It seems that you got help in #681 and fixed it on your own, right? :)

@gregmuellegger gregmuellegger added the Needed: more information A reply from issue author is required label Jul 21, 2015
@svisser
Copy link
Contributor Author

svisser commented Jul 21, 2015

It's been a while but looking at the current source code it seems the values are still computed here and they get appended to the user's configuration here. So the original use case of having Github account details but then setting display_github to False doesn't seem possible.

If that's correct, I think there should be a way of overriding the template context variables after both loading of the user's configuration and readthedocs' processing of that configuration.

@stsewd
Copy link
Member

stsewd commented Mar 7, 2018

If this issue is about removing the "Edit on " button, there is a guide on the docs for that https://docs.readthedocs.io/en/latest/guides/remove-edit-buttons.html

@agjohnson agjohnson added the Accepted Accepted issue on our roadmap label Sep 19, 2018
@agjohnson
Copy link
Contributor

I think there are a few issues addressing this, but as we've discussed internally about this in the past, I think our context variables shouldn't override settings unless we are absolutely sure we want to force RTD behavior on the docs.

@agjohnson agjohnson added this to the Admin UX milestone Sep 19, 2018
@stsewd
Copy link
Member

stsewd commented Nov 27, 2018

The current design overrides the html_context #3490, but we have a feature flag to not override the html_context. Also, closing this in favor of #2971

@stsewd stsewd closed this as completed Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

4 participants