Closed tvdboom closed 10 months ago
@tvdboom thank you for the report! That is a bit strange that it would start doing that (this used to work). Your suggestion makes sense I will look into incrementing it. Thank you again!
@tvdboom actually, I misread your message; it's on purpose that show_notebook
makes it "unreadable" for regular browsers, because that's the way the page needs to be formatted if it's to be embedded inside of a notebook (i.e. it can't have the surrounding HTML tags).
On the other hand, show_html
needs to write out a file, because the browser has to have something to open.
I can think of 2 things that can be done, but I'm not sure which is your main issue or if it would resolve it:
show_html
to generate the file, but not OPEN it. That way the file is created silently..html
, to avoid the confusion (e.g. .html_embed
)Let me know if that makes sense or if there is something else that would work better, or if I missed anything!
I understand, but I don't see the use of saving the html file in show_notebook without the html tags. What I would like is to show the report inside the notebook and at the same time save the file (with tags) so that I can open it separately in a browser.
If this can't happen, then my workaround would be to run first show_notebook without saving anything, and then show_html saving the file (and preferably not opening anything, so solution 1 would be nice to have), but it's an ugly solution imo since I need to call both show methods.
@tvdboom that makes sense and I think it's a simple fix, I will look into it shortly.
any progress on this?
@tvdboom thank you for your patience! I was hoping to include it in an upcoming update along with other fixes, but I haven't had the time to get to it all; I will push a new version with just this fix tomorrow!
Done! I hope this is the functionality you were looking for, check out the documentation for an update on show_notebook()
. Let me know if there are any issues with it. Thanks again for your feedback!
Works as requested. Thanks for the implementation!
Hi,
One bug and one suggestion:
The bug:
show_notebook
saves an html file that, when opened with chrome, shows the plain text instead of rendering. This doesn't happen withshow_html
, and the reason is this lineself._page_html = html.escape(self._page_html)
, that does something to the html that prevents it from rendering correctly (at least in chrome).The suggestion: I would like to use
show_html
without saving any file. Just likeshow_notebook
, I would like to be able to providefilepath=None
. This would also make the API more consistent.