Giter VIP home page Giter VIP logo

jupyter-themes's Introduction

jupyterthemes

Theme-ify your Jupyter Notebooks!

Author Version Status Demo
Kyle Dunovan image image Binder

Updates


Scaling Back Support:

As anyone who has opened a bug report or feature request in the last several years can attest, I have begun scaling back support for the jupyter-themes package - mostly due to my personal preference for using Jupyter Lab over Jupyter Notebook classic (see update below for two of my JupyterLab theme repos). Thank you to everyone who contributed to jupyter-themes.

JupyterLab Themes:

JupyterLab themes with similar style/design conventions to jupyter-themes:

JupyterLab v3.0
JupyterLab v4.0

JT Customizable Features

plotting style

image

markdown/equations

image

pandas dataframes

image

command palette

image

Links

Requirements

  • Python 3.4, 3.5, 3.6, 3.7 and 3.8
  • Jupyter (Anaconda recommended)
  • matplotlib

Install with pip

# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

Install with conda

# install jupyterthemes
conda install -c conda-forge jupyterthemes

# update to latest version
conda update jupyterthemes

Known issues

  • for best results: use notebook>=5.6.0 (pip install --upgrade notebook)
  • refreshing / removing / resetting: depending on your system, browser, etc., you may need to empty your browser cache after installing a new theme (-t) or attempting to restore the default (-r) in order for those changes to take effect. (see discussion here). At the very least you'll need to refresh your browser window (usually cmd+r or ctrl+r).
  • install issue: if you get an error saying jt is not recognized, try this fix.
  • slow render when scrolling: fix available here

Command Line Usage

jt  [-h] [-l] [-t THEME] [-f MONOFONT] [-fs MONOSIZE] [-nf NBFONT]
    [-nfs NBFONTSIZE] [-tf TCFONT] [-tfs TCFONTSIZE] [-dfs DFFONTSIZE]
    [-m MARGINS] [-cursw CURSORWIDTH] [-cursc CURSORCOLOR] [-vim]
    [-cellw CELLWIDTH] [-lineh LINEHEIGHT] [-altp] [-altmd] [-altout]
    [-P] [-T] [-N] [-r] [-dfonts]

Description of Command Line options

cl options arg default
Usage help -h --
List Themes -l --
Theme Name to Install -t --
Code Font -f --
Code Font-Size -fs 11
Notebook Font -nf --
Notebook Font Size -nfs 13
Text/MD Cell Font -tf --
Text/MD Cell Fontsize -tfs 13
Pandas DF Fontsize -dfs 9
Output Area Fontsize -ofs 8.5
Mathjax Fontsize (%) -mathfs 100
Intro Page Margins -m auto
Cell Width -cellw 980
Line Height -lineh 170
Cursor Width -cursw 2
Cursor Color -cursc --
Alt Prompt Layout -altp --
Alt Markdown BG Color -altmd --
Alt Output BG Color -altout --
Style Vim NBExt* -vim --
Toolbar Visible -T --
Name & Logo Visible -N --
Kernel Logo Visible -kl --
Reset Default Theme -r --
Force Default Fonts -dfonts --

Command Line Examples

# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jt -l

# select theme...
jt -t chesterish

# restore default theme
# NOTE: Need to delete browser cache after running jt -r
# If this doesn't work, try starting a new notebook session.
jt -r

# toggle toolbar ON and notebook name ON
jt -t grade3 -T -N

# toggle kernel logo.  kernel logo is in same container as name
# toggled with -N.  That means that making the kernel logo visible is
# pointless without also making the name visible
jt -t grade3 -N -kl

# set code font to 'Roboto Mono' 12pt
# (see monospace font table below)
jt -t onedork -f roboto -fs 12

# set code font to Fira Mono, 11.5pt
# 3digit font-sizes get converted into float (115-->11.5)
# 2digit font-sizes > 25 get converted into float (85-->8.5)
jt -t solarizedd -f fira -fs 115

