From 7808d81046547d7d9f60449ec44334a124020a36 Mon Sep 17 00:00:00 2001 From: Steven Bamford Date: Fri, 22 Mar 2024 10:42:23 +0000 Subject: [PATCH] Add --no_browser option to nbdev_preview --- nbdev/quarto.py | 2 ++ nbs/api/14_quarto.ipynb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nbdev/quarto.py b/nbdev/quarto.py index 30de98e4a..ea71ded34 100644 --- a/nbdev/quarto.py +++ b/nbdev/quarto.py @@ -311,6 +311,7 @@ def nbdev_preview( path:str=None, # Path to notebooks port:int=None, # The port on which to run preview host:str=None, # The host on which to run preview + no_browser:bool=False, # Do not open a browser n_workers:int=defaults.cpus, # Number of workers **kwargs): "Preview docs locally" @@ -319,6 +320,7 @@ def nbdev_preview( xtra = [] if port: xtra += ['--port', str(port)] if host: xtra += ['--host', host] + if no_browser: xtra += ['--no-browser'] def _f(e): res = _proc_file(Path(e.src_path), cache, path) diff --git a/nbs/api/14_quarto.ipynb b/nbs/api/14_quarto.ipynb index d93b207c6..ef61e217d 100644 --- a/nbs/api/14_quarto.ipynb +++ b/nbs/api/14_quarto.ipynb @@ -606,6 +606,7 @@ " path:str=None, # Path to notebooks\n", " port:int=None, # The port on which to run preview\n", " host:str=None, # The host on which to run preview\n", + " no_browser:bool=False, # Do not open a browser\n", " n_workers:int=defaults.cpus, # Number of workers\n", " **kwargs):\n", " \"Preview docs locally\"\n", @@ -614,6 +615,7 @@ " xtra = []\n", " if port: xtra += ['--port', str(port)]\n", " if host: xtra += ['--host', host]\n", + " if no_browser: xtra += ['--no-browser']\n", "\n", " def _f(e):\n", " res = _proc_file(Path(e.src_path), cache, path)\n",