Giter VIP home page Giter VIP logo

gitter-badger / nbpresent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anaconda-platform/nbpresent

0.0 1.0 0.0 6.62 MB

next generation slides for Jupyter Notebooks

Home Page: https://anaconda-server.github.io/nbpresent

License: BSD 3-Clause "New" or "Revised" License

Shell 0.08% Batchfile 0.27% Python 0.65% HTML 26.16% Smarty 0.06% JavaScript 2.52% Jupyter Notebook 69.72% Makefile 0.26% CSS 0.28%

nbpresent's Introduction

nbpresent

remix your Jupyter Notebooks as interactive slideshows

Usage

After installing (and potentially enabling) as appropriate for your environment, after launching the Jupyter Notebook, all Notebooks will show two new buttons that show/hide the slide sorter and the presenter view. Launching the sorter will trigger an interactive tour, which can be relaunched by clicking the question mark in the top right corner of the sorter.

When you are happy with your presentation, you can download the standalone HTML file from the File -> Download as -> Presentation (.html) menu item.

Install

Note: installing directly off this repo won't work, as we don't ship the built JavaScript and CSS assets. See more about developing below.

pip

pip install nbpresent
python -m nbpresent.install

Then either run

%reload_ext nbpresent

every time you start the notebook or enable the extension for every notebook launch:

python -m nbpresent.install --enable --user

nbpresent.install accepts all of the same arguments as jupyter nbextension install.

conda

conda install -c anaconda-nb-extensions/label/dev nbpresent

This will enable nbpresent by default.

Export

Stock nbconvert doesn't store quite enough information, so you'll need to do something like this:

nbpresent -i notebooks/README.ipynb -o README.html

The resulting file can be hosted and viewed (but not edited!) on any site.

If you have installed nbbrowserpdf, you can also export to pdf:

nbpresent -i notebooks/README.ipynb -f pdf -o README.pdf

You can also pass in and get back streams:

cmd_that_generates_ipynb | nbpresent -f pdf > README.pdf

Here's the whole doc:

!nbpresent --help
usage: nbpresent [-h] [-i IPYNB] [-o OUTFILE] [-f {html,pdf}]

Generate a static nbpresent presentation from a Jupyter Notebook

optional arguments:
  -h, --help            show this help message and exit
  -i IPYNB, --ipynb IPYNB
                        Input file (otherwise read from stdin)
  -o OUTFILE, --outfile OUTFILE
                        Output file (otherwise write to stdout)
  -f {html,pdf}, --out-format {html,pdf}
                        Output format

Develop

This assumes you have cloned this repository locally:

git clone https://github.com/Anaconda-Server/nbpresent.git
cd nbpresent

Repo Architecture

The nbpresent nbextension is built from ./src into ./nbpresent/static/nbresent with:

  • less for style
  • es6 (via babel) for javascript
  • browserify for packaging

The nbpresent python module (server component) is stored in the /nbpresent folder

Getting Started

You'll need conda installed, either from Anaconda or miniconda. You can import a Python 3.5 development environment named nbpresent from ./environment.yml.

conda update env
source activate nbpresent

We still use npm for a lot of dependencies, so then run:

npm install
npm run build:all

Ensure development asset loading

To ensure that you always get the right assets, install the nbextension with the symlink, force and enable options:

python -m nbpresent.install --overwrite --symlink --enable --user

You may also want to pass in --prefix instead of user.

Chore Automation

Task Command
Build all of the front end assets with sourcemaps for development npm run build
Rebuild on every save npm run watch
Rebuild all of the front end assets, and optimize it npm run dist
Run the CasperJS and nose tests npm run test
Check code style npm run lint
Build the conda package npm run pkg:conda
Build and upload the pypi package npm run pkg:pypi
Build the ESDoc and Sphinx documentation npm run docs

nbpresent's People

Contributors

bollwyvl avatar damianavila avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.