Skip to content

Commit

Permalink
Internal docs generation updates (qmk#16411)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark committed Feb 21, 2022
1 parent b1de11c commit f30f963
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

# QMK-specific
api_data/v1
doxygen/
quantum/version.h
*.bin
*.eep
Expand Down
6 changes: 3 additions & 3 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "QMK Firmware"
PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
OUTPUT_DIRECTORY = doxygen
OUTPUT_DIRECTORY = .build/doxygen
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
Expand Down Expand Up @@ -145,7 +145,7 @@ FILE_PATTERNS = *.c \
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = */protocol/arm_atsam/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
Expand Down Expand Up @@ -209,7 +209,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
PREDEFINED = __DOXYGEN__ PROGMEM
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES

Expand Down
16 changes: 10 additions & 6 deletions lib/python/qmk/cli/generate/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from milc import cli

DOCS_PATH = Path('docs/')
BUILD_PATH = Path('.build/docs/')
BUILD_PATH = Path('.build/')
BUILD_DOCS_PATH = BUILD_PATH / 'docs'
DOXYGEN_PATH = BUILD_PATH / 'doxygen'


@cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True)
Expand All @@ -18,10 +20,12 @@ def generate_docs(cli):
* [ ] Add a real build step... something static docs
"""

if BUILD_PATH.exists():
shutil.rmtree(BUILD_PATH)
if BUILD_DOCS_PATH.exists():
shutil.rmtree(BUILD_DOCS_PATH)
if DOXYGEN_PATH.exists():
shutil.rmtree(DOXYGEN_PATH)

shutil.copytree(DOCS_PATH, BUILD_PATH)
shutil.copytree(DOCS_PATH, BUILD_DOCS_PATH)

# When not verbose we want to hide all output
args = {
Expand All @@ -34,6 +38,6 @@ def generate_docs(cli):

# Generate internal docs
cli.run(['doxygen', 'Doxyfile'], **args)
cli.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args)
cli.run(['moxygen', '-q', '-g', '-o', BUILD_DOCS_PATH / 'internals_%s.md', DOXYGEN_PATH / 'xml'], **args)

cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH)
cli.log.info('Successfully generated internal docs to %s.', BUILD_DOCS_PATH)

0 comments on commit f30f963

Please sign in to comment.