39 lines
949 B
Bash
39 lines
949 B
Bash
|
#!/bin/sh
|
||
|
cd $(dirname $0)
|
||
|
[ $NIM ] || echo You may want to run "NIM=~/nimskull/bin/nim $0"
|
||
|
[ $NIM ] || NIM=nim
|
||
|
URL=https://git.myou.dev/MyouProject/myou-engine
|
||
|
BRANCH=main
|
||
|
COMMIT=branch/$BRANCH
|
||
|
# rm -fr htmldocs
|
||
|
cd ..
|
||
|
function start(){
|
||
|
false # git stash
|
||
|
}
|
||
|
function end(){
|
||
|
false # git stash pop
|
||
|
}
|
||
|
function error(){
|
||
|
end
|
||
|
exit 1
|
||
|
}
|
||
|
start
|
||
|
$NIM doc --project --index:on \
|
||
|
--git.url:$URL --git.devel:$BRANCH --git.commit:$COMMIT \
|
||
|
--outdir:doc/htmldocs src/bundle.nim || error
|
||
|
for p in doc/*.rst;do
|
||
|
$NIM rst2html --project --index:on \
|
||
|
--git.url:$URL --git.devel:$BRANCH --git.commit:$COMMIT \
|
||
|
--outdir:doc/htmldocs $p || error
|
||
|
done
|
||
|
cd -
|
||
|
|
||
|
$NIM r fixdocs.nim htmldocs/* htmldocs/**/* || error
|
||
|
find htmldocs/ -iname "*.html" -exec sed 's@theindex.html/FIXME/@@g' {} -i \;
|
||
|
grep "TYPES =" htmldocs/objects/mesh.html && (echo "FIXDOCS DIDN'T WORK!!!" ; error)
|
||
|
cp htmldocs/manual.html htmldocs/index.html
|
||
|
|
||
|
end
|
||
|
|
||
|
exit 0
|