i am trying to render a jupyter notebook as a webpage , the output widgets which i created myself are working fine but the bamboolib widget is not loading it shows "404 GET /voila/undefined.js (127.0.0.1) 2.410000ms referer=http://localhost:8888/voila/render/EDA/Untitled.ipynb
"
Any idea how to fix this.
Related
I know that I can click on File -> Print Preview and let my browser save the result as a PDF. But that PDF will contain quite a bit of code.
Can I hide parts from the print preview or make a PDF with another tool?
Ideally, there would be magic functions:
%hide: Hide the cell and its output
%hide-code: Hide only the code of the cell, but show the output of the code
Print to PDF in the browser
In JupyterLab, you can hide the cell's input and output by clicking the side bar as demonstrated in the doc. After hiding, you can use the browser's printing menu to generate a PDF. I've tested it on FireFox and expect similar result on Chrome or Edge.
Export to PDF with nbconvert
If you aim at a native conversion from ipynb format to pdf, the nice old nbconvert tool is your friend. It usually comes together with Jupyter and can be invoked conveniently in the menu of JupyterLab File->Export Notebook As...->PDF or, in the classic Jupyter Notebook interface, File->Download as->PDF (via LaTeX).
Hiding input/output in cells can be realized by setting the cell's metadata hide_input=true and installing a nbextension as discussed in issue #155.
Print Preview menu in the classical Jupyter
Finally to your question
Can I hide parts from the print preview or make a PDF with another tool?
The "print preview" button in the classical Jupyter interface is a shortcut for calling nbconvert to generate a HTML file and redirect your browser to it. Therefore, similar configuration for nbconvert to hide input as discussed above (in issue #155) can be used. This feature is implemented by jupyter_contrib_nbextensions bundle and explained in the doc.
As the above-mentioned answers do not work for me; I found another solution:
I use an additional package notebook-as-pdf.
Read the tutorial here. It uses Chromium and is the only approach that worked for me so far reliably. The "print preview" does still not work. But it produces a clean PDF with no code input.
I do:
pip install -U notebook-as-pdf
pyppeteer-install
jupyter nbconvert --to PDFviaHTML --TemplateExporter.exclude_input=True PATH_TO_YOUR_FILE.ipynb
What did NOT work for me:
The solution above.
All the scripts mentioned in those answers
I am using JxBrowser 6.14.2 in a Java Swing application and I'm encountering an issue when loading a PDF and attempting to load content for any links in the PDF document.
It seems to be related to the tab handling code in the Chrome PDF extension and it happens when using the JxBrowser default PopupHandler as well as a custom one.
Get the following error when the PDF is loaded:
[0104/095806:INFO:CONSOLE(0)] "Unchecked runtime.lastError while running tabs.get: No tab with id: 5.
at promises.push.Promise.then.streamInfo.tabUrl (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/browser_api.js:159:21)
at chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/browser_api.js:158:21", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html (0)
Then, when clicking any URL or mailto link, the following error occurs:
[0104/095952:INFO:CONSOLE(0)] "Unchecked runtime.lastError while running tabs.update: No current window
at NavigatorDelegate.navigateInCurrentTab (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:42:19)
at Navigator.onViewportReceived_ (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:169:31)
at OpenPDFParamsParser.getViewportFromUrlParams (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/open_pdf_params_parser.js:131:7)
at Navigator.navigate (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:125:28)
at PDFViewer.handlePluginMessage_ (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf.js:614:27)", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html (0)
The same errors even occur if a popup handler that "disables" popups is installed:
browser.setPopupHandler(p -> {
browser.loadURL(p.getURL());
return null;
});
Any ideas on how I might resolve this issue so that links in PDF documents behave as expected?
My name is Dmitry and I’m on the JxBrowser Support team.
Thank you for reporting that issue.
Currently, links from PDF do not work in JxBrowser. I have created an appropriate task in our issue tracking system and we will fix it in one of the future versions of JxBrowser.
Attemping to run an example RShiny Flexdashboard and when executing the rmarkdown::run command on the .Rmd file with the source code found here:
http://rmarkdown.rstudio.com/flexdashboard/shiny.html#getting_started
The rendered dashboard appears as such:
which is incorrect. None of the text or code should be rendering on the page. Essentially, I copied & pasted the source code found on that tutorial page into an test.Rmd file, and then executed rmarkdown::run("test.Rmd"). Is there more to a flexdashboard than doing what I've described?
Thanks for the time! I really appreciate the help!
There are 2 things that come to my mind-
1) Can you send a screenshot of your Rstudio window. I am guessing that your R-code is not withing a chunk, which maybe causing it to display as code
2) Can you use the run document button on the top of the Rstudio window instead of rmarkdown::run
Please let me know
If from the RStudio menu, I select File > New File > R Markdown ...
and then select Presentation, HTML (Slidy).
Leaving the sample code and pressing Knit HTML, opens the presentation in presentation mode in an RStudio browser (after saving). However, if I then select Open in Browser the presentation shows as one page and pressing "a" to change to slide show mode does not work (tested with Chrome and IE)
This same behaviour does not occur if I choose HTML (ioslides), i.e. ioslides works as expected.
Is anyone else able to replicate this problem? Any ideas? Apparently javascript is enabled...
I am trying a sample code that is supposed to use IPython and display a html file.
Here is part of the code that is relevant to my question:
from IPython.display import IFrame
from IPython.core.display import display
display(IFrame('myfile.html', '100%', '600px'))
But when I run it, nothing shows up. What could be the reason?
Do I need to install something related to d3 or d3js?
Your code works in a Jupyter notebook (it doesn't display anything when tested in a terminal running IPython) - It will not display anything if the file is empty or contains malformed HTML. If the file doesn't exist you'll see a 404 displayed in the IFrame.