btstack/doc/manual/Makefile

78 lines
2.3 KiB
Makefile
Raw Normal View History

2021-05-27 14:45:58 +02:00
GITHUB_URL = "https://github.com/bluekitchen/btstack/tree/"
BTSTACK_FOLDER = ../../
INTRO_FOLDER = docs-intro/
MARKDOWN_FOLDER = docs-markdown/
MKDOCS_FOLDER = docs/
HTML_FOLDER = btstack/
2021-05-27 14:45:58 +02:00
all: html pdf
docs-markdown:
# create new docs_markdown
rm -rf docs-markdown
cp -r docs-template docs-markdown
mkdir docs-markdown/examples
mkdir docs-markdown/ports
# create mkdocs.yml
./update_mkdocs_yml.sh
# following should create files in docs-markdown
# Use chipsets/readme as chipsets.md
sed -e "s|../doc/manual/docs-template/||g" ../../chipset/README.md > docs-markdown/chipsets.md
# create docs-markdown/appendix/apis.md
# create docs-markdown/api_index.md
2021-05-27 15:01:29 +02:00
# create references.p
./markdown_create_apis.py -r ${BTSTACK_FOLDER} -g ${GITHUB_URL} -o ${MARKDOWN_FOLDER}
2021-05-27 14:45:58 +02:00
# create docs-markdown/examples/examples.md
2021-05-27 15:01:29 +02:00
./markdown_create_examples.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 14:45:58 +02:00
# create docs-markdown/ports/existing_ports.md
2021-05-27 15:01:29 +02:00
./markdown_create_ports.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 14:45:58 +02:00
# create docs-markdown/gatt_clients.md and docs-template/gatt_services.md
2021-05-27 15:01:29 +02:00
./markdown_create_gatt_services_and_clients.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 14:45:58 +02:00
docs: docs-markdown
# create new docs_final
rm -rf docs
cp -r docs-markdown docs
# docs-markdown -> docs
2021-05-27 15:01:29 +02:00
./markdown_update_references.py -i ${MARKDOWN_FOLDER} -o ${MKDOCS_FOLDER}
2021-05-27 14:45:58 +02:00
html: docs
# generate HTML into btstack folder
mkdocs build --clean
2021-05-27 14:45:58 +02:00
2021-05-27 15:01:29 +02:00
# post-process HTML using references.p
./html_postprocess_code_blocks.py -o ${HTML_FOLDER}
2021-05-27 14:45:58 +02:00
pdf: docs
rm -rf latex
2015-06-05 17:38:11 +02:00
mkdir -p latex
cp -r docs/picts latex
2021-05-25 08:53:22 +02:00
# create latex/btstack_gettingstartec.tex with version
./update_getting_started.sh
2017-12-23 22:22:41 +01:00
# create latex/btstack_generated.md -> latex/btstack_final.tex
./markdown2tex.py
cp docs/ports/*.jpg latex
2015-06-05 17:38:11 +02:00
cd latex && pdflatex btstack_gettingstarted.tex && pdflatex btstack_gettingstarted.tex
2015-06-18 16:33:34 +02:00
mv latex/btstack_gettingstarted.pdf btstack.pdf
2021-05-27 14:45:58 +02:00
preview: docs
2020-10-06 11:52:23 +02:00
# race condition, open browser before starting MKdocs server
open http://127.0.0.1:8010
mkdocs serve -a localhost:8010
clean:
2021-05-27 14:45:58 +02:00
rm -rf docs-markdown docs tmp btstack *.pdf latex/btstack_generated.* latex/btstack_final.tex mkdocs.yml
2017-12-23 22:22:41 +01:00
rm -rf latex btstack help
2021-05-27 15:01:29 +02:00
rm -rf references.p