Giter Club home page Giter Club logo

nbviewer's Introduction

IPython Notebook Viewer

IPython notebook viewer is an heroku application that given the url of a IPython notebook file (ending in ipynb) shows you a static html version.

Quick Deploy

If you have an heroku account, or have access to one, have a look at heroku-bootstrap.sh that does a quick setup of an heroku account and set some variables:

$ ./heroku-bootstrap.sh <an-app-name>
Creating <an-app-name>... done, stack is cedar
http://<an-app-name>.herokuapp.com/ | [email protected]:<an-app-name>.git
Adding memcachier:dev on <an-app-name>... done, v3 (free)
MemCachier is now up and ready to go. Happy bananas!
Use `heroku addons:docs memcachier` to view documentation.
Adding newrelic:standard on <an-app-name>... done, v4 (free)
Use `heroku addons:docs newrelic` to view documentation.
Git remote <an-app-name> added
Setting config vars and restarting <an-app-name>... done, v5
LIBRARY_PATH: /app/.heroku/vendor/lib
Setting config vars and restarting <an-app-name>... done, v6
LD_LIBRARY_PATH: /app/.heroku/vendor/lib
Setting config vars and restarting <an-app-name>... done, v7
PATH: bin:app/.heroku/venv/bin:/bin:/usr/local/bin:/usr/bin
Setting config vars and restarting <an-app-name>... done, v8
BUILDPACK_URL: https://github.com/ddollar/heroku-buildpack-multi.git

Push the repo on your new app

$ git push <an-app-name> master:master
...
...

The application will be available under yourappname.herokuapp.com

Modifying the app

The app is based on Twitter Bootstrap so you will need some dependencies like node,uglify-js.

  • everything in /static/ is served statically
  • html files in /static/ are built from /template/ by doing $ make in the root dirrectory
  • /template/layout.mustache contain headers and footers
  • every *.mustache file in template/pages will create a corresponding html file in /static/
  • any required python package should be availlable via pip, and should be added to requirement.txt. see pip freeze to know what to write in the file.
  • local debug mode is activated by creating a .debug file in the root directory, .debug is excluded in .gitignoreand .slugignore

Testing Locally

Sqlalchemy needs to connect to a database, you should export the environment variable DATABASE_URL. If you don't have any installed DB or just want to try out, you can use in memory sqlite :

$ export DATABASE_URL='sqlite:///:memory:'

Deploying on heroku

heroku create [appname]
heroku git:remote -a [appname] -r [appname]
heroku addons:add memcachier:dev --app [appname]
heroku addons:add newrelic:standard --app [appname]

to deploy the new version :

git push nbviewer2 <local-branch>:master

You can eventually set the following github key to make authenticated requests to github. This will increase the maximum number of requests you can do to github /hour.

GITHUB_OAUTH_KEY:             xxxxxxxxxxxxxxxxxxxx
GITHUB_OAUTH_SECRET:          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

you can use heroku config:set KEY1=VALUE1 to do so.

nbviewer's People

Contributors

carreau avatar minrk avatar rgbkrk avatar takluyver avatar fperez avatar westurner avatar

Stargazers

 avatar

Watchers

 avatar  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.