Fix jupyter notebook toolbar with jupyterthemes and table of contents - jupyter-notebook

I'm running a jupyter notebook after having changed the theme this way
!jt -t oceans16 -T -N -kl
Now the toolbar appears but it overlaps with the code and table of contents. If I scroll down the notebook it keeps hiding the first cells and the table of contents:
This stops once I revert to default
!jt -r
as you can see from here:
Is it a problem from my settings of jupytherthemes or in the table of content from nbextension?

For me, the Table of contents and jupyter notebook is overlapping each other. For your case, try using the code below. You can play with 70% value to get perfect match for your screen.
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:70% !important; }</style>"))

Code in ~/.jupyter/custom/custom.css overwrites the default settings with those by jupyter themes.
The default jupyter settings don't have the overlapping toolbar problem.
The code section below seems to be causing the problem. Simply comment this section out as shown.
/*
div#maintoolbar {
position: absolute;
width: 90%;
margin-left: -10%;
padding-right: 8%;
float: left;
background: transparent !important;
}
#maintoolbar {
margin-bottom: -3px;
margin-top: 0px;
border: 0px;
min-height: 27px;
padding-top: 2px;
padding-bottom: 0px;
}
#maintoolbar .container {
width: 75%;
margin-right: auto;
margin-left: auto;
}
*/

The answer to - how to revert to normal.
When Jupyter note is started, don't run the above command and it will return to normal. M
Moreover, you can run code like - display.max_columns to 'None' to run to default.
%matplotlib inline
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', 100)

In your ~/.jupyter/custom folder, edit the custom.css file and remove the line: position:absolute; under div#maintoolbar {. This should set the toolbar to be the same as it is under the default Jupyter theme.
I also untick the options "Widen the display area to fit browser window" and "Move notebook's title and menu on the left instead of being centered" in the Nbextensions' Table of Contents options. Personally I find that gives me a better look when using Table of Contents with the toolbar.

Related

Wrong CSS positioning with Chrome/Edge when using columns

Yesterday I discovered a layout issue with Chrome and Edge that doesn't show up in the Samsung Internet Browser and didn't exist before. The problem only occurs when using columns. Here's my CSS:
.div_columns {
width:500px;
column-count: 2;
column-gap: 20px;
}
.card {
height: 32px;
padding: 5px;
background-color: #f0f0f0;
margin-bottom: 8px;
}
.div_buttons {
position: relative;
height: 34px;
min-width: 50px;
float: right;
text-align: right;
background-color: #808080;
padding-top: 18px;
box-sizing: border-box;
}
.button {
position: absolute;
right: 1px;
top: 1px;
width: 16px;
height: 16px;
background-color: #f3f3f3;
}
And here is my HTML:
<div class="div_columns">
<div class="card"><div class="div_buttons"><div class="button"></div></div></div>
<div class="card"><div class="div_buttons"><div class="button"></div></div></div>
<div class="card"><div class="div_buttons"><div class="button"></div></div></div>
<div class="card"><div class="div_buttons"><div class="button"></div></div></div>
</div>
The output looks like this, and as you can see there appears to be only one button instead of four. But they all appear to be in the same position. Like I said at the start, this problem seems to be browser and use of columns related. So what is wrong here?
Another annoying thing I want to mention is that when I use Microsoft Edge's developer tools (F12) and want to copy a CSS rule by right-clicking, the developer tools close after that. This has not happened with Edge before and is not happening with Chrome.
I successfully restored these buttons to regular position by adding display:inline-block to the div_columns class.
As to the copy rule issue, I found it in my devtools, too. The only conclusion I've got is that if you right-click inside the braces {}, the context menu looks like below. The "Copy rule" option here works as expected:
But if you right-click outside the braces, the context menu changes like below. The "Copy rule" option here will lead to a crash of devtools (actually any option here will lead to a crash). But what's more interesting is that the style rule will still be on your clipboard. So I suggest sending a feedback to Edge team by pressing Shift+Alt+I in Edge:
In a situation like this i would just try to disable position relative position absolute and float right, and ill write something inside the buttons
i'd disable evrything till i find whats the problem

How to get Algolia docsearch popup showing on top of Sphinx docs content?

