From d83630a9ef8c0b313254e58eff8cc4b2331ee29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 18 Mar 2019 21:58:02 +0100 Subject: Add texinfo generation from source. --- .gitignore | 1 + Makefile | 23 +++++++++++++++++++++++ gendoc.scm | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100755 gendoc.scm diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0925d3d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +monad.texi diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c4e6aaa --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.PHONY: all doc install install-doc clean + +INFODIR = /usr/local/share/info + +all: doc + +doc: monad.info + +%.info: %.texi + makeinfo $< + +monad.texi: monad.scm + ./gendoc.scm + +install: install-doc + +install-doc: monad.info + cp $< $(INFODIR) + install-info --info-dir=$(INFODIR) --info-file=$< + +clean: + -rm *.texi + -rm *.info diff --git a/gendoc.scm b/gendoc.scm new file mode 100755 index 0000000..f493b42 --- /dev/null +++ b/gendoc.scm @@ -0,0 +1,57 @@ +#!/usr/bin/guile \ +-e main -s +!# + +(add-to-load-path (dirname (current-filename))) + +(use-modules (texinfo reflection) + (texinfo serialize) + (texinfo indexing) + (sxml simple)) + +(define name "Haskell-like Monads") +(define filename "monad.info") +(define infile "monad.texi") +(define version "0.7") +(define years '(2019)) + +(define last-updated (strftime "%Y-%m-%d" (localtime (current-time)))) + +(define modules + '(((monad) "Base module") + ((monad optional) "Optional (Maybe) type") + ((monad state) "State monad") + ((monad stack) "Stacks implemented on top of the state monad") + )) + +(define prolog + (package-stexi-standard-prologue + name filename + "The Algorithmic Language Scheme" ; (dir) Top category + "Haskell like monads in Scheme" ; For (dir) Top + + (package-stexi-standard-copying + name version last-updated years + "Hugo Hörnquist" "Permissions?") + + (package-stexi-standard-titlepage + name + version last-updated + '(("Hugo Hörnquist" . "hugo@lysator.liu.se"))) + + (package-stexi-standard-menu + name + (map car modules) + (map cdr modules) + '()))) + +(define stexi-doc + (package-stexi-documentation + (map car modules) + name filename + prolog + '())) + +(define (main args) + (with-output-to-file infile + (lambda () (display (stexi->texi stexi-doc-real))))) -- cgit v1.2.3