# set font/font-size of markdown (text cells) and notebook (interface)
# see sans-serif & serif font tables below
jt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13

# adjust cell width (% screen width) and line height
jt -t chesterish -cellw 90% -lineh 170

# or set the cell width in pixels by leaving off the '%' sign
jt -t solarizedl -cellw 860

# fix the container-margins on the intro page (defaults to 'auto')
jt -t monokai -m 200

# adjust cursor width (in px) and make cursor red
# options: b (blue), o (orange), r (red), p (purple), g (green), x (font color)
jt -t oceans16 -cursc r -cursw 5

# choose alternate prompt layout (narrower/no numbers)
jt -t grade3 -altp

# my two go-to styles
# dark
jt -t onedork -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T
# light
jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T

Set Plotting Style (from within notebook)

jtplot.style() makes changes to matplotlib's rcParams dictionary so that figure aesthetics match those of a chosen jupyterthemes style. In addition to setting the color scheme, jtplot.style() allows you to control various figure properties (spines, grid, font scale, etc.) as well as the plotting "context" (borrowed from seaborn).

Note, these commands do not need to be re-run every time you generate a new plot, just once at the beginning of your notebook or whenever style changes are desired after that.

Pro-tip: Include the following two lines in ~/.ipython/profile_default/startup/startup.ipy file to set plotting style automatically whenever you start a notebook:

# import jtplot submodule from jupyterthemes
from jupyterthemes import jtplot

# currently installed theme will be used to
# set plot style if no arguments provided
jtplot.style()

jtplot.style() Examples

# import jtplot module in notebook
from jupyterthemes import jtplot

# choose which theme to inherit plotting style from
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jtplot.style(theme='onedork')

# set "context" (paper, notebook, talk, poster)
# scale font-size of ticklabels, legend, etc.
# remove spines from x and y axes and make grid dashed
jtplot.style(context='talk', fscale=1.4, spines=False, gridlines='--')

# turn on X- and Y-axis tick marks (default=False)
# turn off the axis grid lines (default=True)
# and set the default figure size
jtplot.style(ticks=True, grid=False, figsize=(6, 4.5))

# reset default matplotlib rcParams
jtplot.reset()

Monospace Fonts (code cells)

-f arg Monospace Font
anka Anka/Coder
anonymous Anonymous Pro
aurulent Aurulent Sans Mono
bitstream Bitstream Vera Sans Mono
bpmono BPmono
code Code New Roman
consolamono Consolamono
cousine Cousine
dejavu DejaVu Sans Mono
droidmono Droid Sans Mono
fira Fira Mono
firacode Fira Code
generic Generic Mono
hack Hack
hasklig Hasklig
inconsolata Inconsolata-g
inputmono Input Mono
iosevka Iosevka
liberation Liberation Mono
meslo Meslo
office Office Code Pro
oxygen Oxygen Mono
roboto Roboto Mono
saxmono saxMono
source Source Code Pro
sourcemed Source Code Pro Medium
sudovar Sudo Variable
ptmono PT Mono
ubuntu Ubuntu Mono

Sans-Serif Fonts

-nf/-tf arg Sans-Serif Font
opensans Open Sans
droidsans Droid Sans
exosans Exo_2
latosans Lato
ptsans PT Sans
robotosans Roboto
sourcesans Source Sans Pro

Serif Fonts

-nf/-tf arg Serif Font
loraserif Lora
ptserif PT Serif
georgiaserif Georgia
cardoserif Cardo
crimsonserif Crimson Text
ebserif EB Garamond
merriserif Merriweather
neutonserif Neuton
goudyserif Sorts Mill Goudy

jupyter-themes's People

Contributors

