How to enable fully expanded breadcrumbs with Sphinx RTD and AutoAPI? - python-sphinx

I'm experimenting with the Sphinx AutoAPI to make docs more maintainable. It's doing a great job, except for one thing: breadcrumbs.
Within the docs generated by AutoAPI, breadcrumbs don't work as I'd expect. Instead of adding a linked item at each depth, we get “Docs >> ”, followed by a single linked item.
This is a usability a problem, because you can’t navigate back up to a parent article after clicking into a child.
Note: I'm using the sphinx_rtd_theme, with a custom extrabody block for the header.
I haven't been able to find any documentation for the breadcrumbs in sphinx_rtd_theme.
Before diving into source code, I thought I'd ask if anyone else has seen/fixed this issue before. Thanks!
PS: You can see a draft PR for this work here: https://github.com/great-expectations/great_expectations/pull/1582

Thanks to Steve Piercy for a his helpful tip from the Pyramid project!
I added these lines at the end of my index.rst to activate breadcrumbs.
.. toctree::
:maxdepth: 2
autoapi/index
The breadcrumb links were still formatted like inline code, so I hacked my _static/style.css file like so:
ul.wy-breadcrumbs li code span.pre{
font-size: 16px;
font-family: HKGroteskPro, serif;
font-weight: 400;
color: rgb(155, 89, 182);
}
This styling isn't perfect, but close enough to not be jarring.

Related

Feature or Extension to Jump over specific line from comment summary in Visual Studio or VS Code

While working on different big .NET and Angular projects, I saw sometimes CSS or JS code becomes to lengthy in single file. At that time we have to scroll so much time find piece of code to modify. We usually give comment to differentiate CSS or JS section something like below.
/************************************************************/
/* Update By Contactor 1 : 30-4-2019 : New Style for Profile*/
/************************************************************/
body {
font-size: 16px;
font-weight: normal;
font-family: 'Open Sans', sans-serif;
}
but it still difficult find comment and react to particular section.
I have simple section, is it possible to reach to particular line in CSS or JS in Visual Studio or VS Code from Comment summary.
Eg.
/* Colors */
/* Pink: #ed1849 */
/* Blue: #006aad */
/*Style for Profile Page*/
/*Style for Order Page*/
/*Style for Review Page*/
like clicking on any above comment can scroll to particular section. I
know about Ctrl + G in built feature to jump to particular line,
but for it I need to aware about line number which is difficult to
track for large file
You need to have a unique comment line preceding a code section, like
/* <Style for Profile> */
Then you can search for it from comment summary or use my Favorite Documents extension for VS to add these lines to favorites.

Adblock. Add css class or remove attribute from element

Is it possible to add css rule to an element at some page by adblock?
Something like this
#myElement {
color: white !important;
}
I tried to find a script that updates style of this element on page load but it seems that it is not a best way.
It's possible to do it on uBlock Origin and Adguard (as far as I know). Each has its own syntax for the styling rules, but uBlock is capable understanding both.
Here is an example of a CSS rule that changes Twitter background:
twitter.com#$#body.logged-in{ background-color: #8c8787 !important; }
The styling filters should be constructed like this:
<domain> + #$# + <selector> + { <style> }
Just avoid puting a space between the selector and the opening brace. Cause it can give you some trouble. Reference:
https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#style
https://adguard.com/en/filterrules.html#cosmetic-css-rules
The other answers weren't working for me but there is a way to change an element's style:
example.com##h1:style(background-color: blue !important)
Make sure not to use curly brackets.
There is also some documentation on GitHub.
EDIT: As BeeLabeille mentioned this advice seems specific to uBlock.
I don't think it's possible for AdBlock to change CSS properties, you can use an extension like Stylish (available for Firefox and Chrome) to do just that though.
For AdBlock Plus, you can try this:
##.ytp-pause-overlay, .ytp-scroll-min
##.html5-endscreen, .ytp-player-content, .videowall-endscreen, .ytp-endscreen-paginate, .ytp-show-tiles
##.ytp-endscreen-content
This should disable the display of ads during the pause, and recommended videos, at the end of the video.
PS: Ah.. this is not the subject of the question.. this removes the class from the div element. Well, maybe someone will come in handy, to delete unnecessary blocks in the Youtube player.

