From 07a345e656ce8109d3bd475290445401e323d02f 2014-04-11 04:13:41 From: MinRK Date: 2014-04-11 04:13:41 Subject: [PATCH] support pdf export in the notebook UI --- diff --git a/IPython/html/nbconvert/handlers.py b/IPython/html/nbconvert/handlers.py index 2910205..1cb9ba9 100644 --- a/IPython/html/nbconvert/handlers.py +++ b/IPython/html/nbconvert/handlers.py @@ -73,7 +73,7 @@ class NbconvertFileHandler(IPythonHandler): @web.authenticated def get(self, format, path='', name=None): - exporter = get_exporter(format, config=self.config) + exporter = get_exporter(format, config=self.config, log=self.log) path = path.strip('/') model = self.notebook_manager.get_notebook(name=name, path=path) diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index bb365dc..7e496b6 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -1,9 +1,5 @@ -//---------------------------------------------------------------------------- -// Copyright (C) 2008-2011 The IPython Development Team -// -// Distributed under the terms of the BSD License. The full license is in -// the file COPYING, distributed as part of this software. -//---------------------------------------------------------------------------- +// Copyright (c) IPython Development Team. +// Distributed under the terms of the Modified BSD License. //============================================================================ // MenuBar @@ -125,6 +121,10 @@ var IPython = (function (IPython) { that._nbconvert('rst', true); }); + this.element.find('#download_pdf').click(function () { + that._nbconvert('pdf', true); + }); + this.element.find('#rename_notebook').click(function () { IPython.save_widget.rename_notebook(); }); diff --git a/IPython/html/templates/notebook.html b/IPython/html/templates/notebook.html index 00867af..abfe979 100644 --- a/IPython/html/templates/notebook.html +++ b/IPython/html/templates/notebook.html @@ -84,6 +84,7 @@ class="notebook_app"
  • Python (.py)
  • HTML (.html)
  • reST (.rst)
  • +
  • PDF (.pdf)