A script that generates docs for every module installed under ~/.idris2
.
- Install Idris 2.
- Install Katla with
make install
. - Install some libraries with source with
idris2 --install-with-src pkg.ipkg
. ./gen.sh
out/ |
#!/usr/bin/env fish | |
# simple Fish script, 1 thread | |
set idris_path ~/.idris2/idris2-0.6.0 # be absolute | |
set out_path $PWD/out | |
set ttc_version 2022093000 | |
if not pushd $idris_path | |
echo "Idris not installed at: $idris_path" >&2 | |
exit 1 | |
end | |
for f in * | |
set tokens (string split '-' $f) | |
if test (count $tokens) -ne 2 # $f not 'pkg-ver' | |
continue | |
end | |
set pkg_name $tokens[1] | |
set pkg_ver $tokens[2] | |
echo "= Processing $pkg_name v$pkg_ver" | |
if not pushd $f/$ttc_version | |
echo "No TTC version $ttc_version" | |
continue | |
end | |
for ttm in **/*.ttm | |
set mod_name (string sub -e -4 $ttm) | |
set idr $mod_name".idr" | |
if not test -e $idr | |
echo "No Source: $idr" | |
continue | |
end | |
set target $out_path/$mod_name.html | |
mkdir -p (dirname $target) | |
katla html $idr $ttm > $target | |
end | |
popd | |
end |