Comments (9)
Ok, I just added an IPYNB_IGNORE_CSS
option that removes all CSS, hopefully that works better.
from pelican-jupyter.
+1 on that. How can I overwrite ipython style?
from pelican-jupyter.
This in is tricky guys :)
Removing all the ipython CSS will clearly result in something that is not presentable. Disabling their pygments might be possible.
It is possible to overwrite ipython/jupyter styles. I do that for my blog: https://github.com/danielfrg/danielfrg.github.io-source by just adding more CSS after the pelican converted html + css.
from pelican-jupyter.
@danielfrg I was really wanting to 'disable' it so I could include it myself via a CSS file (from the theme/etc.) — the advantage being that it's easier to override things if you can add the custom styles after the notebook ones (plus smaller page size... hosting the CSS on a static domain, etc.)
I was after a variable to toggle this behaviour — definitely don't want to do this by default!
from pelican-jupyter.
Exactly, that what I also end up using (a nasty hack around your hack):
def filter_css(style_text, path='plugins/ipynb/custom.css'):
"""
HACK: IPython returns a lot of CSS including its own bootstrap.
Get only the IPython Notebook CSS styles.
"""
index = style_text.find('/*!\n*\n* IPython notebook\n*\n*/')
if index > 0:
style_text = style_text[index:]
index = style_text.find('/*!\n*\n* IPython notebook webapp\n*\n*/')
if index > 0:
style_text = style_text[:index]
style_text = re.sub(r'color\:\#0+(;)?', '', style_text)
style_text = re.sub(r'\.rendered_html[a-z0-9,._ ]*\{[a-z0-9:;%.#\-\s\n]+\}', '', style_text)
if path is not None and os.path.isfile(path):
style_text += get_custom_css(path)
else:
print('custom.css is not found', os.getcwd())
return '<style type=\"text/css\">{0}</style>'.format(style_text)
However, I guess I can just store "default" ipython css with my changes as an independent file, and replace all this functionalty with just link to this custom file.
from pelican-jupyter.
I don't think you need a hack like that, you can just remove ipython_css
from this line: content = ipython_css + content + LATEX_CUSTOM_SCRIPT
@ https://github.com/danielfrg/pelican-ipynb/blob/master/core.py#L115 and no CSS will be injected.
from pelican-jupyter.
probably replacing this injection with just a link to my custom css should do what I want.
Thanks!
from pelican-jupyter.
@danielfrg
Thanks for the modification, by setting IPYNB_IGNORE_CSS = True, everything works perfectly : )
from pelican-jupyter.
Thanks for this @danielfrg works great. I've just opened a PR to document this in the README.
from pelican-jupyter.
Related Issues (20)
- Visible cell numbers HOT 2
- Critical: IndexError: tuple index out of range
- Can't pass variables in pelicanconf.py
- Has the metadata file extension changed? HOT 2
- Issue with pelican 4.0.1 HOT 1
- IPYNB_FIX_CSS nukes markdown table headers HOT 1
- where to set IPYNB_USE_METACELL HOT 1
- HoloViews issue with requirejs
- Images copy pasted as attachments not rendering in HTML HOT 1
- not rendering notebooks every time (when there was no change)? HOT 2
- Hiding a notebook cell HOT 4
- Problem with < sign in equations
- Manual install of pelican_jupyter triggers TypeError: SubElement() argument 1 must be xml.etree.ElementTree.Element, not Element HOT 3
- SVG parsing faulty
- Plugin doesn't work with nbconvert >= 6.x HOT 25
- ENH: please add wheels
- ERROR: Could not process ipynb | basic HOT 2
- Metadata in first cell not working on windows
- Remove "In []" prompt HOT 1
- Tests are failing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pelican-jupyter.