sphinx.py
34 lines
| 1.3 KiB
| text/x-python
|
PythonLexer
Jonathan Frederic
|
r10588 | |||
#----------------------------------------------------------------------------- | ||||
# 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 | ||||
#----------------------------------------------------------------------------- | ||||
# local import | ||||
Jonathan Frederic
|
r10624 | import latex | ||
from IPython.utils.traitlets import Unicode | ||||
Jonathan Frederic
|
r10626 | from nbconvert.transformers.sphinx import SphinxTransformer | ||
Jonathan Frederic
|
r10588 | #----------------------------------------------------------------------------- | ||
# Classes | ||||
#----------------------------------------------------------------------------- | ||||
Jonathan Frederic
|
r10624 | class SphinxExporter(latex.LatexExporter): | ||
Jonathan Frederic
|
r10588 | |||
Jonathan Frederic
|
r10624 | template_file = Unicode( | ||
Jonathan Frederic
|
r10630 | 'sphinx_howto', config=True, | ||
Jonathan Frederic
|
r10624 | help="Name of the template file to use") | ||
Jonathan Frederic
|
r10588 | |||
def _register_transformers(self): | ||||
#Register the transformers of the base class. | ||||
Jonathan Frederic
|
r10630 | super(SphinxExporter, self)._register_transformers() | ||
Jonathan Frederic
|
r10588 | |||
Jonathan Frederic
|
r10624 | #Register sphinx latex transformer | ||
self.register_transformer(SphinxTransformer) | ||||
Jonathan Frederic
|
r10588 | |||