asciidoc.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_name")
  15. def _template_name_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. {
  26. "NbConvertBase": {
  27. "display_data_priority": [
  28. "text/html",
  29. "text/markdown",
  30. "image/svg+xml",
  31. "image/png",
  32. "image/jpeg",
  33. "text/plain",
  34. "text/latex",
  35. ]
  36. },
  37. "ExtractOutputPreprocessor": {"enabled": True},
  38. "HighlightMagicsPreprocessor": {"enabled": True},
  39. }
  40. )
  41. if super().default_config:
  42. c2 = super().default_config.copy()
  43. c2.merge(c)
  44. c = c2
  45. return c