How to use the mknotebooks.extra_args_execute_preprocessor.ExtraArgsExecutePreprocessor function in mknotebooks

To help you get started, we’ve selected a few mknotebooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greenape / mknotebooks / mknotebooks / plugin.py View on Github external
def on_config(self, config: MkDocsConfig):
        exporter_config = Config()
        if self.config["execute"]:
            default_preprocessors = MarkdownExporter.default_preprocessors.default_args[
                0
            ]
            try:
                default_preprocessors[
                    default_preprocessors.index(
                        "nbconvert.preprocessors.ExecutePreprocessor"
                    )
                ] = ExtraArgsExecutePreprocessor
            except ValueError:
                pass
            exporter_config.default_preprocessors = default_preprocessors
            exporter_config.ExecutePreprocessor.timeout = self.config["timeout"]
            exporter_config.ExecutePreprocessor.allow_errors = self.config[
                "allow_errors"
            ]
            exporter_config.ExtraArgsExecutePreprocessor.enabled = True
            exporter_config.ExtractOutputPreprocessor.enabled = True
            preamble = [os.path.join(here, "pandas_output_formatter.py")]

            exporter_config.file_extension = ".md"
            if self.config["preamble"]:
                preamble.append(self.config["preamble"])
            exporter_config.ExtraArgsExecutePreprocessor.extra_arguments = [
                f"--InteractiveShellApp.exec_files={preamble}",

mknotebooks

Plugin for mkdocs to generate markdown documents from jupyter notebooks.

MIT
Latest version published 9 months ago

Package Health Score

59 / 100
Full package analysis