;tools:Shake manuals: more contributor instructions in the header comment [hledger_site#140]

This commit is contained in:
Simon Michael 2025-09-26 07:58:23 -10:00
parent 3d0c1e40c8
commit 82007ca983

View File

@ -542,15 +542,30 @@ main = do
else h
-- 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
let deps = [src, commonm4, commandsm4, packageversionm4, packagemandatem4] ++ subfiles
let deps = [src, commonm4, packageversionm4, packagemandatem4] ++ subfiles
need deps
when (manual=="hledger") $ need commandmds
when (manual=="hledger") $ need $ commandsm4 : commandmds
-- add the web page's heading.
-- XXX Might be nice to do this atomically with the below, so
-- make avoid any double refresh when watch docs with entr/livereload.
-- But cmd Shell doesn't handle arguments containing spaces properly.
liftIO $ writeFile out $ unlines [
"<!-- " ++ "Generated by \"Shake webmanuals\" from " ++ unwords deps ++ " -->"
let
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>"
,""
,"# " ++ heading