Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}",