arbennett avatar dunovank avatar felixabrahamsson avatar franga2000 avatar fry95116 avatar gabrui avatar github-bdem avatar grburgess avatar hiro-o918 avatar hrbrmstr avatar jarrodchung-dev avatar jdguevara avatar jerbob avatar khdlr avatar lord-v15 avatar mheilman avatar miraculixx avatar odysseus0 avatar osamaar avatar parenthetical-e avatar pussinboot avatar raybuhr avatar rightx2 avatar rsokl avatar ryandvmartin avatar space-g avatar sv3ndk avatar tnilanon avatar vmuriart avatar zfb-blog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter-themes's Issues

Fonts not working

If you don't have fonts installed on computer, then Jupyter can't upload fonts to use them.

Suggestion: include fonts as part of package and @font-face them if not installed...

Conflicting with Vim Binding nbextentions

I've found some conflicting issues with VIM Binding nbextensions.
VIM Binding extension also changes Jupyter CSS and therefore it's difficult to read text in the selected cells.
By changing two background colors in VIM Binding CSS as shown

/* ~/Library/Jupyter/nbextensions/vim_binding/vim_binding.css */
.CodeMirror-dialog-bottom {
  position: absolute;
  width: 100%;
  bottom: 0;
  z-index: 100;
  color: #eee;
  background-color: #333;
}
.CodeMirror-dialog-bottom input {
  border: none;
  outline: none;
  color: inherit;
  background-color: inherit;
  width: calc(100% - 1em);
}
/* Jupyter cell is in normal mode when code mirror */
.edit_mode .cell.selected .CodeMirror-focused.cm-fat-cursor {
  /* background-color: #F5F6EB; DEFAULT */
  background-color: #293340; /* MODIFIED for chesterish*/
}
/* Jupyter cell is in insert mode when code mirror */
.edit_mode .cell.selected .CodeMirror-focused:not(.cm-fat-cursor) {
  /* background-color: #F6EBF1; DEFAULT */
  background-color: #293340; /* MODIFIED for chesterish */
}

could improve code readability. (This change is for chesterish, for example.)
Anyway, thanks for this great theme-changer!

  • before

before

  • after
    after

How to uninstall?

How I can uninstall whatever was installed via the pip command?

Note: I've already restored the default Jupyter theme using jt -r.

Uninstallation Instructions

Being relatively new to Jupyter I wanted a dark theme and this was the first I found, however I noticed that I lost my toolbar upon installation of this theme. I removed the css file from where I installed it to, but the theme has persisted. In the source for the webpage it still shows custom.css, does Jupyter copy this to another directory?

Can't change font size

I use the below code and have installed the Source-Code-Pro font, but it doesn't work.
jupyter-theme -T -t oceans16 -f Source-Code-Pro -fs 16

prompt input_prompt not aligned with cell

Hi,
using grade3 theme (I haven't tested others), the text in div prompt.input_prompt is not aligned with the text of the cell. This gets worse also when I change font size.
Maybe it's a padding problem. I attached a screenshot.

screenshot from 2016-10-06 11-43-26

Thanks,
Francesco

Themes seem to remove the "Upload" button

Here's the one I'm referring to, on Jupyter's main file tree page. After applying a theme, the "Upload" button disappears (although the "New" and refresh buttons remain)

image

Suggestion

This isn't so much of an issue, but a suggestion. I'm not sure if this is doable already, but it would be nice to set the cell width to be a % of the width, so it resizes dynamically when the window is resized. I've been using this code in my custom.css to do so(which I've found on the internet):

Make the notebook cells take almost all available width
.container {width: 99% !important;}

Prevent the edit cell highlight box from getting clipped; * important so that it also works when cell is in edit mode
div.cell.selected {border-left-width: 1px !important;}

I've just added it to the bottom of the custom.css made by jt and it works well.
Also I want to say thanks for this, it's really awesome!

Windows install issue

Heya Kyle,

Love the look of your themes but am having trouble installing them on Windows using Anaconda (2.4.0 64 bit). I'm running this in cmd.exe but I've also tried it using Git Bash (2.7.0 64 bit) with the same result.

