I have a jupyter notebook that I want to share on Internet.
I will upload the *.ipynb file so that the visitor can download and run it, but I also wanted to show the notebook directly in a webpage.
Note : I don't want the reader to be able to actually RUN the notebook, I am just looking for an appropriate HTML / CSS / JS template or something similar. I assume the plots will just be pictures, which is fine
You can use <object> tag to embed files in html. but iPython notebook file is not supported. So covert it using the nbconvert.
Related
I have HTML code that compiles into a chm, and occasionally I want to include a link to directly download a file... for example a small binary drawing file (extension .qid in my app) used as sample data for a tutorial in the chm. I have been doing this just fine for little drawing files by just providing a link like this...
some text
But my current problem is I have a little sample dxf that is to be used in this tutorial and when I provide a download link like this...
some text
...then I get a link ok, but when I click on it, it puts the dxf contents inline as text, rather than poppping up a download Save As dialog for some file at a path like mk:#MSITStore:wherever.dxf
Now I looked at HTML attribute doco and found a 'download' attribute which is meant to force the link to download, but it made no difference. I used this syntax...
<a href="relativepath/some.dxf" title="whatever" download>some text</a>
...which generated a chm with a link but ignored the attribute 'download'.
How can I force the href link to lead to a download dialog for a dxf file?
Please note CHM's are 20 years old. hh.exe is the HTMLHelp executable on Windows and associated with *.CHM files. It's just a shell that uses the HTML Help API and is really just hosting a browser window based on the old Internet Explorer in the HTMLHelp Viewer window. This is not based on Microsoft's browser EDGE!
You know, the HTML (!) Attribute directs new browsers to download the linked resource rather than opening it.
But - the download attribute is not supported by Microsoft Internet Explorer.
I tested linking from a single local HTML file too. Other browsers like Firefox, Chrome and EDGE also open a link to a local *.DXF file always as text file.
This also happens with embedded (compiled into a CHM file) *.dxf files.
So, you'll need to create a link to a ZIP file like e.g. some.dxf.zipinstead.
UPDATE:
This is working when the *.DXF file is not embedded and stored on a server: Test it for your needs by using in the old manner
test.dxf download
I used Table of Contents(2) of Nbextensions to create Table of Contents. And the titles were created using markdown.
Every thing is working fine. I mean , it looks pretty good in notebook modus.
But after I had converted the ipynb file to html file , then the number of each title dispeared . I used menu: File->Download as -> HTML to do this.
I tried to use another option "File->Download as ->HTML with toc" to convert to html. Although it generated desired numbering , this is still not what I want, because it will generate not only an html file but also multiple images file if there are some plots in the notebook.
Does anyone have a good idea?
I just need a SINGLE html file with everything embedded .
The numbering of the Nbextensions will be present if you'll download the notebook to PDF (after installing the relevant packages).
Regarding the HTML version, I didn't find an answer yet and will be happy for help either.
Notebook uses different formatting for the content. Exporting option only provide you to save your code. So, that you can send it to others.
Better save the data in the python notebook form itself to maintain formatting. Even exporting you to PDF won't provide you true formatting as the notebook does. But it will be better than HTML.
But if you still want the HTML format, you can format it manually as a webpage. May the formatting get improved in next version of nbconvert.
Given a saved HTML file with an image (an output from Bokeh), how can I save it as a PNG file with a DPI of 300?
I found some answers to similar questions, but they don't seem to work for me. I think I need someone to explain the whole process (importing the needed package, where it needs to be located if applicable, and how to call it).
I've tried this after pip installing webkit2png:
import os
os.system("webkit2png" "texas.html")
I've also tried:
import subprocess
subprocess.call("webkit2png", "texas.html")
Thanks in advance!
As of Bokeh 0.12.6, it is now possible to export PNG and SVG directly from
Python code.
Exporting PNGs looks like this
export_png(plot, filename="plot.png")
And exporting SVGs looks like this
plot.output_backend = "svg"
export_svgs(plot, filename="plot.svg")
There are some optional dependencies that need to be installed.
You can find more information in the Exporting Plots section of the User Guide.
Currently, plots are saved at their native resolution, but in 0.12.7 you will be able to set the size.
There's no such thing as an "HTML image." HTML enables one to incorporate image files of various types within an HTML document, which a Web browser knows how to display and process.
Run your Bokeh (?) code and use a commercial screen capture utility (I like SnagIt!, which is FREE). That gives you the capability of saving out the image to disk in a wide array of formats (JPEG, TIF, PNG, GIF, etc.).
I'm trying to share a Jupyter Notebook containing some regresison results (in an IFrame) with my university lecturer because I need to ask him something. The regression results are in a HTML file, generated from the stargazer library in R. The notebook can be viewed here: http://nbviewer.jupyter.org/urls/dl.dropbox.com/s/vnt875efjwqbi2g/regressions.ipynb?flush_cache=True. Is there any way to render a local HTML file in the notebook without it breaking for other people? I have tried using nbconvert to convert my notebook to HTML, but though I can see the IFrame properly, others cannot.
The folder is synced to Dropbox, and currently what I see in the IFrame is just this error:
Error (403)
It seems you don't belong here! You should probably sign in. Check out our Help Center and forums for help, or head back to home.
Of course, I could link my lecturer to the HTML file that contains the results, but that is not optimal because he has to jump between the nbviewer page for the code and the results page for the results.
I've figured out a workaround. Since the HTML results file is hosted on Dropbox, this answer explains how to access the contents of the HTML file directly from a Dropbox shared link. I can then display the IFrame using the Dropbox link instead of my local file.
Instead of creating an additional text file and provide a link to it, can one embed some texts into an HTML file and provide a link to download it? The solution should work for a static website.
You should be able to base64 encode the file in the link, but you may want to do some cross-browser testing.
See Create a file in memory for user to download, not through server
If I understand correctly, you have a static website and you want to be able to create a link to a HTML page that should be downloaded instead of "viewed" in the browser.
The only way I can think of to solve this is to use the HTML 5 download attribute, like this:
Download