diff --git a/docs/example_list.py b/docs/example_list.py index cf4f48b0ba..4f195961d4 100755 --- a/docs/example_list.py +++ b/docs/example_list.py @@ -84,14 +84,15 @@ def print_item(path, lvl, d, fout): fout.write("\n") def exec(): - path ="../examples/" + paths = [ "../examples/", "../demos/"] fout = open("examples.md", "w") filelist = [] - for root, dirs, files in os.walk(path): - for f in files: - #append the file name to the list - filelist.append(os.path.join(root,f)) + for path in paths: + for root, dirs, files in os.walk(path): + for f in files: + #append the file name to the list + filelist.append(os.path.join(root,f)) filelist = [ fi for fi in filelist if fi.endswith("index.rst") ] diff --git a/scripts/genexamplelist.sh b/scripts/genexamplelist.sh index a52049925c..6547c002bc 100755 --- a/scripts/genexamplelist.sh +++ b/scripts/genexamplelist.sh @@ -3,7 +3,7 @@ echo "/* Autogenerated */" echo '#include ' echo '#include "examplelist.h"' TMPFILE=$(mktemp) -find examples -name \*.h | xargs grep -h "^void lv_example" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE +find examples demos -name \*.h | xargs grep -hE "^void lv_(example|demo)" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE cat $TMPFILE | while read -r line; do echo "extern void ${line}(void);" done