Skip to content
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

Add support to user less/precompiled themes #82

Merged
merged 11 commits into from
Dec 14, 2016

Conversation

osamaar
Copy link
Contributor

@osamaar osamaar commented Dec 11, 2016

Hey!

These changes add the ability to use local themes from user's home directory the same way packaged themes are used. The directory structure of site-packages/jupyterthemes can be reflected in ~/.jupyter-themes and extra/modified styles can be dropped there.

I also added the functionality of installing themes available in compatible css from either user (if user config dir exists) or packaged themes directory.

If both .less and .css versions of a certain theme exist, the .less version is used. If a theme exists as both a user theme and a global theme, the user theme is used. This came in handy when I wanted to slightly modify one of the packaged thems, I copied the .less file with the same file name to my own user themes directory and modified it without touching the one installed with the package. Now I can switch themes and keep my customizations (no need to edit jupyter's own custom.css).

The following demonestrates the usage with the new functionility. Notice that oceans16.less file exists in my user configuration directory and overshadows the original in jt -l. Also notice the file jdark.css which is a css only theme i got from the repo: powerpak/jupyter-dark-theme. You can see the result of installing it in the screenshot below.

$ jt -l
Available Themes: 
   chesterish    (global)
   grade3        (global)
   jdark         (user, precompiled)
   oceans16      (user)
   onedork       (global)

$ tree ~/.jupyter-themes
/home/me/.jupyter-themes
└── styles
    ├── compiled
    │   └── jdark.css
    └── oceans16.less

2 directories, 2 files
$ jt -t jdark
$ jupyter-notebook

Result:
jupyter-dark-css-screenshot

@dunovank dunovank merged commit c3adc4a into dunovank:master Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants