##// END OF EJS Templates
Adds configuration options to use Google Drive content manager...
Adds configuration options to use Google Drive content manager Adds the key contentmanager_js_source to webapp_settings that allows for specifying the content manager JavaScript source file. Also adds a NotebookManager subclass, ClientSideNotebookManager, which does minimal logic. This class is used when the JavaScript content manager doesn't use the Python notebook manager, but rather implements that logic client side, as is the case for the Google Drive based content manager. A sample command line that uses the Google Drive content manager, and the ClientSideNotebookManager, is ipython notebook --NotebookApp.webapp_settings="{'contentmanager_js_source': 'base/js/drive_contentmanager'}" --NotebookApp.notebook_manager_class="IPython.html.services.notebooks.clientsidenbmanager.ClientSideNotebookManager"

File last commit:

r12864:ba77f89f
r18639:28c27a69
Show More
latex.py
47 lines | 1.7 KiB | text/x-python | PythonLexer
Jonathan Frederic
Cleanup and refactor, transformers
r10674 """Module that allows latex output notebooks to be conditioned before
Jonathan Frederic
Added code to fix the math $ in the notebook so it...
r9776 they are converted.
"""
Jonathan Frederic
Transformer refactor
r10436 #-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------
Jonathan Frederic
Added code to fix the math $ in the notebook so it...
r9776
Jonathan Frederic
Transformer refactor
r10436 #-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor, transformers
r10674
Jonathan Frederic
Transformer refactor
r10436 from __future__ import print_function, absolute_import
Jonathan Frederic
Added code to fix the math $ in the notebook so it...
r9776
MinRK
remove strip_math_space...
r12864 from .base import Preprocessor
Jonathan Frederic
Added code to fix the math $ in the notebook so it...
r9776
Jonathan Frederic
Transformer refactor
r10436 #-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor, transformers
r10674
Paul Ivanov
replace 'transformer' with 'preprocessor'
r12219 class LatexPreprocessor(Preprocessor):
MinRK
remove strip_math_space...
r12864 """Preprocessor for latex destined documents.
Mainly populates the `latex` key in the resources dict,
adding definitions for pygments highlight styles.
Matthias BUSSONNIER
fix remove math space
r9882 """
Jonathan Frederic
Unecessary re-coding, inherits from base now.
r9779
Jonathan Frederic
Move the pygments definition importing logic from the...
r12659 def preprocess(self, nb, resources):
MinRK
remove strip_math_space...
r12864 """Preprocessing to apply on each notebook.
Jonathan Frederic
Move the pygments definition importing logic from the...
r12659
Parameters
----------
nb : NotebookNode
Notebook being converted
resources : dictionary
Additional resources used in the conversion process. Allows
preprocessors to pass variables into the Jinja engine.
"""
MinRK
remove strip_math_space...
r12864 # Generate Pygments definitions for Latex
from pygments.formatters import LatexFormatter
Jonathan Frederic
Added spaces between comments.
r10476
MinRK
remove strip_math_space...
r12864 resources.setdefault("latex", {})
resources["latex"].setdefault("pygments_definitions", LatexFormatter().get_style_defs())
return nb, resources