-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Refactor HTML templates #467
Conversation
Note: this is untested code and I need to make sure it works still. |
@ericholscher @agjohnson can you have a look at this PR |
Is the idea that the deleted bits are already in the basic theme, and we inherit them? |
This seems like a really large change, tying ourselves to any additions in the Sphinx base theme. I imagine there could be many unindented outcomes. |
Yes
Possible but doubtful, sphinx tries to keep this compatible since other theme do it to see: https://github.com/bitprophet/alabaster/blob/master/alabaster/layout.html |
@agjohnson @ericholscher what is the status here? I really think that this is the better way to go as the old way has already caused several errors that this could prevent. |
This pull request fixes the issues we're having with adding extra JavaScript libraries to display Plotly notebooks in Read the Docs, see spatialaudio/nbsphinx#128. There is only one issue with vertical space in the header:
(Edit: swap images) The rest looks exactly the same and it would be great to have this merged 👍 |
I will have a look as soon as I can. |
js files in the |
Note that to get exact behavior as before sphinx-doc/sphinx#4245 needs to get merged. But this is a minor thing and should not stop this PR. |
{% if favicon %} | ||
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> | ||
{% endif %} | ||
{# CANONICAL URL #} | ||
{% if theme_canonical_url %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this can be removed also if sphinx-doc/sphinx#4193 gets merged
@Juanlu001 do you mind testing again? |
@Blendify the background gray stripe leveled up with the white body, but the whole block is still displaced. I attach current capture. |
You can test it by yourself by building these docs: https://github.com/poliastro/poliastro/tree/master/docs |
</p> | ||
</div> | ||
|
||
{%- if show_sphinx %} | ||
{% trans %}Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Blendify why was this removed? When building the demo docs, this does not show up anymore, so I don't think it is inserted elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was inherited from the main layout file but I think that is not working. I can add it back.
@ericholscher @agjohnson what do you think about making the search page match one that looks like https://alabaster.readthedocs.io/en/latest/search.html I am thinking about making this a separate PR because it would mean that we get rid of the licence issue of having Sphinx code in our repository. See #283 |
That would def. be a new PR. Our search stuff is complex, and I believe @agjohnson has plans to kill our dependence on the Sphinx search logic. |
Would be interesting to hear more about because we still need to support
people using the theme not on readthedocs.
On Dec 18, 2017 6:04 PM, "Eric Holscher" <notifications@github.com> wrote:
That would def. be a new PR. Our search stuff is complex, and I believe
@agjohnson <https://github.com/agjohnson> has plans to kill our dependence
on the Sphinx search logic.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#467 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOeua97JP1eIINw6KkTjCksYGWQegDf3ks5tBu9xgaJpZM4PcwPQ>
.
|
I've made the change to use the same DOCTYPE as the theme does now, which should prevent rendering differences (if any) from Sphinx preferring XHTML. <!--[if IE 8]><html class="no-js lt-ie9" lang="{{ lang_attr }}" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ lang_attr }}" > <!--<![endif]--> |
Just as a note, I think this is a major change to the theme, and will require a lot of work in order to release properly. In particular, it ties us to the underlying Sphinx version in a lot of ways, and it will need to be tested across a bunch of different scenarios. I'm imagining that this will be a 2.0 release of the theme. It will need to be tested across all supported Sphinx versions. It will also need to be tested across those Sphinx versions paired with RTD includes. Specifically, we have a lot of custom JS & CSS that could be changed by the underlying Sphinx HTML/CSS changes that come through, and we'd also be tying ourselves to supporting all new Sphinx features in the theme as soon as they are released in Sphinx itself. As I said before without a lot of explanation, there is a huge amount of complexity that comes from this somewhat simple change. This PR should definitely reduce the amount going on, including not changing how we're doing search, so that we can properly test this and make sure what is coming across from Sphinx fully works in all the use cases that we need to support. |
This PR does fix some issues, in addition to delegating some stuff to the Sphinx theme. |
Yes, I think this should be split up. It has become quite large and would be easier to split up. Also with Sphinx 2.0 coming in the next couple of years with some major changes likely. (we already know that |
This extends the default sphinx "basic" theme anything that is not there is added to extra head.
Fixes: #166: