I would like to disable the top navigation bar of the ReadTheDocs theme. For other theme, for instance classic it is just an option
html_theme = "classic"
html_theme_options = {
"showrelbartop": False
}
How I can modify the read the docs theme to disable this top navigation bar?
Edit:
After processing the source files with make html, I have to remove these lines in html files
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li>Docs »</li>
<li></li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
to obtain the expected result. Is it possible to obtain this result before compiling the sources with make html?
I assume you refer to the breadcrumbs (breadcrumbs.html). You can simply open the main template file - layout.html - and delete or comment out the following line:
{% include "breadcrumbs.html" %}
An old question, but I needed this as well. A simpler answer than the currently accepted one, which works for Sphinx==3.5.3 and sphinx-rtd-theme==0.5.2 is:
in docs/_templates/, create a file called breadcrumbs.html
in that file, write an html comment like <!-- Empty override file take the place of env/lib/python3.8/site-packages/sphinx_rtd_theme/breadcrumbs.html, which generates the top nav breadcrumbs. -->.
Rebuild, and you're done.
Related
my tumblr theme hides the tags in a post when you don't click the post. is there a way to make the tags appear all the time?
.
I've tried writing
{block:HasTags}
<ul class="tags">
{block:Tags}<li>{Tag}</li>{/block:Tags}
</ul>
{/block:HasTags}
inside {block: Posts} and even after it, but it doesn't work. here's a link to the html code of my theme: pastebin.com/awQUSraA
It seems tags are hidden on the index page:
.tags {
margin-top:5px;
font-style:italic;
{block:indexpage}display:none;{/block:indexpage}
}
Remove {block:indexpage}display:none;{/block:indexpage} and they should be visible.
I'm using the wonderful Sphinx tool to create some documentation and I need to create a custom HTML div so that I can style it apart from Sphinx's other, automatically-created, divs.
This is possible to do using the container directive, but the problem is that if I use this directive below a subsubsection, it automatically nests the div created with the container directive within the subsubsection, like so:
<div id="automatically-created sphinx subsubsection">
...
<div id="my custom container"></div>
</div>
Whereas, I want:
<div id="automatically-created sphinx subsubsection">
...
</div>
<div id="my custom container"></div>
Is there any way to do this? Any help would be greatly appreciated!
Addendum:
One hacky way of potentially solving the problem is to create a new subsubsection so that Sphinx automatically places it on the same level as other subsubsections and then use CSS to hide its header etc. The problem with this approach, however, is that the new subsubsection automatically gets added to the sidebar in the RTD theme (which I'm using) and this is not what I want.
Untested. Try a super-hacky .. raw:: directive, where you would close the current section, then open a new unclosed <div>:
.. raw:: html
</div>
<div id="my custom container">
Then resume using reStructured text markup. This would "trick" Sphinx into thinking that the current section is still open and it would still add a closing </div> after the rest of your markup until it starts parsing the next section.
I have a website that consists out of a few 'slides'. Each has a fixed structure, used by some scripts, but variable content. I'm hosting it on github and am now trying to use Jekyll to make it easier to add new slides.
I already have each slide in a different html file, which I include in the main page: {% include_relative _slides/about.html %}. Now I'm trying to make it a markdown file, and I wanted to use front matter to make a layout that each slide's file could use. I can include a markdown file, and get it to render by doing:
{% capture myInclude %}{% include_relative _slides/test.md %}{% endcapture %}
{{ myInclude | markdownify }}
However, when I add a front-matter block to it with a layout defined in it, the layout doesn't get applied. It just gets rendered as a horizontal line (for the first ---) and then "layout: slide title: Test Slide —" in plain text.
Is there any way to fix this? Or perhaps a better way to break up my index.html and the slides in it?
Thanks a lot!
Note: Sorry if this was asked before, I Googled everything I could imagine it would be called.
I found something that works for me. I divided my template in two parts, the part above the content, and the part under it. Then in the file I include, there are two includes as well, one at the top and one at the bottom.
So my 'slide' files look like this:
{% include slide_start.html title="About" image="images/about.jpg" %}
... the content of the slide ...
{% include slide_end.html %}
As you can see, in the first include I give some parameters, these will be filled in and can be accessed with the liquid tags {{ include.something }}.
My slide_start.html looks like:
<div class="slide">
<div class="header">
<span>{{ include.title }}</span><!-- no whitespace
--><img src="{{ include.image }}" alt="{{ include.title }}"/>
</div>
<div class="content" markdown="1">
the slide_end.html is just two closing div tags.
You're trying to mix the page/post and the include strategies.
Page/post have a front matter and are decorated with a template, which can itself be decorated. `mypage.html -> layout: page -> layout: default.
Includes are included in page/post but they are only code parts. They cannot be decorated with a template.
You will have to choose.
Take a lool at https://github.com/shower/jekyller this can be helpfull.
I am using Blade to include multiple sub-views into a single set of tabs in a blade app. All of the sub-views have the same overall structure (a sidebar and a main section). Because of this, I have created a template and each sub-view extends the template. Here is the structure:
Main.blade.php
<div id="tabs">
<ul>
#foreach($views as $view)
<li>{{$view}}</li>
#endforeach
</ul>
#foreach($views as $view)
<div id="{{$view}}">
#include($view)
</div>
#endforeach
</div>
template.blade.php
{{-- formatting stuff --}}
#yield('content 1')
{{-- more formatting stuff --}}
#yield('content-2')
{{-- more formatting stuff --}}
tab-*.blade.php
#extends('template')
#section('content-1')
This is tab [whatever number]
#stop
#section('content-2')
Lorem Ipsum
#stop
The obvious problem here is that, as each sub-view extends the same template, the #yield('content') exists 3 times, and all 3 included sub-views have their own #section('content'). What appears to be happening is that the first sub-view's implementation of the content section is getting placed in all 3 yields.
My intent here is obvious. I want each included sub-view to implement it's own instance of the template, place it's content in the content section, THEN get pulled into the main page. Can this be done?
If I flatten the tab-*.blade.php files and stop using the template, it works fine. The problem here is that I end up with a lot of code repetition that would be better placed in a template. This is an emergency option, but I'd like to do it the "proper" way.
NOTE
I have tried to redesign this to avoid the problem, but I really can't come up with another solution. While #include is typically used to pull in small, static pieces (a header, a footer, etc.), I have not read anything that states this as a restriction. It seems to me that the best approach is to store each view once and pull them into the main page when needed, so that's how I've designed it.
Try using the #overwrite command instead of #stop
Example:
#extends('template')
#section('content-1')
Stuff goes here...
#overwrite
#section('content-2')
More stuff goes here...
#overwrite
Source: https://github.com/laravel/framework/issues/1058#issuecomment-17194530
I came up with a hack that seems to work. In template.blade.php, I use the following:
{{-- formatting stuff --}}
#yield(isset($tab) ? "content-1-$tab" : 'content-1')
{{-- more formatting stuff --}}
#yield(isset($tab) ? "content-2-$tab" : 'content-2')
{{-- more formatting stuff --}}
Then, in main.blade.php, I execute #include('view', ['tab'=>$view]). This seems to cause each instance of content-1 and content-2 do be named distinctly, allowing the 2 subviews to implement the sections separately. This also should allow any other views that implement this template to continue to function without having to change anything.
I am learning joomla and faced the next problem.
Here is the main menu in HTML
<ul>
<li class="active">home</li>
<li>bio</li>
<li>news</li>
<li>projects<span class="ico"></span>
<div class="sub-nav">
<ul>
<li>yegor<br/>zabelov<br/>trio</li>
<li>gurzuf</li>
<li>soundtracks</li>
</ul>
</div><!-- .sub-nav -->
</li>
...
</ul>
How is it possible to customize the main menu in joomla to:
1. add the class .first-lev to some links
2. add the span inside the item with this class
3. add the wrapper div for sub navigation
Appreciate any help.
To add the class to the some links, just go to the admin panel, select your menu item. Go to the link type options->link CSS style, and add class manually.
You need to edit default_component.php or defaul_url.php
You need to edit default.php
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
To customize menu layout, just copy
/modules/mod_menu/tmpl
to:
/templates/your_template/html/mod_menu
And then customize the files you just copied. This files override system mod_menu files.
Don't forget to add:
<folder>html</folder>
at you templateDetails.xml.