Skip to content

Commit

Permalink
Updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
kirbs- committed May 1, 2016
1 parent 4c596db commit 1b223ae
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 110 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

Release: ![Travis release build](https://travis-ci.org/kirbs-/hide_code.svg?branch=master) Dev: ![Dev Build Status](https://travis-ci.org/kirbs-/hide_code.svg?branch=dev)

### hide_code now supports HTML & PDF exporting!
## New in 0.3.0 Release
HTML & PDF exporting bug fixes.
Cell output hiding (thanks to @acspike).

## Introduction
hide_code is an extension for Jupyter/IPython notebooks to selectively hide code and prompts. Make a notebook a code free document for presenting with a single click by pressing ![hide_code toggle](/images/button.png)
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 ![hide_code toggle](/images/button.png)

###### Normal
![image1.1](/images/1.1.png)
Expand All @@ -25,10 +27,13 @@ Or customize each cell by selecting "Hide code" from the Cell Toolbar dropdown.
![image3.2](/images/3.2.png)

## Exporting
Exporting respects hide code/prmpt cell selections only. Output is saved in Jupyter's current working directory with the notebook's file name + '.html' or '.pdf'. **Exporting to PDF via notebook requires [wkhtmltopdf](http://wkhtmltopdf.org/)!**
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.

### Notes
**Exporting to PDF via HTML requires [wkhtmltopdf](http://wkhtmltopdf.org/)!**
**Exporting to PDF via Latex requires a Tex library.**

This feature continues to evolve. Items on the road map incude:
* saving to a different file loaction.
* 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).
Expand All @@ -38,14 +43,17 @@ To export via HTML or PDF simply click on the respective button.
![image4.1](/images/4.1.png)

### Via nbconvert command line
To export via nbconvert command line, nbconvert 4.2 or later is required. Hide_code adds two export options to nbconvert, hide_code_html and hide_code_pdf.
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'


## Installation
### Via pip
`pip install hide_code`
Expand Down
103 changes: 1 addition & 102 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,107 +7,6 @@ Release build

.. image:: https://travis-ci.org/kirbs-/hide_code.svg?branch=master

Development build

.. image:: https://travis-ci.org/kirbs-/hide_code.svg?branch=dev)

Introduction
============
hide_code is an extension for Jupyter/IPython notebooks to selectively hide code and prompts. Make a notebook a code free document for exporting or presenting with a single click by pressing

.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/button.png

Normal
------
.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/1.1.png
:width: 918
:height: 322
:scale: 70

Hide code enabled
-----------------
.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/1.2.png
:width: 1227
:height: 322
:scale: 60

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.

.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/2.png
:width: 408
:height: 242
:scale: 60

Normal
------
.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/3.1.png
:width: 696
:height: 322
:scale: 90

Hide code enabled
-----------------
.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/3.2.png
:width: 764
:height: 322
:scale: 80

Exporting
=========
Exporting respects hide code/prmpt cell selections only. Output is saved in Jupyter's current working directory with the notebook's file name + '.html' or '.pdf'.**Exporting to PDF via notebook requires** wkhtmltopdf_.

.. _wkhtmltopdf: http://wkhtmltopdf.org

This feature continues to evolve. Items on the road map incude:

* saving to a different file loaction.
* 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).

Via notebook
------------
To export via HTML or PDF simply click on the respective button.

.. image:: https://raw.githubusercontent.com/kirbs-/hide_code/dev/images/4.1.png

Via nbconvert command line
--------------------------
To export via nbconvert command line, nbconvert 4.2 or later is required. Hide_code adds two export options to nbconvert, hide_code_html and hide_code_pdf.

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`

Installation
============
Via pip
-------
`pip install hide_code`

Via setuptools
--------------
1. Download and unzip this repository.
2. Change to unzipped directory.
3. Execute `python setup.py install`

Installation Troubleshooting
============================
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)
`

Requirements
============
* Jupyter notebook 4.x+
* Jupyter nbconvert 4.2+ if using nbconvert command line exporting
* pdfkit & wkhtmltopdf_
* Python 2.7 or 3.3+
hide_code is an extension for Jupyter/IPython notebooks to selectively hide code, prompts and output. Make a notebook a code free document for exporting or presenting. Documentation at https://github.com/kirbs-/hide_code


2 changes: 1 addition & 1 deletion hide_code/hide_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ----------------------------------------------------------------------------
* Copyright (c) 2015 - Chris Kirby
*
* Distributed under the terms of the Modified BSD License.
* Distributed under the terms of the MIT License.
*
* An IPython notebook extension to hide code inputs and prompts for presentation.
* -----------------------------------------------------------------------------
Expand Down
Binary file modified images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/3.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/3.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _post_install(dir):


class install(_install):
description = 'Installs hide_code.js and hide_code export handlers server extension.'
description = 'Installs hide_code.js, hide_code export handlers and server extension.'
# user_options = [{'auto-load=', None, 'Do not auto-load server extensions.'}]

# def initialize_options(self):
Expand All @@ -42,7 +42,7 @@ def run(self):
# https://packaging.python.org/en/latest/single_source_version.html
version='0.3.0',

description='A Jupyter notebook extension to hide code and prompts.',
description='A Jupyter notebook extension to hide code, prompts and outputs.',
long_description=long_description,

# The project's main homepage.
Expand Down Expand Up @@ -116,6 +116,7 @@ def run(self):
'nbconvert.exporters': [
'hide_code_html = hide_code:HideCodeHTMLExporter',
'hide_code_pdf = hide_code:HideCodePDFExporter',
'hide_code_latexpdf = hide_code.HideCodeLatexPDFExporter',
],
}
)

0 comments on commit 1b223ae

Please sign in to comment.