Config options in custom exporter for nbconvert

I’d like to write an nbconvert custom exporter for the textbundle format, to be called from the “Download As” menu of Jupyter. Based on markdown, this format has some specific requirements that are satisfied by the following nbconvert config options:

  • JupyterApp.output_base = “text”
  • JupyterApp.output_files_dir = “assets”
  • FilesWriter.build_directory = “{notebook_name}.textbundle”

When running nbconvert from the command line, I can set these options and generate a textbundle using a command like:

jupyter nbconvert test.ipynb --to markdown --NbConvertApp.output_files_dir="assets" --FilesWriter.build_directory="{notebook_name}.textbundle" --NbConvertApp.output_base="text"

But how can I set these options within a custom exporter called by Jupyter?

I’ve tried specifying these options using a default_config function, for example:

    @property
    def default_config(self):
        c = Config({
            'NbConvertApp': {
                'output_base': 'text',
                'output_files_dir': 'assets'
            }
        })
        c.merge(super().default_config)
        return c        

However, these settings don’t seem to be used to generate output. Any suggestions? Thanks in advance!