File: fake_exporters.py

package info (click to toggle)
nbconvert 7.16.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,044 kB
  • sloc: python: 8,394; makefile: 199; javascript: 2
file content (25 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
Module that define a custom exporter just to test the ability to invoke
nbconvert with full qualified name
"""

from traitlets import default

from nbconvert.exporters.html import HTMLExporter


class MyExporter(HTMLExporter):
    """
    My custom exporter
    """

    @default("file_extension")
    def _file_extension_default(self):
        """
        The new file extension is `.test_ext`
        """
        return ".test_ext"

    @default("template_extension")
    def _template_extension_default(self):
        return ".html.j2"