docs.py 665 B

1234567891011121314151617181920212223
  1. """Serve QMK documentation locally
  2. """
  3. import shutil
  4. from qmk.docs import prepare_docs_build_area, run_docs_command
  5. from milc import cli
  6. @cli.subcommand('Run a local webserver for QMK documentation.', hidden=False if cli.config.user.developer else True)
  7. def docs(cli):
  8. """Spin up a local HTTP server for the QMK docs.
  9. """
  10. if not shutil.which('doxygen'):
  11. cli.log.error('doxygen is not installed. Please install it and try again.')
  12. return
  13. if not shutil.which('npm'):
  14. cli.log.error('npm is not installed. Please install it and try again.')
  15. return
  16. prepare_docs_build_area()
  17. run_docs_command('start', False)