docs(widgets) begin adding support for building live examples
This commit is contained in:
2
.github/workflows/compile_docs.yml
vendored
2
.github/workflows/compile_docs.yml
vendored
@@ -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
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ docs/doxygen_html
|
||||
docs/xml
|
||||
out_html
|
||||
__pycache__
|
||||
/emscripten_builder
|
||||
|
||||
15
scripts/build_html_examples.sh
Executable file
15
scripts/build_html_examples.sh
Executable file
@@ -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
|
||||
15
scripts/genexamplelist.sh
Executable file
15
scripts/genexamplelist.sh
Executable file
@@ -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 "};"
|
||||
Reference in New Issue
Block a user