Skip to content

Move github template info into html_theme_options. (Feedback) #681

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

Closed
wants to merge 1 commit into from

Conversation

bramwelt
Copy link
Contributor

I would really like it if the sphinx_rtd_theme supported html_theme_options so that I didn't have to override breadcrumbs.html in every project I want an 'edit on github' link to show up.

This is related to: readthedocs/sphinx_rtd_theme#91

@ericholscher
Copy link
Member

This seems reasonable. Though we probably need it in both places to make it backwards compat.

@ericholscher
Copy link
Member

Also, any reason you can't just put the variables into html_context in your conf.py? Seems like it's the same thing?

@bramwelt
Copy link
Contributor Author

html_context is only available on RTD.

Ah, apparently I'm not being clear. This is not for having a different github/bitbucket account than the project name. This is for projects not using RTD to build/host their documentation.

@ericholscher
Copy link
Member

html_context is a Sphinx setting:
http://sphinx-doc.org/config.html#confval-html_context

Anyone is free to set it themselves

On Thu, Feb 27, 2014 at 9:01 AM, Trevor Bramwell
[email protected]:

html_context is only available on RTD.

Ah, apparently I'm not being clear. This is not for having a different
github/bitbucket account than the project name. This is for projects not
using RTD to build/host their documentation.

Reply to this email directly or view it on GitHubhttps://github.com//pull/681#issuecomment-36198490
.

Eric Holscher
Maker of the internet residing in Portland, Or
http://ericholscher.com

@svisser
Copy link
Contributor

svisser commented Mar 20, 2014

It seems that this html_context variable can currently only be used to augment already computed values. See: #743.

@bramwelt
Copy link
Contributor Author

@ericholscher You are totally right about html_context. My apologies for overlooking that. I was able to get something to work using html_context. The end result looks something like this:

html_context = {
    'display_github': True,
    'github_repo': "REPO",
    'github_user': "USERNAME",
    'github_version': "master",
    'conf_py_path': "/source/"
}

Thanks, for the help!

@bramwelt bramwelt closed this Mar 31, 2014
@svisser
Copy link
Contributor

svisser commented Mar 31, 2014

@bramwelt How does that work? Your content of html_context will be overwritten in the extended conf.py (see https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl#L78 ) so your provided GitHub values will be overwritten by those in context ?

@bramwelt
Copy link
Contributor Author

bramwelt commented Apr 1, 2014

@svisser This was related to using sphinx_rtd_theme outside the context of RTD. Since the RTD doc builder is not invoked, display_github, github_repo, etc are used as-is and not overwritten.

My point in this PR was to enable me to list those options in conf.py without having to write custom templates. Using html_context is a workaround for my issue and will suffice.

@svisser
Copy link
Contributor

svisser commented Apr 1, 2014

@bramwelt thanks for clarifying that. In that case I can see how it works.

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

Successfully merging this pull request may close these issues.

3 participants