;tools:Shake manuals: more contributor instructions in the header comment [hledger_site#140]
This commit is contained in:
parent
3d0c1e40c8
commit
82007ca983
23
Shake.hs
23
Shake.hs
@ -542,15 +542,30 @@ main = do
|
|||||||
else h
|
else h
|
||||||
-- assume any other .m4.md files in dir are included by this one XXX not true in hledger-lib
|
-- assume any other .m4.md files in dir are included by this one XXX not true in hledger-lib
|
||||||
subfiles <- liftIO $ filter (/= src) . filter (".m4.md" `isSuffixOf`) . map (dir </>) <$> S.getDirectoryContents dir
|
subfiles <- liftIO $ filter (/= src) . filter (".m4.md" `isSuffixOf`) . map (dir </>) <$> S.getDirectoryContents dir
|
||||||
let deps = [src, commonm4, commandsm4, packageversionm4, packagemandatem4] ++ subfiles
|
let deps = [src, commonm4, packageversionm4, packagemandatem4] ++ subfiles
|
||||||
need deps
|
need deps
|
||||||
when (manual=="hledger") $ need commandmds
|
when (manual=="hledger") $ need $ commandsm4 : commandmds
|
||||||
-- add the web page's heading.
|
-- add the web page's heading.
|
||||||
-- XXX Might be nice to do this atomically with the below, so
|
-- XXX Might be nice to do this atomically with the below, so
|
||||||
-- make avoid any double refresh when watch docs with entr/livereload.
|
-- make avoid any double refresh when watch docs with entr/livereload.
|
||||||
-- But cmd Shell doesn't handle arguments containing spaces properly.
|
-- But cmd Shell doesn't handle arguments containing spaces properly.
|
||||||
liftIO $ writeFile out $ unlines [
|
let
|
||||||
"<!-- " ++ "Generated by \"Shake webmanuals\" from " ++ unwords deps ++ " -->"
|
aboutmsg =
|
||||||
|
["<!-------------------------------------------------------------------------"
|
||||||
|
,"Don't edit this file directly."
|
||||||
|
,"Instead, in the hledger repo's master branch edit the source file, one of:"
|
||||||
|
] <>
|
||||||
|
[" hledger/Hledger/Cli/Commands/commands.m4" | manual=="hledger"] <>
|
||||||
|
[" hledger/Hledger/Cli/Commands/*.md" | manual=="hledger"] <>
|
||||||
|
[" " <> intercalate "\n " deps
|
||||||
|
,""
|
||||||
|
,"If the change needs to be applied to past releases' manuals on hledger.org,"
|
||||||
|
,"see https://hledger.org/DOCS.html, or ask the maintainer to help."
|
||||||
|
,"-------------------------------------------------------------------------->"
|
||||||
|
]
|
||||||
|
liftIO $ writeFile out $ unlines $
|
||||||
|
aboutmsg <>
|
||||||
|
[""
|
||||||
,"<div class=\"docversions\"></div>"
|
,"<div class=\"docversions\"></div>"
|
||||||
,""
|
,""
|
||||||
,"# " ++ heading
|
,"# " ++ heading
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user