Comments (6)
Great! Thank you so much for looking at it.
I am a heavy user of pretty jupyter and I also found, I think, a minor flaw that the generated html has a huge space of blank at the end. I am not sure if you call it an issue, but I think the generated html would look better without the blank space at the end.
Thank you again for your time and your package,
Best wishes
from pretty-jupyter.
Hello. Sure. I'll look into it asap.
from pretty-jupyter.
Thank you for reporting it. I managed to reproduce the issue and I'm looking into it.
from pretty-jupyter.
I found the problem. The problem is on the side of nbconvert. It cannot handle HTML properly when embed_images is turned on.
The problem is because of the following steps:
- pretty-jupyter transforms
[//]: # (-.- .tabset)
into<span class="pj-token" style="display: none">
- nbconvert (if embed_images is turned on) in
IPythonRenderer.inline_html
loads first part of the span (due to tokenization) as<span class="pj-token" style="display: none">
. - If embed_images is turned on, it tries to load it as html using beautiful soup package and then replace the sources with the embedded strings. However when loading it, it "fixes" the html and fills the closing tag for the span =>
<span class="pj-token" style="display: none"></span>
. - Then the problem snowballs. Now the span is already closed, so it needs to handle ".tabset" text token. So it just appends it after the span etc.
This problem has a simple fix. If the token in IPythonRenderer.inline_html
does not contain any image tag, the inline_html shouldn't return html parsed for images.
@chengfeng-liu All in all, I know how to fix it in nbconvert package. I'll try to create a merge request to nbconvert asap. Just need to create minimal reproducible example before that explaining why they should want the change.
from pretty-jupyter.
Temporary solution:
Try to install nbconvert < 7.0.0. I tried version 6.5.4 and it works with no issues.
from pretty-jupyter.
@chengfeng-liu I created issues in nbconvert's repository. I found more issues in the >=7 version of nbconvert, therefore in the new version I limit the required nbconvert's version to <7 in the new release.
I'll be closing this issue since the problem is not in this repository.
from pretty-jupyter.
Related Issues (20)
- Sphinx
- Add options to TOC
- Export to pdf
- Add optional dependencies
- Metadata
- Section numbering HOT 1
- Create templates HOT 2
- 2.0.0 HOT 1
- Future work
- Not properly nesting TOC HOT 3
- Itables HOT 1
- Button to download jupyter/open in colab? HOT 3
- Investigate blank space at the end HOT 5
- Errorneous table of content HOT 4
- pretty-jupyter compatible with SoS notebooks? HOT 2
- CI Fix HOT 1
- Table of contents (toc) does not show HOT 7
- ImportError: No module named RemoveInputPreprocessor for 2.0.0 above HOT 2
- pinned nbconvert 6 dependency HOT 1
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 pretty-jupyter.