python formatting

This commit is contained in:
Nick Brassel
2023-05-01 17:13:55 +10:00
parent 37fcefb0e8
commit bdcf3c69c9
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ from qmk.docs import prepare_docs_build_area, run_docs_command, BUILD_DOCS_PATH
from milc import cli
@cli.argument('-s', '--serve', arg_only=True, action='store_true', help="Serves the generated docs once built.")
@cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True)
def generate_docs(cli):

View File

@ -12,9 +12,11 @@ BUILD_PATH = QMK_FIRMWARE / '.build'
BUILD_DOCS_PATH = BUILD_PATH / 'docs'
DOXYGEN_PATH = BUILD_DOCS_PATH / 'static' / 'doxygen'
def run_docs_command(cmd, capture_output = False if cli.config.general.verbose else True):
def run_docs_command(cmd, capture_output=False if cli.config.general.verbose else True):
cli.run(['npm', 'run', '--prefix', BUILD_DOCS_PATH, cmd], capture_output=capture_output, check=True, stdin=DEVNULL)
def prepare_docs_build_area():
if BUILD_DOCS_PATH.exists():
shutil.rmtree(BUILD_DOCS_PATH)