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/
|
2016-11-02 14:33:41 +00:00
|
|
|
|
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
|
|
|
|
2021-05-28 09:21:05 +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
|
2021-05-28 09:21:05 +00:00
|
|
|
# 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
|
2021-05-28 09:21:05 +00:00
|
|
|
# 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
|
2015-05-05 10:07:25 +00:00
|
|
|
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}
|
2016-11-02 14:33:41 +00:00
|
|
|
|
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}
|
|
|
|
|
2023-06-02 08:43:53 +00:00
|
|
|
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
|
2016-11-02 14:33:41 +00:00
|
|
|
|
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
|
2021-05-25 13:08:50 +00:00
|
|
|
open http://127.0.0.1:8010
|
|
|
|
mkdocs serve -a localhost:8010
|
2016-11-02 14:33:41 +00:00
|
|
|
|
2016-01-21 11:21:03 +00:00
|
|
|
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
|
2015-06-05 13:20:02 +00:00
|
|
|
|
|
|
|
|