HTML & PDF exporting bug fixes. Cell output hiding (thanks to @acspike).
hide_code is an extension for Jupyter/IPython notebooks to selectively hide code, prompts and outputs. Make a notebook a code free document for presenting with a single click by pressing
Or customize each cell by selecting "Hide code" from the Cell Toolbar dropdown. Then use "Hide Code" and "Hide Prompts" checkboxes to hide the specific cell's code or cell's input/output prompts.
Hide_code adds HTML, PDF via HTML, and PDF via Latex export options to Jupyter. Exporting respects hide_code's code, prompt, and output selections; these must be saved prior to exporting.
Exporting to PDF via HTML requires wkhtmltopdf! Exporting to PDF via Latex requires a Tex library.
This feature continues to evolve. Items on the road map incude:
- saving as a different file name.
- support for custom CSS.
- single click exporting with all code and prompts hidden (similar to how the toolbar button).
To export via HTML or PDF simply click on the respective button.
To export via nbconvert command line, nbconvert 4.2 or later is required. Hide_code adds three export options to nbconvert, hide_code_html, hide_code_pdf, and hide_code_latexpdf.
Note: PDF exporting via command line uses nbconvert's built in PDF exporter.
jupyter nbconvert --to hide_code_html notebook_to_convert.ipynb
jupyter nbconvert --to hide_code_pdf notebook_to_convert.ipynb
`jupyter nbconvert --to hide_code_latexpdf notebook_to_convert.ipynb'
pip install hide_code
- Download and unzip this repository.
- Change to unzipped directory.
- Execute
python setup.py install
If installation complains the directory doesn't exist, you're Jupyter/IPython installation probably isn't in one of the usual places. Locate Jupyter's configuration directory, then use code below to install in a non-standard directory.
import hide_code.hide_code as hc
dir = "<full path to Jupyter config directory>"
hc.install(dir)
- Jupyter notebook 4.x+
- Jupyter nbconvert 4.2+ if using nbconvert command line exporting
- pdfkit & wkhtmltopdf
- Python 2.7 or 3.3+