Skip to content

Commit

Permalink
Merge pull request #6 from mpharrigan/master
Browse files Browse the repository at this point in the history
Revamp msmb_theme to use sphinx's inheritance mechanism
  • Loading branch information
mpharrigan committed Nov 3, 2015
2 parents d969b71 + 5c62ed3 commit 9757984
Show file tree
Hide file tree
Showing 32 changed files with 1,783 additions and 12,789 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ versioneer.pyc
dist
build
__pycache__
*.pyc
*.pyc
.idea/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "notebook"]
path = notebook
url = https://github.com/jupyter/notebook.git
6 changes: 1 addition & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include *.txt
include LICENSE
recursive-include msmb_theme *.conf
recursive-include msmb_theme *.css
recursive-include msmb_theme *.eot
recursive-include msmb_theme *.html
recursive-include msmb_theme *.js
recursive-include msmb_theme *.svg
recursive-include msmb_theme *.ttf
recursive-include msmb_theme *.woff
include setup.cfg
include versioneer.py
include msmb_theme/_version.py
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
`msmb_theme`
============

This applies slight modifications to `sphinx_rtd_theme`. It needs the
aforementioned theme to be installed.

### Modifications

- Styling tweaks in `msmb.css`
- Styling for Jupyter notebooks

### Jupyter CSS

Jupyter css is committed to this repository. It is slightly modified from
the upstream stylesheet. You can regenerate `jupyer.min.css`:

- Ensure the `notebook/` submodule is initialized.
- Apply `wrap-notebook-css.patch` to it.
- Run `compile_jupyter_less.py` to turn the patched `less` files into
`css`.
27 changes: 27 additions & 0 deletions compile_jupyter_less.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import subprocess
import os

os.chdir("notebook")

# Check for clean submodule
unclean = "Please clean up your `notebook/` submodule!"
gitout = subprocess.check_output(['git', 'clean', '-ndx'])
if gitout == b'Would remove notebook/static/components/\n':
pass
elif gitout == b'':
subprocess.check_call([
'npm', 'install', '-g', 'bower', 'less', 'less-plugin-clean-css'
])
subprocess.check_call(['bower', 'install'])
else:
print(gitout)
raise RuntimeError(unclean)

print("Calling lessc")
subprocess.check_call([
'lessc',
'--clean-css',
'--include-path="./notebook/static"',
'notebook/static/style/style.less',
'../msmb_theme/static/css/jupyter.min.css'
])
Binary file removed msmb_theme/__init__.pyc
Binary file not shown.
Loading

0 comments on commit 9757984

Please sign in to comment.