-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Build process missing layout.html #152
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
Comments
Yea, this is a known issue since RTD ships its own layout.html for If you know a way to work around this is Sphinx, let me know, otherwise I On Mon, Jan 2, 2012 at 6:07 AM, Mikko Ohtamaa <
Eric Holscher |
Ok. For me it's enough to
As I don't know Sphinx template system well yet, I'll accept tips how to do 1) |
I am now doing an attempt to use page.html overrides instead of layout.html. Is there something I need to do to force full rebuild on readthedocs.org? |
FYI the custom HTML isn't applied to search pages etc. now, but at least main documentation pages receive it when overriding page.html |
Wow! That is a really great idea, and might be something that is worth Is the code on your end pretty customizable? I'm guessing it just needs to On Sun, Jan 8, 2012 at 4:58 AM, Mikko Ohtamaa <
Eric Holscher |
Here is a long'ish blog post how it was done http://opensourcehacker.com/2012/01/08/readthedocs-org-github-edit-backlink-and-short-history-of-plone-documentation/ and here the details https://github.com/collective/collective.developermanual/blob/master/source/_templates/page.html |
Also note that Sphinx lacks "full filename with extension" template variable which would be needed for a generic solution |
Yea, we have the information in some form within RTD, so we could inject it On Sun, Jan 8, 2012 at 12:24 PM, Mikko Ohtamaa <
Eric Holscher |
Nah, how about fixing it in Sphinx itself? :) |
layout.html from RTD (the first try didn't work, so my change is in two commits) If you want to change it in RTD code for all projects, I think the simplest way would be to use another magic prefix in RTD's layout.html, e.g. if template.startswith('?'):
loaders = loaders[1:]
template = template[1:] (not tested) |
Interesting. I will have to try and figure this out at a general level, as it seems useful. |
I just ran into this too last night. I was trying to add a "Fork me on GitHub" ribbon to my readthedocs page (http://readthedocs.org/docs/pycon-2012-notes/). Perhaps there is a better way to do it, but my attempt involved using a custom Should this issue be reopened? Being able to use a custom It might also be interesting to have a feature where you can check a box in your project's settings and automatically get a "Fork me on GitHub" ribbon. If folks agree with the concept, I can take a stab at a patch to add it to readthedocs. |
@miohtama That's cool what you did! I wonder if you considered having your widget link directly to the "edit" URL on GitHub -- e.g.: https://github.com/collective/collective.developermanual/edit/master/source/index.rst (basically just change "blob" to "edit"). That removes one step for the user and then you can simplify your instructions a bit. |
I've opened an issue in Sphinx tracker Anyway, I think it's trivial to fix it in RTD, add three lines to sphinx.jinja2glue.BuiltinTemplateLoader.get_source() and change |
Reopened, and I will go ahead and look into implementing this on RTD in the next few days. If someone works up a pull request, I might get to it sooner. Once it's on there, I'd also love to have some help testing and documenting this, though if I read it correctly, it should "Just Work" |
@msabramo Do you know how Github handles following direct edit situations in your suggested solution
|
@miohtama Sorry, no I don't. They seem fairly easy to test though. |
I'm curious if there was any progress on this? |
Ran into another problem with this today. Not sure a great way to fix it still, sadly :/ I'm wondering if using page.html instead of layout.html for the RTD specific stuff might help, or some other way of getting out of the way easier. |
The extension work and new theme should hopefully make it so we can stop overriding the layout.html. There is still one bit of information we need in each page (the page's name), so it may not be possible, but we're getting closer. |
We can not use layout.html due to readthedocs/readthedocs.org#152 Signed-off-by: Michal Čihař <[email protected]>
Workaround for readthedocs/readthedocs.org#152 Signed-off-by: Michal Čihař <[email protected]>
This allows setting an arbitrary Sidebar Depth for both locally built docs & docs on ReadTheDocs.org. * Move the layout.html template to page.html since ReadTheDocs ignores the layout.html template. * Reduce the Sidebar Depth to a level of 3 in order to reduce unnecessary entries in the Stencil Data Types & Behaviors Reference. See: readthedocs/readthedocs.org#152
@ericholscher What's the current status of this? |
It's still an issue, where we use it for our customizations. On Tue, Jul 21, 2015 at 4:43 AM, Gregor Müllegger [email protected]
Eric Holscher |
This has been driving me crazy all month. Relieved to find this page and find our I'm not doing anything wrong. An easy solution is give a project the option to disable RTD's html meddling for a given project. |
We are working to remove some of this with our sphinx extension, namely #1946 and readthedocs/readthedocs-sphinx-ext#13 |
I almost moved my docs off RTD, but was able to workaround this limitation by adding my custom css/js as a sidebar on all pages. |
@kennethreitz if you just need to add custom javascript/css, another method is to include files via the Sphinx application API in your def setup(app):
app.add_javascript('foo.js')
app.add_stylesheet('foo.css') More: Soon we shouldn't need a |
@agjohnson ah, fantastic. Thanks! :) |
Good news everyone! We have just merged and deployed changes to RTD and our Sphinx extension that move RTD specific overrides into our Sphinx extension, without the need to override This might cause some different breakage, but we will deal with those changes as they come up. Feel free to open any new issues that might stem from this tomfoolery. |
This may not be exactly the fix requested, but by overriding the So, in my own
|
…ing page.html inspired by readthedocs/readthedocs.org#152 . 10y old, and still feels like a hack, but I dunno. also related:
…ing page.html inspired by readthedocs/readthedocs.org#152 . 10y old, and still feels like a hack, but I dunno. also related:
…ing page.html inspired by readthedocs/readthedocs.org#152 . 10y old, and still feels like a hack, but I dunno. also related:
Plone's developer documentation is using a custom layout.html template with Sphinx 1.1.2. This adds some documentation specific links to the source code. For some reason these changes are not picked up
How "native" Sphinx build HTML looks like:
http://opensourcehacker.com/wp-content/uploads/docs/
How readthedocs.org HTML looks like:
http://collective-docs.readthedocs.org/en/latest/index.html
I am still new to readthedocs.org - is there something special that needs to be done for custom layout.html or is it supported at all? (XSS injections and stuff)
The text was updated successfully, but these errors were encountered: