Skip to content

Commit 4266e68

Browse files
committed
Improve build command
1 parent 7cfd83d commit 4266e68

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

myst_libre/builders/myst_builder.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ def __init__(self, hub):
1818
def setenv(self,key,value):
1919
self.env_vars[key] = value
2020

21-
def build(self):
21+
def build(self,*args):
2222
self.cprint(f'Starting MyST build {self.hub.jh_url}','yellow')
23-
self.myst_client.build()
24-
25-
def build_noexecute(self):
26-
self.cprint(f'Starting MyST build {self.hub.jh_url}','yellow')
27-
self.myst_client.build_noexecute()
28-
29-
def build_site(self):
30-
self.cprint(f'Starting MyST build site {self.hub.jh_url}','yellow')
31-
self.myst_client.build_site()
23+
self.myst_client.build('build',*args)

myst_libre/tools/myst_client.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,37 +131,19 @@ def run_command(self, *args, env_vars={}):
131131
print(f"Unexpected error: {e}")
132132
return None
133133

134-
def build(self):
134+
def build(self, *args):
135135
"""
136-
Build the MyST markdown project.
136+
Build the MyST markdown project with specified arguments.
137137
138-
Returns:
139-
str: Command output or None if failed.
140-
"""
141-
os.chdir(self.build_dir)
142-
self.cprint(f"--> Self env vars {self.env_vars}", "green")
143-
return self.run_command('build', '--execute', '--html',env_vars=self.env_vars)
144-
145-
def build_noexecute(self):
146-
"""
147-
Build the MyST markdown project.
138+
Args:
139+
*args: Variable length argument list for the myst command.
148140
149141
Returns:
150142
str: Command output or None if failed.
151143
"""
152144
os.chdir(self.build_dir)
153145
self.cprint(f"--> Self env vars {self.env_vars}", "green")
154-
return self.run_command('build','--html',env_vars=self.env_vars)
155-
156-
def build_site(self):
157-
"""
158-
Build the MyST markdown project.
159-
160-
Returns:
161-
str: Command output or None if failed.
162-
"""
163-
os.chdir(self.build_dir)
164-
return self.run_command('build', '--site',env_vars=self.env_vars)
146+
return self.run_command(*args, env_vars=self.env_vars)
165147

166148
def convert(self, input_file, output_file):
167149
"""

0 commit comments

Comments
 (0)