logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

docs.py (1103B)


  1. """Build QMK documentation locally
  2. """
  3. import shutil
  4. from qmk.docs import prepare_docs_build_area, run_docs_command, BUILD_DOCS_PATH
  5. from milc import cli
  6. @cli.argument('-s', '--serve', arg_only=True, action='store_true', help="Serves the generated docs once built.")
  7. @cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True)
  8. def generate_docs(cli):
  9. """Invoke the docs generation process
  10. TODO(unclaimed):
  11. * [ ] Add a real build step... something static docs
  12. """
  13. if not shutil.which('doxygen'):
  14. cli.log.error('doxygen is not installed. Please install it and try again.')
  15. return
  16. if not shutil.which('yarn'):
  17. cli.log.error('yarn is not installed. Please install it and try again.')
  18. return
  19. if not prepare_docs_build_area(is_production=True):
  20. return False
  21. cli.log.info('Building vitepress docs')
  22. run_docs_command('run', ['docs:build'])
  23. cli.log.info('Successfully generated docs to %s.', BUILD_DOCS_PATH)
  24. if cli.args.serve:
  25. run_docs_command('run', ['docs:preview'])