{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "nbpresent": {
     "id": "07b9c345-f14e-4389-b959-fb5fe9d49d05"
    }
   },
   "source": [
    "# nbpresent\n",
    "\n",
    "[![](https://anaconda.org/anaconda-nb-extensions/nbpresent/badges/installer/conda.svg\n",
    ")](https://anaconda.org/anaconda-nb-extensions/nbpresent) [![](https://img.shields.io/pypi/v/nbpresent.svg)](https://pypi.python.org/pypi/nbpresent)\n",
    "[![Build Status (Lin64)](https://travis-ci.org/Anaconda-Platform/nbpresent.svg)](https://travis-ci.org/Anaconda-Platform/nbpresent) [![Build Status (Win64)](https://ci.appveyor.com/api/projects/status/aa6g8ya0oy1m6r9r?svg=true)](https://ci.appveyor.com/project/bollwyvl/nbpresent)\n",
    "[![Coverage Status](https://coveralls.io/repos/github/Anaconda-Platform/nbpresent/badge.svg?branch=master)](https://coveralls.io/github/Anaconda-Platform/nbpresent?branch=master)\n",
    "\n",
    "> remix your [Jupyter Notebooks](http://jupyter.org) as interactive slideshows\n",
    "\n",
    "![](./screenshot.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Using\n",
    "After [installing](#install) (and potentially enabling) as appropriate for your environment, relaunch the Jupyter Notebook: in the main toolbar, you will get two new buttons that toggle the _Authoring_ and _Presenting_ modes."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## User Documentation and Community\n",
    "When _Authoring_, you can click on the `(?)` icon to see a number of in-Notebook guided tours that show all the features, as well as see links to community pages:\n",
    "\n",
    "- [mailing list](https://groups.google.com/forum/#!forum/nbpresent) for general or long-term discussion and announcements\n",
    "- [issues](https://github.com/Anaconda-Platform/nbpresent/issues) for technical issues, as well as feature requests\n",
    "- [chat](https://gitter.im/Anaconda-Platform/nbpresent) for quickly connecting with other users"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Related Projects\n",
    "- [live_reveal/RISE](https://github.com/damianavila/RISE), the original inspiration for this work, based on [reveal.js](https://github.com/hakimel/reveal.js/).\n",
    "- [RMarkdown](http://rmarkdown.rstudio.com/ioslides_presentation_format.html) presentations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Publishing\n",
    "When you are happy with your presentation, you can download the standalone HTML file from the _File -> Download as -> Presentation (.html)_ menu item."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Install\n",
    "\n",
    "> Note: installing directly off this repo won't work, as we don't ship the built JavaScript and CSS assets. See more about [developing](#develop) below.\n",
    "\n",
    "### `pip`\n",
    "```shell\n",
    "pip install nbpresent\n",
    "jupyter nbextension install nbpresent --py --overwrite\n",
    "jupyter nbextension enable nbpresent --py\n",
    "jupyter serverextension enable nbpresent --py\n",
    "```\n",
    "\n",
    "### `conda`\n",
    "```shell\n",
    "conda install -c conda-forge nbpresent\n",
    "```\n",
    "\n",
    "This will enable the `nbpresent` `nbextension` and `serverextension` automatically!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Export\n",
    "### HTML\n",
    "Stock `nbconvert` doesn't store quite enough information, so you'll need to do something like this:\n",
    "```shell\n",
    "nbpresent -i notebooks/README.ipynb -o README.html\n",
    "```\n",
    "The resulting file can be hosted and viewed (but not edited!) on any site.\n",
    "\n",
    "You can also pass in and get back streams:\n",
    "```shell\n",
    "cmd_that_generates_ipynb | nbpresent > README.html\n",
    "```\n",
    "\n",
    "### PDF (Experimental)\n",
    "If you have installed [nbbrowserpdf](https://github.com/Anaconda-Platform/nbbrowserpdf), you can also export to pdf:\n",
    "```shell\n",
    "nbpresent -i notebooks/README.ipynb -f pdf -o README.pdf\n",
    "```\n",
    "\n",
    "Here's the whole doc:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: nbpresent [-h] [-i IPYNB] [-o OUTFILE] [-f {html,pdf}]\r\n",
      "\r\n",
      "Generate a static nbpresent presentation from a Jupyter Notebook\r\n",
      "\r\n",
      "optional arguments:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -i IPYNB, --ipynb IPYNB\r\n",
      "                        Input file (otherwise read from stdin)\r\n",
      "  -o OUTFILE, --outfile OUTFILE\r\n",
      "                        Output file (otherwise write to stdout)\r\n",
      "  -f {html,pdf}, --out-format {html,pdf}\r\n",
      "                        Output format\r\n"
     ]
    }
   ],
   "source": [
    "!nbpresent --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Develop\n",
    "This assumes you have cloned this repository locally:\n",
    "```\n",
    "git clone https://github.com/Anaconda-Platform/nbpresent.git\n",
    "cd nbpresent\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Repo Architecture\n",
    "\n",
    "The `nbpresent` nbextension is built from `./src` into `./nbpresent/static/nbresent` with:\n",
    "- `less` for style\n",
    "- `es6` (via `babel`) for javascript\n",
    "- `browserify` for packaging\n",
    "\n",
    "The `nbpresent` python module (server component) is stored in the `/nbpresent` folder"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Getting Started\n",
    "You'll need conda installed, either from [Anaconda](https://www.continuum.io/downloads) or [miniconda](http://conda.pydata.org/miniconda.html). You can create a Python development environment named `nbpresent` from `./environment.yml`.\n",
    "\n",
    "```shell\n",
    "conda create -n nbpresent python=YOUR_FAVORITE_PYTHON\n",
    "conda update env\n",
    "source activate nbpresent\n",
    "```\n",
    "\n",
    "We _still_ use `npm` for a lot of dependencies, so then run:\n",
    "```shell\n",
    "npm install\n",
    "```\n",
    "\n",
    "Finally, you are ready to build the assets!\n",
    "```shell\n",
    "npm run build\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Ensure development asset loading\n",
    "To ensure that you always get the right assets, install the nbextension with the `symlink` options:\n",
    "```shell\n",
    "jupyter nbextension install nbpresent --overwrite --symlink --sys-prefix\n",
    "jupyter nbextension enable nbpresent --sys-prefix\n",
    "jupyter serverextension enable nbpresent --sys-prefix\n",
    "```\n",
    "\n",
    "See [chore automation](#chore-automation) below for more good times."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Chore Automation\n",
    "| Task | Command |\n",
    "|------|---------|\n",
    "| Build all of the front end assets with sourcemaps for development | `npm run build` |\n",
    "| Rebuild on every save | `npm run watch` |\n",
    "| Rebuild all of the front end assets, and optimize it | `npm run dist` |\n",
    "| Run the CasperJS and `nose` tests  | `npm run test` |\n",
    "| Check code style |  `npm run lint` |\n",
    "| Build **and upload** the pypi **test** package | `npm run pkg:pypi` |\n",
    "| Build **and upload** the pypi **release** package | `npm run pkg:pypi:release` |\n",
    "| Build the ESDoc and Sphinx documentation | `npm run docs` |"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Changelog"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.0.2\n",
    "- use [Travis-CI](https://travis-ci.org/Anaconda-Platform/nbpresent) for continuous integration\n",
    "- use [Coveralls](https://coveralls.io/github/Anaconda-Platform/nbpresent) for code coverage\n",
    "- use a [conda-forge](https://github.com/conda-forge/nbpresent-feedstock) for cross-platform `conda` package building"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.0.1\n",
    "- minor build changes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.0.0\n",
    "- Update to notebook 4.2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.0.0\n",
    "- Theme editor removed. Significant work required to stabilize to public release quality.\n",
    "- Adding some themes extracted from reveal.js"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.1.1\n",
    "- fixing enabling on windows with `nb_config_manager` 0.1.3\n",
    "- trimming down conda packages\n",
    "- more reproducible builds"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.1.0 (Unreleased)\n",
    "- fixing issue with slides without regions and some layouts crashing editor [#58](https://github.com/Anaconda-Platform/nbpresent/issues/58)\n",
    "- adding JS extensibility of themes (partial [#44](https://github.com/Anaconda-Platform/nbpresent/issues/44))\n",
    "  - see [Extending nbpresent](https://github.com/Anaconda-Platform/nbpresent/blob/master/notebooks/Extending%20nbpresent.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.0.0\n",
    "- [Theme editor](https://github.com/Anaconda-Platform/nbpresent/pull/41)\n",
    "- Much more consistent UI\n",
    "- Mnay bug fixes and more testing"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  },
  "widgets": {
   "state": {},
   "version": "1.1.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
