shake: also generate info manuals

This commit is contained in:
Simon Michael 2016-04-18 17:54:55 -07:00
parent 165bf008da
commit 3d129f6d31
10 changed files with 33 additions and 13 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ ttttt.*
profs/*
shake
test.hs
*/doc/*.[0-9].md
*/doc/*.info

View File

@ -47,14 +47,15 @@ usage = [i|Usage:
./Shake site # generate the web site
./Shake manpages # generate nroff files for man
./Shake txtmanpages # generate text man pages for embedding
./Shake infomanpages # generate info files for info
./Shake webmanpages # generate web man pages for hakyll
./Shake webmanual # generate combined web man page for hakyll
|]
pandoc =
-- "stack exec -- pandoc" -- use the pandoc required above
"pandoc" -- use pandoc in PATH (faster)
pandoc = "pandoc" -- pandoc from PATH (faster)
-- "stack exec -- pandoc" -- pandoc from project's stackage snapshot
hakyllstd = "site/hakyll-std/hakyll-std"
makeinfo = "makeinfo"
nroff = "nroff"
main = do
@ -101,6 +102,8 @@ main = do
nroffmanpages = [manpageDir m </> m | m <- manpageNames]
-- manuals rendered to text, ready for embedding (hledger/doc/hledger.1.txt)
txtmanpages = [manpageDir m </> m <.> "txt" | m <- manpageNames]
-- manuals rendered to info, ready for info (hledger/doc/hledger.info)
infomanpages = [manpageDir m </> m <.> "info" | m <- manpageNames]
-- manuals rendered to markdown, ready for web output by hakyll (site/hledger.md)
webmanpages = ["site" </> manpageNameToUri m <.>"md" | m <- manpageNames]
-- manuals rendered to markdown and combined, ready for web output by hakyll
@ -122,6 +125,7 @@ main = do
phony "docs" $ do
need $
nroffmanpages
++ infomanpages
++ txtmanpages
-- compile pandoc helpers
@ -162,6 +166,27 @@ main = do
need [src]
cmd Shell nroff "-man" src ">" out
-- use m4 and pandoc to process macros, filter content, and convert to info, suitable for info viewing
phony "infomanpages" $ need infomanpages
infomanpages |%> \out -> do -- hledger/doc/hledger.info
let src = out -<.> "m4.md"
lib = "doc/lib.m4"
dir = takeDirectory out
-- assume all other m4 files in dir are included by this one XXX not true in hledger-lib
deps <- liftIO $ filter (/= src) . filter (".m4.md" `isSuffixOf`) . map (dir </>) <$> S.getDirectoryContents dir
need $ src : lib : deps ++ pandocFilters
cmd Shell
"m4 -P -I" dir lib src "|"
pandoc "-f markdown"
-- "--filter doc/pandoc-drop-web-blocks"
"--filter doc/pandoc-drop-html-blocks"
"--filter doc/pandoc-drop-html-inlines"
"--filter doc/pandoc-drop-links"
"--filter doc/pandoc-drop-notes"
"-t texinfo |"
makeinfo "--force --no-split -o" out
-- web site
phony "site" $ do

View File

@ -1 +0,0 @@
doc/*.[0-9].md

View File

@ -1,2 +0,0 @@
/.dist-buildwrapper/
doc/*.[0-9].md

View File

@ -1 +0,0 @@
doc/*.[0-9].md

View File

@ -1 +0,0 @@
doc/*.[0-9].md

2
hledger/.gitignore vendored
View File

@ -1,2 +0,0 @@
/.dist-buildwrapper/
doc/*.[0-9].md

View File

@ -97,7 +97,7 @@ $ hledger balance -p 2008/6 expenses -N --flat --drop 1
$1 supplies
```
### Depth limiting
### Depth limited balance reports
With `--depth N`, balance shows accounts only to the specified depth.
This is very useful to show a complex charts of accounts in less detail.

View File

@ -1022,7 +1022,7 @@ $\ hledger\ balance\ \-p\ 2008/6\ expenses\ \-N\ \-\-flat\ \-\-drop\ 1
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $1\ \ supplies
\f[]
.fi
.SS Depth limiting
.SS Depth limited balance reports
.PP
With \f[C]\-\-depth\ N\f[], balance shows accounts only to the specified
depth.

View File

@ -680,7 +680,7 @@ CCOOMMMMAANNDDSS
$1 food
$1 supplies
DDeepptthh lliimmiittiinngg
DDeepptthh lliimmiitteedd bbaallaannccee rreeppoorrttss
With --depth N, balance shows accounts only to the specified depth.
This is very useful to show a complex charts of accounts in less
detail. In flat mode, balances from accounts below the depth limit