Add inline css style to JHTML_ (joomla) object

I don't have a lot of experience with Joomla and I'm sure how this will be a really simple question to someone who was work in Joomla before.
I'm working on existing project where I need to add inline css style to elements which are created on this way:
JHTML::_('grid.sort', $name[$id], 'a.'.$name[$id], $this->listDirn, $this->listOrder)
So I need something like this:
JHTML::_('grid.sort', $name[$id], 'a.'.$name[$id], $this->listDirn, $this->listOrder, 'style: height 500px; color: blue;')
Thanks in advance
Every kind of help will be appreciated
There is no way to pass styles to the sort element directly as you can see here in the code
https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/html/grid.php#L74.
What you can do is to add the style on the document directly:
JFactory::getDocument()->addStyleDeclaration('#myelement {height 500px; color: blue;}');
perhaps you want to add !important to the style to enforce it.

In Firefox, when printing a page with anchor tags, the link location is printing after the text

For example,
Text Here
will print out as...
Text Here(../somepage/page.aspx?qs=asdf)
In IE, it looks normal (doesn't print the url). Any ideas why this is acting in this fashion?
Extrapolating from Brett's answer, on Firefox 25, this CSS style removes the offending href:
#media print {
a:link:after,
a:visited:after {
content: "" !important;
}
}
Also, if you're using Twitter Bootstrap as a framework, this:
a[href]:after{
content:"";
}
... will do the trick! (at least in bootstrap 3)
The answer was in the css framework we are using (Blueprint). There was the below line in the style file:
a:link:after,a:visited:after{content:"(" attr(href) ")";font-size:90%}
Guess this might help others who use Blueprint.
If you want to to be more specific - say remove links within a table, then you could do the following with jQuery.
$(".tableclass tr td a").removeAttr("href");
Just add this in your layout page (Master Page)
a[href]:after {
content: none !important;
}
There is also the semantic reason to print the url next to the link.
Imagine you print the document without the url. You cannot be sure to completely understand the text as it is meant by the author.
It can be necessary for a quote to print the source as well. That is important i.e. for academic texts.
Indeed Bretts answer is correct.
You can avoid this problem altogether on the screen by including the media attribute on the print style link as follows
<link href="../../Content/blueprint/print.css" rel="stylesheet" media="print" type="text/css" />

Finding a blog site with good code block support

This has probably been asked before but I can't find any relevant post using the search system.
I'm looking for a site where I could host my own blog. Unfortunately, I found none that have the kind of code block friendliness found on our very own stackoverflow (not one where you have to manually convert < and > into < and >).
If the answer is "there is none, duh!", and I am condemned to install my own blog software, then which one should I use for a "coder blog" -- knowing that I'd like it to be ultra-simple to set up.
Thanks.
I use a combination of BlogEngine.NET, Windows Live Writer and a WLW extension to format/place the code block in my blog.
Scott Hanselman has a blog post about this topic here.
There is a pretty sweet client-side (jQuery-based) code formatter here that you also might want to check out, that sounds blog-software agnostic.
I use appengine and bloog mostly because of this feature (and because I can extend it anyway I want). The good thing is it's relatively easy to set up and free. If your blog makes enough traffic to go over the limit for free accounts chances are you can get your money back from it.
I was pulling my hair out trying to format code on Blogger until I found this handy utility. It's not a perfect solution, but it goes a long way.
This css script might be useful to all - It is not for syntax highlighting but works well for presenting the source code in original format :
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;
color: #000000; background-color: #eee;
font-size: 12px; border: 1px dashed #999999;
line-height: 14px; padding: 5px;
overflow: auto; width: 100%">
<code style="color:#000000;word-wrap:normal;">
<<<<<<<YOUR CODE HERE>>>>>>>
</code>
</pre>
How to use :
Paste this snippet in text editor,
paste your code in <<<<<<>>>>>> block.
Copy all and
paste to HTML view in blogger(or any other) post editor.
BENEFITS : Simple and easy to use, less configuration, easy to reconfigure, no extra software

Resources