I have a Sphinx docs site and wanted to add Algolia Search support. Everything works great except that the Algolia docsearch popup is showing behind my Sphinx content panel. Very similar problem was reported here: https://github.com/algolia/docsearch/issues/130 but that solution didn't work for me.
I created this codepen sandbox to replicate the issue:
https://codepen.io/adolfo1981/pen/LYbEEme
When you start typing in the search box, the Algolia popup shows behind my content panel on the right.
This is the referenced CSS for Algolia docsearch: https://cdn.jsdelivr.net/npm/docsearch.js#2.6.3/dist/cdn/docsearch.min.css
I tried all combinations with these CSS settings as recommended here https://github.com/readthedocs/sphinx_rtd_theme/issues/761 but nothing worked:
.wy-nav-side { overflow: visible; }
.wy-side-scroll { overflow: auto; }
I also tried changing z-index for multiple CSS classes but no luck.
Hope someone can help me with this.
Here is the link to Algolia docsearch dropdown:
https://docsearch.algolia.com/docs/dropdown
UPDATE: Based on #triddle suggestion I modified this class in docsearch.css changing position from relative to fixed seemed to do the trick:
.algolia-autocomplete .ds-dropdown-menu [class^='ds-dataset-'] {
position: fixed;
border: solid 1px #d9d9d9;
background: #fff;
border-radius: 4px;
overflow: auto;
padding: 0 8px 8px;
}
For the css class .ds-dataset-1 add position: fixed;

Chrome -- CSS -- Extra spacing

Can anyone look at this template and explain why only in Chrome that it adds a whole lot of extra space at the top of the page?
https://html5up.net/uploads/demos/verti
Update:
Actually, I just discovered that when I'm logged into my work Google account (in the browser as a whole), it adds the extra spacing at the top. When I'm just generally using Chrome (guest mode), it does NOT add the extra space at the top. All on the same computer at my house. Different results depending on if I'm logged in or not. Is there an explanation for this?
Padding for the #header-wrapper element, has the following CSS (main.css - line 1839). This equates to a padding-top: 66px in Chrome...
#header-wrapper {
padding: 4.5em 0 1em 0;
padding-top: 4.5em;
padding-right: 0px;
padding-bottom: 1em;
padding-left: 0px;
}
This would be simple to remove or override, if you needed to... e.g.
#header-wrapper {
padding-top: 10px !important;
}

How to Edit the Styles For an Installed WordPress Slider Plugin With CSS?

I installed a free responsive image slider plugin, Slider by WD, for my WordPress theme, and I need to edit the styles. Specifically, I can see that I need to edit the class .wds_slideshow_image_wrap_0:
You can see that I need the width of this div to span 100% of the width of its parent container wds_container2_0:
I need for the max-width: 800px; style that's applied to .wds_slideshow_image_wrap_0 to go away, so I tried to copy and paste the styles for this class into my stylesheet, and commented out max-width: 800px;. But as you can see this is having no effect.
When scrolling up, in the Styles tab of the inspector, I notice that the source file / line for these styles is at (index):101
Since I can't edit the styles when doing this in my stylesheet:
#wds_container1_0
#wds_container2_0
.wds_slideshow_image_wrap_0 {
background-color: rgba(0, 0, 0, 0.00);
border-width: 0px;
border-style: none;
border-color: #000000;
border-radius: ;
border-collapse: collapse;
display: inline-block;
position: relative;
text-align: center;
width: 100% !important;
/* max-width: 800px; */
box-shadow: ;
overflow: hidden;
z-index: 0;
}
how can I access this index file to change the width of this div to match the width of its parent container? Thanks!
EDIT: In WordPress, the index.php file that you see in the browser is the combination of other the files - header.php, footer.php, front-page.php (or page.php depending on your setup), and maybe sidebar.php. So you can't search for elements in index.php - that file is not the same as what's getting rendered in the browser.
Instead, SSH into your server and do a grep command in the terminal to search for the element in question:
https://mediatemple.net/community/products/dv/204403684/connecting-via-ssh-to-your-server
https://www.siteground.com/tutorials/ssh/searching/
You can overide the styles through your style sheet. By targeting a custom container in which the style is or by using !important(which is not advisable)
FOr example to target this "#wds_slideshow_image_wrap_0" ? you can use
body #wds_container2_0 .wds_slideshow_image_wrap_0 {
/**your code**/
max-width: 100%;
}
OR
body #wds_container2_0 div.wds_slideshow_image_wrap_0 {
/**your code**/
max-width: 100%;
}
copy the above code to you style sheet

Change logo position in Joomla

I'e been using joomla default template: Protostar. From template manager I set a logo and it appears at the left top of each page. How can I shift the logo 100px right?
I'm running joomla 3.2.1 in localhost.
Go to the following file:
root/templates/protostar/css/template.css
Search for the logo and edit or add the following:
#logo {
position: relative;
left: 100px;
}
or on line 6936, you will find the .site-title { } block, which you can replace with the following:
.site-title {
font-size: 40px;
font-weight: bold;
left: 100px;
line-height: 48px;
position: relative;
}
In future, start getting used to your browser console and start inspecting elements. If you're using Firefox, then I would recommend using Firebug.

Resources