asciidoc.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """ASCIIDoc 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 ASCIIDocExporter(TemplateExporter):
  8. """
  9. Exports to an ASCIIDoc document (.asciidoc)
  10. """
  11. @default('file_extension')
  12. def _file_extension_default(self):
  13. return '.asciidoc'
  14. @default('template_file')
  15. def _template_file_default(self):
  16. return 'asciidoc'
  17. output_mimetype = 'text/asciidoc'
  18. export_from_notebook = "AsciiDoc"
  19. @default('raw_mimetypes')
  20. def _raw_mimetypes_default(self):
  21. return ['text/asciidoc/', 'text/markdown', 'text/html', '']
  22. @property
  23. def default_config(self):
  24. c = Config({
  25. 'NbConvertBase': {
  26. 'display_data_priority': ['text/html',
  27. 'text/markdown',
  28. 'image/svg+xml',
  29. 'image/png',
  30. 'image/jpeg',
  31. 'text/plain',
  32. 'text/latex'
  33. ]
  34. },
  35. 'ExtractOutputPreprocessor': {'enabled': True},
  36. 'HighlightMagicsPreprocessor': {
  37. 'enabled':True
  38. },
  39. })
  40. c.merge(super(ASCIIDocExporter, self).default_config)
  41. return c