jupyter/nbviewer — pull request #374 by bollwyvl (2014-12-03 04:21:33+00:00)
Title: Add /format/ URL handler

As per #359, this extracts just the changes to _allow_ for supporting additional `/format/`s, without actually _adding_ any beyond the standard HTMLExporter.
- simpler, string-addition approach to adding exporter matcher
- top-level `default_exporter` option, is defaulted to `html`
- template directory for exporters, with a degenerate `{% extends "notebook.html" %}` for `html`

Since there is only the one exporter, this does not include the template changes to actually _show_ another format: presumably, this would be done when slides are added.

The handlers could potentially be made simpler by, instead of exporting `handlers` and having every handler do its own manipulations with `slash_exp`, exposing a function that accepted `exporters` and explicitly generated....
```python
(url, handler, {exporter: "html"})
(r"/format/html/" + url, handler, {exporter: "html"})
...
```
tuples, but I don't see the pattern elsewhere: is this acceptable?