Skip to content

Instantly share code, notes, and snippets.

@iacore
Last active December 8, 2022 19:35
Show Gist options
  • Save iacore/624e5da6825ea8b8e57c8c58899df484 to your computer and use it in GitHub Desktop.
Save iacore/624e5da6825ea8b8e57c8c58899df484 to your computer and use it in GitHub Desktop.
katla runner

katla runner

A script that generates docs for every module installed under ~/.idris2.

Usage

  • Install Idris 2.
  • Install Katla with make install.
  • Install some libraries with source with idris2 --install-with-src pkg.ipkg.
  • ./gen.sh
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment