aboutsummaryrefslogtreecommitdiffstats
path: root/util/generate_internal_docs.sh
blob: bfee797d3abcdf9e4c208226af0a46ef0fdc152f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

set -x

if ! doxygen -v 2>&1 > /dev/null; then
	echo "doxygen not found! Please install it!"
	exit 1
elif ! moxygen -V 2>&1 > /dev/null; then
	echo -n "moxygen not found! Would you like to install it? [y/n] "
	read ANSWER
	case $ANSWER in
		y|Y|yes|YES|Yes)
			npm install -g moxygen
		;;
		*)
			exit 1
		;;
	esac
fi

if [ ! -e Doxyfile ]; then
	echo "Error: You must run this from the top-level qmk_firmware directory!"
	exit 1
fi

# Generate the doxygen XML files
rm -rf doxygen
doxygen Doxyfile

# Generate the moxygen Markdown files
moxygen -a -g -o docs/internals_%s.md doxygen/xml