hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit e7de0a6daaed219e08d8af34a8061fb4d737e8e7
parent f870e1e4ab5c829be61d52ab307dc7df794b5f3a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Wed, 21 Apr 2021 09:58:28 -0400

scripts/gen-docs: new script

Diffstat:
M.gitignore | 1+
Ascripts/gen-docs | 17+++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -2,3 +2,4 @@ config.mk .cache .bin *.1 +docs/html diff --git a/scripts/gen-docs b/scripts/gen-docs @@ -0,0 +1,17 @@ +#!/bin/sh +# Yes, I am entirely aware that this is a hack +modules=$(awk ' +/^modules="/ { sub(/.*=\"/, ""); gsub(/_/, "::"); print $1; mods = 1 } +/^[a-z_]+$/ { if (mods == 1) { gsub(/_/, "::"); print $1 } } +/^[a-z]+"$/ { if (mods == 1) { mods = 0; sub(/"/, ""); gsub(/_/, "::"); print $1 } } +' < scripts/gen-stdlib) + +mkdir -p docs/html/ + +haredoc -Fhtml > docs/html/index.html +for mod in $modules +do + path="$(echo $mod | sed -e 's?::?/?g')" + mkdir -p docs/html/$path + haredoc -Fhtml $mod >docs/html/$path/index.html +done