From 0f9d91c8fd1540bd4eef9b210773b774fb593c45 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 12 Sep 2024 11:44:14 +0200 Subject: [PATCH] Invert option --- nbsite/__main__.py | 2 +- nbsite/cmd.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nbsite/__main__.py b/nbsite/__main__.py index d2a34a10..8a055630 100644 --- a/nbsite/__main__.py +++ b/nbsite/__main__.py @@ -43,13 +43,13 @@ def main(args=None): build_parser = subparsers.add_parser("build", help=inspect.getdoc(build)) build_parser.add_argument('--what',type=str,help='type of output to generate',default='html') - build_parser.add_argument('--project-name', type=str, help='name of project', default='') build_parser.add_argument('--org',type=str,help='github organization',default='') build_parser.add_argument('--host',type=str,help='host to use when generating notebook links',default='GitHub') build_parser.add_argument('--repo',type=str,help='name of repo',default='') build_parser.add_argument('--branch',type=str,help='branch to point to in notebook links',default='main') build_parser.add_argument('--binder',type=str,help='where to place binder link',choices=['bottom', 'top', 'both', 'none'], default='none') + build_parser.add_argument('--disable-parallel',action=argparse.BooleanOptionalAction,help='whether to disable building the docs in parallel') build_parser.add_argument('--output',type=str,help='where to place output',default="builtdocs") _add_common_args(build_parser,'--project-root','--doc','--examples', '--overwrite') diff --git a/nbsite/cmd.py b/nbsite/cmd.py index 1b3726c9..866c3134 100644 --- a/nbsite/cmd.py +++ b/nbsite/cmd.py @@ -57,7 +57,7 @@ def build(what='html', branch='main', org='', binder='none', - parallel=False, + disable_parallel=False, examples='examples', examples_assets='assets', clean_dry_run=False, @@ -90,7 +90,7 @@ def build(what='html', for path in glob.glob(os.path.join(paths['doc'], '**', '*.ipynb'), recursive=True): print('Removing evaluated notebook from {}'.format(path)) os.remove(path) - extras = ["-j", "auto"] if parallel else [] + extras = [] if disable_parallel else ["-j", "auto"] cmd = ["sphinx-build", "-b", what, paths['doc'], output] + extras subprocess.check_call(cmd, env=merged_env) print('Copying json blobs (used for holomaps) from {} to {}'.format(paths['doc'], output))