btstack/doc/manual/Makefile

85 lines
2.6 KiB
Makefile
Raw Permalink Normal View History

2021-05-27 12:45:58 +00: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-28 13:35:09 +00:00
LATEX_FOLDER = latex/
2021-05-27 12:45:58 +00:00
all: html pdf
docs-markdown:
# create new docs_markdown
2021-05-28 13:35:09 +00:00
rm -rf ${MARKDOWN_FOLDER}
cp -r docs-template ${MARKDOWN_FOLDER}
mkdir ${MARKDOWN_FOLDER}/examples
mkdir ${MARKDOWN_FOLDER}/ports
2021-05-27 12:45:58 +00:00
# create mkdocs-temp.yml
2021-05-27 12:45:58 +00:00
./update_mkdocs_yml.sh
# following should create files in docs-markdown
# Use chipsets/readme as chipsets.md
2021-05-28 13:35:09 +00:00
sed -e "s|../doc/manual/docs-template/||g" ../../chipset/README.md > ${MARKDOWN_FOLDER}/chipsets.md
2021-05-27 12:45:58 +00:00
# create docs-markdown/appendix/apis.md
2021-05-27 13:01:29 +00:00
# create references.p
# create mkdocs.yml
2021-05-28 13:35:09 +00:00
# create mkdocs-latex.yml
2021-05-27 13:01:29 +00:00
./markdown_create_apis.py -r ${BTSTACK_FOLDER} -g ${GITHUB_URL} -o ${MARKDOWN_FOLDER}
2021-05-27 12:45:58 +00:00
# create docs-markdown/examples/examples.md
2021-05-27 13:01:29 +00:00
./markdown_create_examples.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 12:45:58 +00:00
# create docs-markdown/ports/existing_ports.md
2021-05-27 13:01:29 +00:00
./markdown_create_ports.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 12:45:58 +00:00
# create docs-markdown/gatt_clients.md and docs-template/gatt_services.md
2021-05-27 13:01:29 +00:00
./markdown_create_gatt_services_and_clients.py -r ${BTSTACK_FOLDER} -t ${INTRO_FOLDER} -o ${MARKDOWN_FOLDER}
2021-05-27 12:45:58 +00:00
docs: docs-markdown
# create new docs
2021-05-28 13:35:09 +00:00
rm -rf ${MKDOCS_FOLDER}
cp -r ${MARKDOWN_FOLDER} ${MKDOCS_FOLDER}
2021-05-27 12:45:58 +00:00
# docs-markdown -> docs
2023-03-03 09:52:40 +00:00
./markdown_update_references.py -i ${MARKDOWN_FOLDER} -o ${MKDOCS_FOLDER} -g ${GITHUB_URL}
2021-05-27 12:45:58 +00:00
html: docs
# generate HTML into btstack folder
mkdocs build --clean
2021-05-27 12:45:58 +00:00
2021-05-27 13:01:29 +00:00
# post-process HTML using references.p
./html_postprocess_code_blocks.py -o ${HTML_FOLDER}
2021-05-27 12:45:58 +00:00
pdf: docs
2021-05-28 13:35:09 +00:00
rm -rf ${LATEX_FOLDER}
mkdir -p ${LATEX_FOLDER}
cp -r ${MKDOCS_FOLDER}/picts ${LATEX_FOLDER}
cp mkdocs-latex.yml mkdocs.yml
2021-05-25 06:53:22 +00:00
# create latex/btstack_gettingstartec.tex with version
2021-05-28 13:35:09 +00:00
./update_getting_started.sh ${LATEX_FOLDER}
2017-12-23 21:22:41 +00:00
# create latex/btstack_generated.md -> latex/btstack_final.tex
2021-05-28 13:35:09 +00:00
./markdown2tex.py -i ${MKDOCS_FOLDER} -o ${LATEX_FOLDER}
cp ${MKDOCS_FOLDER}/ports/*.jpg ${MKDOCS_FOLDER}/ports/*.png ${LATEX_FOLDER}
2021-05-28 13:35:09 +00:00
cd ${LATEX_FOLDER} && pdflatex btstack_gettingstarted.tex && pdflatex btstack_gettingstarted.tex
mv ${LATEX_FOLDER}/btstack_gettingstarted.pdf btstack.pdf
2021-05-27 12:45:58 +00:00
preview: docs
2020-10-06 09:52:23 +00:00
# race condition, open browser before starting MKdocs server
open http://127.0.0.1:8010
mkdocs serve -a localhost:8010
clean:
2021-05-28 13:35:09 +00:00
rm -rf ${MARKDOWN_FOLDER} ${LATEX_FOLDER} ${HTML_FOLDER} ${MKDOCS_FOLDER}
rm -f *.pdf
rm -f references.p
rm -f mkdocs.yml mkdocs-latex.yml mkdocs-temp.yml