From: Richard W.M. Jones Date: Mon, 13 Jan 2020 12:51:21 +0000 (+0000) Subject: docs: Build plain text version of documentation. X-Git-Tag: v'0.2'~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=1c0b762f3e440d492bd061a718afdf1c5adbcbc1;p=goals.git docs: Build plain text version of documentation. Would build HTML version, but pod2html looks terrible. --- diff --git a/.gitignore b/.gitignore index de544e8..1a724bb 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /local* /man/*.? +/man/*.?.txt .depend Goalfile diff --git a/Goalfile.in b/Goalfile.in index 05a78dc..ec423f1 100644 --- a/Goalfile.in +++ b/Goalfile.in @@ -120,9 +120,10 @@ goal depend = # Documentation. let POD2MAN = "@POD2MAN@" +let POD2TEXT = "@POD2TEXT@" -goal documentation = : pod2man ("goals", "1"), - pod2man ("Goalfile", "5") +goal documentation = : pod2man ("goals", "1"), pod2man ("Goalfile", "5"), + pod2text ("goals", "1"), pod2text ("Goalfile", "5") goal pod2man (page, section) = "man/%page.%section" : "docs/%page.pod" { @@ -136,6 +137,14 @@ goal pod2man (page, section) = mv %@-t %@ } +goal pod2text (page, section) = +"man/%page.%section.txt" : "docs/%page.pod" { + rm -f %@ %@-t + mkdir -p man + %POD2TEXT -u %< > %@-t + mv %@-t %@ +} + #---------------------------------------------------------------------- # Tests. diff --git a/README b/README index 5ecbed8..1b18f3d 100644 --- a/README +++ b/README @@ -96,7 +96,7 @@ Requirements: - menhir (an OCaml-based parser generator) - - pod2man (part of Perl, for generating documentation) + - pod2man and pod2text (part of Perl, for generating documentation) - autoconf and automake diff --git a/configure.ac b/configure.ac index 51ea721..380a734 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,10 @@ AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [ AC_MSG_ERROR([pod2man tool from Perl is required]) ]) +AC_CHECK_PROG([POD2TEXT], [pod2text], [pod2text], [ + AC_MSG_ERROR([pod2text tool from Perl is required]) +]) + dnl Substitute OCaml flags and packages. AC_SUBST([OCAMLFLAGS], ["-g -safe-string -warn-error CDEFLMPSUVYZX+52-3"]) AC_SUBST([OCAMLPACKAGES], ["-package str,unix,threads -thread"])