Skip to content

Commit

Permalink
Improve build command
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Sep 12, 2024
1 parent 7cfd83d commit 4266e68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
12 changes: 2 additions & 10 deletions myst_libre/builders/myst_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ def __init__(self, hub):
def setenv(self,key,value):
self.env_vars[key] = value

def build(self):
def build(self,*args):
self.cprint(f'Starting MyST build {self.hub.jh_url}','yellow')
self.myst_client.build()

def build_noexecute(self):
self.cprint(f'Starting MyST build {self.hub.jh_url}','yellow')
self.myst_client.build_noexecute()

def build_site(self):
self.cprint(f'Starting MyST build site {self.hub.jh_url}','yellow')
self.myst_client.build_site()
self.myst_client.build('build',*args)
28 changes: 5 additions & 23 deletions myst_libre/tools/myst_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,19 @@ def run_command(self, *args, env_vars={}):
print(f"Unexpected error: {e}")
return None

def build(self):
def build(self, *args):
"""
Build the MyST markdown project.
Build the MyST markdown project with specified arguments.
Returns:
str: Command output or None if failed.
"""
os.chdir(self.build_dir)
self.cprint(f"--> Self env vars {self.env_vars}", "green")
return self.run_command('build', '--execute', '--html',env_vars=self.env_vars)

def build_noexecute(self):
"""
Build the MyST markdown project.
Args:
*args: Variable length argument list for the myst command.
Returns:
str: Command output or None if failed.
"""
os.chdir(self.build_dir)
self.cprint(f"--> Self env vars {self.env_vars}", "green")
return self.run_command('build','--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)
return self.run_command('build', '--site',env_vars=self.env_vars)
return self.run_command(*args, env_vars=self.env_vars)

def convert(self, input_file, output_file):
"""
Expand Down

0 comments on commit 4266e68

Please sign in to comment.