docs add demos

This commit is contained in:
Themba Dube 2021-12-29 16:10:36 -05:00
parent 26ea9b00fc
commit 02a6614b38
2 changed files with 7 additions and 6 deletions

View File

@ -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") ]

View File

@ -3,7 +3,7 @@ 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
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