From 0e3e63bbe87ee04e9cba2213e3bc451a0fbc63c3 2013-09-23 21:35:21 From: Jonathan Frederic Date: 2013-09-23 21:35:21 Subject: [PATCH] Review changes --- diff --git a/IPython/nbconvert/preprocessors/sphinx.py b/IPython/nbconvert/preprocessors/sphinx.py deleted file mode 100755 index 02aab02..0000000 --- a/IPython/nbconvert/preprocessors/sphinx.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Module that allows custom Sphinx parameters to be set on the notebook and -on the 'other' object passed into Jinja. Called prior to Jinja conversion -process. -""" -#----------------------------------------------------------------------------- -# Copyright (c) 2013, the IPython Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- - -from __future__ import print_function, absolute_import -import os -import sphinx -from .base import Preprocessor - -#----------------------------------------------------------------------------- -# Classes and functions -#----------------------------------------------------------------------------- - -class SphinxPreprocessor(Preprocessor): - """ - Sphinx utility preprocessor. - - This preprocessor is used to set variables needed by the latex to build - Sphinx stylized templates. - """ - - def preprocess(self, nb, resources): - """ - Sphinx preprocessing to apply on each notebook. - - Parameters - ---------- - nb : NotebookNode - Notebook being converted - resources : dictionary - Additional resources used in the conversion process. Allows - preprocessors to pass variables into the Jinja engine. - """ - - # Find and pass in the path to the Sphinx dependencies. - resources["sphinx"] = {} - resources["sphinx"]["texinputs"] = os.path.realpath(os.path.join(sphinx.package_dir, "texinputs")) - return nb, resources diff --git a/IPython/nbconvert/preprocessors/tests/test_sphinx.py b/IPython/nbconvert/preprocessors/tests/test_sphinx.py deleted file mode 100644 index fb1f9fb..0000000 --- a/IPython/nbconvert/preprocessors/tests/test_sphinx.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -Module with tests for the sphinx preprocessor -""" - -#----------------------------------------------------------------------------- -# Copyright (c) 2013, the IPython Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- - -from .base import PreprocessorTestsBase -from ..sphinx import SphinxPreprocessor - - -#----------------------------------------------------------------------------- -# Class -#----------------------------------------------------------------------------- - -class TestSphinx(PreprocessorTestsBase): - """Contains test functions for sphinx.py""" - - - def build_preprocessor(self): - """Make an instance of a preprocessor""" - preprocessor = SphinxPreprocessor() - preprocessor.enabled = True - return preprocessor - - - def test_constructor(self): - """Can a SphinxPreprocessor be constructed?""" - self.build_preprocessor() - - - def test_resources(self): - """Make sure the SphinxPreprocessor adds the appropriate resources to the - resources dict.""" - nb = self.build_notebook() - res = self.build_resources() - preprocessor = self.build_preprocessor() - nb, res = preprocessor(nb, res) - assert "texinputs" in res['sphinx'] diff --git a/IPython/nbconvert/templates/latex/latex_report.tplx b/IPython/nbconvert/templates/latex/latex_report.tplx index 3bab0d5..d15831d 100644 --- a/IPython/nbconvert/templates/latex/latex_report.tplx +++ b/IPython/nbconvert/templates/latex/latex_report.tplx @@ -20,10 +20,3 @@ ((* block docclass *)) \documentclass{report} ((* endblock docclass *)) - -((* block h1 -*))\part((* endblock h1 -*)) -((* block h2 -*))\chapter((* endblock h2 -*)) -((* block h3 -*))\section((* endblock h3 -*)) -((* block h4 -*))\subsection((* endblock h4 -*)) -((* block h5 -*))\subsubsection((* endblock h5 -*)) -((* block h6 -*))\paragraph((* endblock h6 -*))