rst.py 963 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. """reStructuredText Exporter class"""
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. from traitlets import default
  5. from traitlets.config import Config
  6. from .templateexporter import TemplateExporter
  7. class RSTExporter(TemplateExporter):
  8. """
  9. Exports reStructuredText documents.
  10. """
  11. @default('file_extension')
  12. def _file_extension_default(self):
  13. return '.rst'
  14. @default('template_file')
  15. def _template_file_default(self):
  16. return 'rst.tpl'
  17. output_mimetype = 'text/restructuredtext'
  18. export_from_notebook = "reST"
  19. @property
  20. def default_config(self):
  21. c = Config({
  22. 'ExtractOutputPreprocessor':{
  23. 'enabled':True
  24. },
  25. 'HighlightMagicsPreprocessor': {
  26. 'enabled':True
  27. },
  28. })
  29. c.merge(super(RSTExporter,self).default_config)
  30. return c