docs.py 754 B

123456789101112131415161718192021222324
  1. """Build QMK documentation locally
  2. """
  3. from qmk.docs import prepare_docs_build_area, run_docs_command, BUILD_DOCS_PATH
  4. from milc import cli
  5. @cli.argument('-s', '--serve', arg_only=True, action='store_true', help="Serves the generated docs once built.")
  6. @cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True)
  7. def generate_docs(cli):
  8. """Invoke the docs generation process
  9. TODO(unclaimed):
  10. * [ ] Add a real build step... something static docs
  11. """
  12. prepare_docs_build_area()
  13. cli.log.info('Building docusaurus docs')
  14. run_docs_command('build')
  15. cli.log.info('Successfully generated docs to %s.', BUILD_DOCS_PATH)
  16. if cli.args.serve:
  17. run_docs_command('serve', False)