New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standard way to remove all code cells from PDF export #155
Comments
No. We are working on ability for external libraries to provides templates that woudl do such things. |
This custom template has what you want: If your codecell contains the metadate |
@juhasch Thanks a lot for pointing me to that repo! Most of it is working great. I added two PRs and an issue on this point: |
I found this googling around how to suppress output of individual cells when exporting to PDF (like you can in R markdown documents by using code chunk echo=False). It took me a little while to understand the above so I'll spell out what I did more explicitly. Versions I'm using:
You should now have a document called notebookname.pdf in the directory. Hopefully it should have just the text |
Hi @kungfujam , I installed the ipython_notebook_extensions tarball, I can locate it in |
You need to set the Example for
|
Is there a way to do it for html? |
Sure, use the |
How to convert using python api?
But i don`t know how to set temaplte using this class |
I wouldn't use NbConvertApp, that's really there for the command line interface. I would do something like this: from nbconvert import HTMLExporter
exporter = HTMLExporter(template_file='full.tpl')
output, resources = exporter.from_filename('report.ipynb')
# output is a string; you can write it to a file, save it to disk, etc. |
That is what I wanted |
Any news on this functionality from nbconvert? In essence being able to suppress code but not necessarily output when converting a notebook to e.g. .pdf. Never mind, just found the hide_code extension. |
The The person performing the analysis normally needs to create a report - with |
It could be useful to point to the new
Many more options (including |
Thank you so much for the pointer, @mwouts - I haven't stumbled across this option yet! |
Thanks @mwouts! That worked for me just wonderfully. |
@mwouts this is very useful ! |
@mwouts thanks for the help! |
@mwouts Great feature! It seems like it only works when exporting to HTML. When exporting to PDF with Is this a bug or expected behavior? Adding this feature to the PDF exporter would make it easy to generate professional looking reports with jupyter |
Thanks everyone! @maxhartshorn , the above example still works, with no code cell in the PDF, at least here on Ubuntu 20.04 LTS with |
@mwouts I'm on 5.6.1 as well...on Windows 10. I'm having trouble getting the above sample to run in my Anaconda prompt. However when I take an existing `[FILENAME].ipynb --execute --no-input --to pdf --output [FILENAME].pdf |
Well, just to be sure I gave it a try on Windows 10. I installed MikTex, and then created a simple environment with
based on this
Then, after running |
What is the standard way of removing all code cells from the exported PDF? I searched for it, and found many different "tplx" templates, for various versions. I tried some of them but they didn't seem to work. Is there a standard way of doing this?
Thanks!
The text was updated successfully, but these errors were encountered: