1
0
Fork 0

qmk docs: restore --port and --browser arguments (#24623)

* `qmk docs`: restore `--port` and `--browser` arguments

* Make docs command args always a list
This commit is contained in:
Ryan 2025-02-01 21:19:30 +11:00 committed by GitHub
parent ff09b921f1
commit 273d8d6a1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 19 deletions

View file

@ -6,6 +6,8 @@ from qmk.docs import prepare_docs_build_area, run_docs_command
from milc import cli
@cli.argument('-p', '--port', default=8936, type=int, help='Port number to use.')
@cli.argument('-b', '--browser', action='store_true', help='Open the docs in the default browser.')
@cli.subcommand('Run a local webserver for QMK documentation.', hidden=False if cli.config.user.developer else True)
def docs(cli):
"""Spin up a local HTTP server for the QMK docs.
@ -22,6 +24,7 @@ def docs(cli):
if not prepare_docs_build_area(is_production=False):
return False
if not cli.config.general.verbose:
cli.log.info('Serving docs at http://localhost:5173/ (Ctrl+C to stop)')
run_docs_command('run', 'docs:dev')
cmd = ['docs:dev', '--port', f'{cli.args.port}']
if cli.args.browser:
cmd.append('--open')
run_docs_command('run', cmd)