doc: set commit/tag in mkdocs.yml

This commit is contained in:
Matthias Ringwald 2020-10-06 11:52:23 +02:00
parent a5061c7ea0
commit d5a5379299
3 changed files with 20 additions and 2 deletions

View File

@ -20,7 +20,7 @@ pdf:
mv latex/btstack_gettingstarted.pdf btstack.pdf
preview: update_content html
# race condition, open browser before startnig MKdocs
# race condition, open browser before starting MKdocs server
open http://127.0.0.1:8000
mkdocs serve
@ -28,6 +28,8 @@ update_content:
sed -e "s|../doc/manual/docs/||g" ../../chipset/README.md > docs/chipsets.md
rm -rf tmp
mkdir tmp
# create mkdocs.yml
./update_mkdocs_yml.sh
# create docs/appendix/apis.md
./update_apis.py
# create docs/examples/examples.md

View File

@ -1,4 +1,4 @@
site_name: BTstack Manual v1.0
site_name: BTstack Manual VERSION
site_dir: btstack
docs_dir: docs_final
extra_css: ['btstack.css']

16
doc/manual/update_mkdocs_yml.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env sh
# get commit and tag
tag=`git tag --points-at`
commit=`git rev-parse --short HEAD`
# use tag if available
if [ -z "$tag" ]
then
version=$commit
else
version=$tag
fi
# create mkdocs.yml
sed -e "s|VERSION|$version|" mkdocs-template.yml > mkdocs.yml