>pip install git+https://github.com/dunovank/jupyter-themes.git
Collecting git+https://github.com/dunovank/jupyter-themes.git
  Cloning https://github.com/dunovank/jupyter-themes.git to c:\users\matt~1.tre\appdata\local\temp\pip-hmy4xr-build
Collecting sh (from jupyter-themes==0.1)
  Using cached sh-1.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "c:\users\matt~1.tre\appdata\local\temp\pip-build-v_m6bu\sh\setup.py", line 4, in <module>
        import sh
      File "sh.py", line 37, in <module>
        support." % __version__)
    ImportError: sh 1.11 is currently only supported on linux and osx. please install pbs 0.110 (http://pypi.python.org/pypi/pbs) for windows support.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\matt~1.tre\appdata\local\temp\pip-build-v_m6bu\sh

But pbs is already installed and appears to be the correct version:

>pip install pbs
Requirement already satisfied (use --upgrade to upgrade): pbs in c:\anaconda\lib\site-packages

>pip show pbs

---
Metadata-Version: 2.0
Name: pbs
Version: 0.110

I've only take a quick look but here's what seems to be happening...hoping you can shed more light on this!

So, although the documentation doesn't mention platform compatibility, the internet seems to suggest (1, 2, 3) that sh.py doesn't support Windows. It seems that the installer is aborting as soon as it detects that we're trying to install a non-Windows supported module on Windows.

I think using pbs as an alternative is a red herring; the project is no longer supported. And you'd have to change your code to use pbs anyway.

However, it seems that the only use of sh here is for cp (in __init__.py). You're already using shutil - which is cross-platform - and also contains a copy function. Would you be able to change to using shutil.copy instead of sh.cp?

Install Problem

I am trying to get this running on recently upgraded Jupyter running on OS X El Capitan. I run into an issue when installing themes, below is what I did.

$ pip install git+https://github.com/dunovank/jupyter-themes.git
Collecting git+https://github.com/dunovank/jupyter-themes.git
  Cloning https://github.com/dunovank/jupyter-themes.git to /var/folders/hm/zl8d4mkx6vn19xwvdgrgx79r0000gn/T/pip-W4cyJY-build
Requirement already satisfied (use --upgrade to upgrade): sh in /usr/local/lib/python2.7/site-packages (from jupyter-themes==0.1)
Installing collected packages: jupyter-themes
  Running setup.py install for jupyter-themes
Successfully installed jupyter-themes-0.1
$ jupyter-theme -J -T -t oceans16-bright
Installing oceans16-bright at /Users/pedro/.ipython/profile_default/static/custom
Enabling toolbar
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-theme", line 9, in <module>
    load_entry_point('jupyter-themes==0.1', 'console_scripts', 'jupyter-theme')()
  File "/usr/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 128, in main
    install_theme(args.theme, profile=args.profile, toolbar=args.toolbar, jupyter=args.jupyter)
  File "/usr/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 76, in install_theme
    themefile.writelines(lines)
IOError: [Errno 9] Bad file descriptor
$ echo "Try to Install on pip3 this time just in case that matters"
$ pip3 install git+https://github.com/dunovank/jupyter-themes.git
Collecting git+https://github.com/dunovank/jupyter-themes.git
  Cloning https://github.com/dunovank/jupyter-themes.git to /var/folders/hm/zl8d4mkx6vn19xwvdgrgx79r0000gn/T/pip-692xdmoy-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/var/folders/hm/zl8d4mkx6vn19xwvdgrgx79r0000gn/T/pip-692xdmoy-build/setup.py", line 5, in <module>
        from jupyterthemes import THEMES_PATH
      File "/private/var/folders/hm/zl8d4mkx6vn19xwvdgrgx79r0000gn/T/pip-692xdmoy-build/jupyterthemes/__init__.py", line 34
        print "Profile %s does not exist at %s" % (profile, actual_path)
                                              ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /var/folders/hm/zl8d4mkx6vn19xwvdgrgx79r0000gn/T/pip-692xdmoy-build

Seems like its probably something pretty simple that I don't know about

add minimal tests

released versions (e.g v0.9.1) and master have a series of bugs that prevents install the new theme. (e.g TypeError due to string format #31,). May be you can add travis continuous integration for different python versions?

Unclear instructions about missing toolbar

Okay, I've installed jupyter-themes, picked a theme and installed, launched my notebook... toolbar's gone.

Someone had the same problem, anf you said they needed to add some lines. You've also mentioned it in the Readme file, but before installation or anything else instructions. Whyyyy

I've also commented lots of lines with div#maintoolbar {display: none !important;}, but it didn't help.

I'm going to do something about the instructions, if you help me with understanding wtf is going on, I'll be happy ๐ŸŽˆ ๐Ÿ˜„

jupyterthemes==0.9.1 doesn't work for me

Hi no idea whats wrong, i have win7 + python 3

Traceback (most recent call last):
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Dev\Local\env\tools\Miniconda\envs\nb\Scripts\jt.exe\__main__.py", line 9, in <module>
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\jupyterthemes\__init__.py", line 207, in main
    install_theme(args.theme, monofont=args.monofont, monofontsize=args.monofontsize, nbfontfamily=args.nbfontfamily, tc
fontfamily=args.tcfontfamily, cellwidth=int(args.cellwidth),  lineheight=int(args.lineheight), altlayout=args.altlayout,
 toolbar=args.toolbar)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\jupyterthemes\__init__.py", line 175, in install_them
e
    style_css += compile_less2css(style_less)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\jupyterthemes\__init__.py", line 46, in compile_less2
css
    style_css = lesscpy.compile(less_tempfile, tabs=True)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\__init__.py", line 18, in compile
    p.parse(file=file)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\parser.py", line 156, in parse
    self.post_parse()
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\parser.py", line 168, in post_parse
    out.append(pu.parse(self.scope))
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\block.py", line 43, in parse
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\block.py", line 43, in <listcomp>
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\property.py", line 39, in parse
    self.parsed = self.process(style, scope)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\node.py", line 49, in process
    for t in tokens]
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\node.py", line 49, in <listcomp>
    for t in tokens]
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\plib\call.py", line 58, in parse
    result = getattr(color, name)(*args)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\color.py", line 237, in lighten
    return self._ophsl(color, diff, 1, operator.add)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\color.py", line 428, in _ophsl
    return self._rgbatohex(color)
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\color.py", line 398, in _rgbatohex
    for h in rgba]
  File "c:\dev\local\env\tools\miniconda\envs\nb\lib\site-packages\lesscpy\lessc\color.py", line 394, in <listcomp>
    return '#%s' % ''.join(["%02x" % v for v in
TypeError: %x format: an integer is required, not float

conda-forge package?

This looks like a really slick project. It would be great to have a conda package available for it from conda-forge! Thanks in advance

How to change code font in the theme?

I tried to change the .CodeMirror part of custom.css, but seems the font in the web does not change.
.CodeMirror pre {
font-family: 'Monaco';
font-size: 13pt;
}

Adding solarized-light theme

Hi,

Thanks for developing jupyter-themes, that's a very nice little tool!

I forked your repo and started working on a port of the Solarized-light theme of Ethan Schoonover.

Would you welcome a PR from me contributing this theme to your project (if yes, I'll also contact Ethan Schoonover to see how he feels about that)?

I'm not completely finished yet but the current result looks pretty good already, IMHO:

image

image

image

Please let me know what you think

Don't include fonts in package

Let's be real. There are way to many fonts in here that are really just not needed.

$ du -ch $(find . -name "*.*f")
[...]
14M	total

$ du -sh .
16M	.

(from within a conda package I built)

I suggest making another repository to contain the fonts and when the user wants them it will pull specific fonts from that directory...

jt --theme should create destination directory

Great package. Hit one small speed bump getting it working - would be helpful to add a check to see that destination directory exists.

tom$ jt -t oceans16
Traceback (most recent call last):
  File "/Users/tom/anaconda/bin/jt", line 11, in <module>
    sys.exit(main())
  File "/Users/tom/anaconda/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 129, in main
    install_theme(args.theme, toolbar=args.toolbar, fontsize=int(args.fontsize), font="'"+args.font+"'")
  File "/Users/tom/anaconda/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 41, in install_theme
    shutil.copy(source_path, customcss_path)
  File "/Users/tom/anaconda/lib/python2.7/shutil.py", line 119, in copy
    copyfile(src, dst)
  File "/Users/tom/anaconda/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 2] No such file or directory: '/Users/tom/.jupyter/custom/custom.css'

tom$ mkdir -p /Users/tom/.jupyter/custom

tom$ jt -t oceans16
Installing oceans16 at /Users/tom/.jupyter/custom

Cannot reset the theme

I am on OS X 10.11.4 with Python 3.5.

Installed the theme according to the instructions. Tried it, didn't like it. Wanted to reset according to the instructions. Didn't work. Removed .ipython and .jupyter folders from home directory. Theme (grade3) still persists. Any ideas? Thanks!

Problem with temp file when using vimext

I get this error when trying to set a profile with the vim extension enabled:

$ jt -t onedork -vim
Traceback (most recent call last):
  File "/home/user/virtualenvs/ros2/bin/jt", line 11, in <module>
    sys.exit(main())
  File "/home/user/virtualenvs/ros2/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 74, in main
    install_theme(args.theme, monofont=args.monofont, monosize=args.monosize, nbfont=args.nbfont, nbfontsize=args.nbfontsize, tcfont=args.tcfont, tcfontsize=args.tcfontsize, cellwidth=int(args.cellwidth), margins=args.margins, lineheight=int(args.lineheight), cursorwidth=args.cursorwidth, cursorcolor=args.cursorcolor, altlayout=args.altlayout, altprompt=args.altprompt, hideprompt=args.hideprompt, vimext=args.vimext, toolbar=args.toolbar, nbname=args.nbname)
  File "/home/user/virtualenvs/ros2/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 42, in install_theme
    stylefx.remove_temp_files(vimext=vimext)
  File "/home/user/virtualenvs/ros2/local/lib/python2.7/site-packages/jupyterthemes/stylefx.py", line 69, in remove_temp_files
    os.remove(vimtemp)
OSError: [Errno 2] No such file or directory: '/home/user/virtualenvs/ros2/lib/python2.7/site-packages/jupyterthemes/vimtemp.less'

This is with jupyterthemes version 0.13.3 and python 2.7.12. A consequence of this is that the theme is set, but cannot be removed correctly, because some css changes remain in the ~/local/share/jupyter/nbextensions/vim_bindings.css after a jt -r.

Toggling toolbar and cell width resets each other

Here is what I did:

  1. I don't want the cells to be very wide, so I use jt -t oceans16 -cellw 700.
  2. I want the toolbar, so use jt -t oceans16 -T.

Whichever got typed in later cancels the effect of the other. Can they not be set together? Thanks!

2 issues

I've found 2 new issues.

On Windows at least, when the css file tries to find the fonts in fonts\... it can't, because \ is an escape character (I think). I had to manually add another \ for the fonts to work.

When editing text files, the theme doesn't work quite well. The areas around the cell are still white. This is what I get:
2016-11-09 20_02_43-study md

IOError: [Errno 2] No such file or directory: 'C:\\Users\\xxx/.ipython/profile_default/static/custom/theme.css'

C:\Users\xxx\Desktop>jupyter-theme -T -t oceans16
Enabling toolbar
Traceback (most recent call last):
  File "D:\Python27\Scripts\jupyter-theme-script.py", line 9, in <module>
    load_entry_point('jupyter-themes==0.1', 'console_scripts', 'jupyter-theme')()
  File "d:\python27\lib\site-packages\jupyterthemes\__init__.py", line 154, in main
    install_theme(args.theme, profile=args.profile, toolbar=args.toolbar, fontsize=str(args.fontsize), update_properties
=update)
  File "d:\python27\lib\site-packages\jupyterthemes\__init__.py", line 77, in install_theme
    shutil.copy(source_path, themecss_path)
  File "d:\python27\lib\shutil.py", line 119, in copy
    copyfile(src, dst)
  File "d:\python27\lib\shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 2] No such file or directory: 'C:\\Users\\xxx/.ipython/profile_default/static/custom/theme.css'

I think because profile_default don't have child folder.
Need create static/custom/ first.

TypeError: %x format: an integer is required, not float

I'm getting the TypeError when trying to install oceans16.

Here is the full dump:

$ jt -t oceans16 -alt -fs 10 -cw 900
Installing oceans16 at /home/jwfu/.jupyter/custom/custom.css
Traceback (most recent call last):
  File "/home/jwfu/anaconda3/bin/jt", line 11, in <module>
    sys.exit(main())
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/jupyterthemes/__init__.py", line 109, in main
    install_theme(args.theme, monofont=args.monofont, monosize=args.monosize, nbfontfam=args.nbfontfam, tcfontfam=args.tcfontfam, cellwidth=int(args.cellwidth),  lineheight=int(args.lineheight), altlayout=args.altlayout, toolbar=args.toolbar)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/jupyterthemes/__init__.py", line 78, in install_theme
    style_css += less_to_css(style_less)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/jupyterthemes/__init__.py", line 37, in less_to_css
    style_css = lesscpy.compile(tempfile)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/__init__.py", line 18, in compile
    p.parse(file=file)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/parser.py", line 156, in parse
    self.post_parse()
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/parser.py", line 168, in post_parse
    out.append(pu.parse(self.scope))
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/block.py", line 43, in parse
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/block.py", line 43, in <listcomp>
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/property.py", line 39, in parse
    self.parsed = self.process(style, scope)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/node.py", line 49, in process
    for t in tokens]
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/node.py", line 49, in <listcomp>
    for t in tokens]
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/plib/call.py", line 58, in parse
    result = getattr(color, name)(*args)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/color.py", line 237, in lighten
    return self._ophsl(color, diff, 1, operator.add)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/color.py", line 428, in _ophsl
    return self._rgbatohex(color)
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/color.py", line 398, in _rgbatohex
    for h in rgba]
  File "/home/jwfu/anaconda3/lib/python3.5/site-packages/lesscpy/lessc/color.py", line 394, in <listcomp>
    return '#%s' % ''.join(["%02x" % v for v in
TypeError: %x format: an integer is required, not float

cellw does not take percentage as input

jt -t onedork -m 100 -T -N -cellw 100%
won't work as 100% is not an valid parameter

I need to manually search and replace the cellw value from 980px to 100% (.jupyter/custom/custom.css) to enable jupyter notebook to auto adjust its width based on the browser size.

It is an important and useful feature to have.

File name field missing

Themes disable the Jupyter header with the file name field--makes it impossible to rename the notebook. Is there a way to enable this?

Font directories missing

Just upgraded to the recent version, now fonts are missing that previously worked.

'IOError: [Errno 2] No such file or directory: 'C:\Users\zeste.jupyter\custom\fonts\droidmono\droid-sans-mono.woff''

The C:\Users\zeste.jupyter\custom\fonts is empty (not sure if it was before the upgrade)

widget is not shown

Hi,

I got trouble with v0.11.8. Our widget is not shown.

no_widget

The display is similiar to this: #35

relayout

When exporting to HTML with nbconvert, syntax highlighting is not preserved

One can convert notebooks to HTML with the command:

$ jupyter nbconvert notebook.ipynb

Strangely enough, the CSS for the cells, titles, etc. is preserved in the output, but not the CSS responsible for the syntax highlighting. Instead, the IPython default is used, which doesn't pair well with the other themes.

Do you have any clues for the fact that some CSS is exported and some is not? Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.