diff options
-rw-r--r-- | .github/workflows/compile_docs.yml | 2 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | scripts/build_html_examples.sh | 15 | ||||
-rwxr-xr-x | scripts/genexamplelist.sh | 15 |
4 files changed, 33 insertions, 0 deletions
diff --git a/.github/workflows/compile_docs.yml b/.github/workflows/compile_docs.yml index 1b3dcdb5a..e3e6ffa7a 100644 --- a/.github/workflows/compile_docs.yml +++ b/.github/workflows/compile_docs.yml @@ -22,6 +22,8 @@ jobs: - name: Install requirements run: | pip install --upgrade --upgrade-strategy eager sphinx recommonmark commonmark breathe sphinx-rtd-theme sphinx-markdown-tables sphinx-sitemap + - name: Build examples + run: scripts/build_html_examples.sh - name: Build docs run: docs/build.py - name: Remove .doctrees diff --git a/.gitignore b/.gitignore index 6ffdc9de5..70b1a3fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ docs/doxygen_html docs/xml out_html __pycache__ +/emscripten_builder diff --git a/scripts/build_html_examples.sh b/scripts/build_html_examples.sh new file mode 100755 index 000000000..1ffdaf936 --- /dev/null +++ b/scripts/build_html_examples.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +CURRENT_REF="$(git rev-parse HEAD)" +rm -rf emscripten_builder +git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder +scripts/genexamplelist.sh > emscripten_builder/examplelist.c +cd emscripten_builder +git submodule update --init -- lvgl +cd lvgl +git checkout $CURRENT_REF +cd .. +git submodule update --init -- lv_drivers +make -j$(nproc) CHOSEN_DEMO=lv_example_noop || exit 1 +cd .. +cp -a emscripten_builder/build docs/_static/built_lv_examples diff --git a/scripts/genexamplelist.sh b/scripts/genexamplelist.sh new file mode 100755 index 000000000..a52049925 --- /dev/null +++ b/scripts/genexamplelist.sh @@ -0,0 +1,15 @@ +#!/bin/bash +echo "/* Autogenerated */" +echo '#include <stddef.h>' +echo '#include "examplelist.h"' +TMPFILE=$(mktemp) +find examples -name \*.h | xargs grep -h "^void lv_example" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE +cat $TMPFILE | while read -r line; do +echo "extern void ${line}(void);" +done +echo "const struct lv_ci_example lv_ci_example_list[] = {" +cat $TMPFILE | while read -r line; do +echo " { \"$line\", $line },"; +done +echo " { NULL, NULL }" +echo "};" |