Add support to user less/precompiled themes #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 owncustom.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 injt -l
. Also notice the filejdark.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: