From a42f55c327a0c2dc0e5ea17fb5b241ec5dbbbb39 Mon Sep 17 00:00:00 2001 From: Agah Date: Mon, 9 Sep 2024 12:47:50 -0400 Subject: [PATCH] Add build option --- example.py | 2 +- myst_libre/tools/myst_client.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/example.py b/example.py index 5aeb8be..204c149 100644 --- a/example.py +++ b/example.py @@ -19,4 +19,4 @@ hub.spawn_jupyter_hub() -MystBuilder(hub).build() \ No newline at end of file +MystBuilder(hub).build() diff --git a/myst_libre/tools/myst_client.py b/myst_libre/tools/myst_client.py index eaf9ff6..a3187f5 100644 --- a/myst_libre/tools/myst_client.py +++ b/myst_libre/tools/myst_client.py @@ -142,6 +142,18 @@ def build(self): env = os.environ.copy() self.env_vars.update(env) return self.run_command('build', '--execute', '--html',env_vars=self.env_vars) + + def build_site(self): + """ + Build the MyST markdown project. + + Returns: + str: Command output or None if failed. + """ + os.chdir(self.build_dir) + env = os.environ.copy() + self.env_vars.update(env) + return self.run_command('build', '--site',env_vars=self.env_vars) def convert(self, input_file, output_file): """