doc: don't use sed; fix accidental dedenting of some lists (#961)
The sed code was showing an error message, not too precise. Pandoc's lua filters to the rescue! [ci skip]
This commit is contained in:
parent
3474cb08bd
commit
5435150d39
9
Shake.hs
9
Shake.hs
@ -20,7 +20,6 @@ compiling is recommended; run the script in interpreted mode to do that.
|
|||||||
It requires stack (https://haskell-lang.org/get-started) and
|
It requires stack (https://haskell-lang.org/get-started) and
|
||||||
auto-installs the packages above. Also, some rules require:
|
auto-installs the packages above. Also, some rules require:
|
||||||
|
|
||||||
- GNU sed
|
|
||||||
- groff
|
- groff
|
||||||
- m4
|
- m4
|
||||||
- makeinfo
|
- makeinfo
|
||||||
@ -86,10 +85,6 @@ towebmd = "-t markdown-smart-fenced_divs --atx-headers"
|
|||||||
|
|
||||||
main = do
|
main = do
|
||||||
|
|
||||||
-- try to ensure we have a modern sed
|
|
||||||
sed' <- readCreateProcess (shell "which gsed || which sed") ""
|
|
||||||
let sed = sed' ++ " -E"
|
|
||||||
|
|
||||||
-- hledger manual also includes the markdown files from here:
|
-- hledger manual also includes the markdown files from here:
|
||||||
let commandsdir = "hledger/Hledger/Cli/Commands"
|
let commandsdir = "hledger/Hledger/Cli/Commands"
|
||||||
commandmds <- filter (".md" `isSuffixOf`) . map (commandsdir </>) <$> S.getDirectoryContents commandsdir
|
commandmds <- filter (".md" `isSuffixOf`) . map (commandsdir </>) <$> S.getDirectoryContents commandsdir
|
||||||
@ -378,9 +373,7 @@ main = do
|
|||||||
need [src]
|
need [src]
|
||||||
cmd Shell
|
cmd Shell
|
||||||
-- "m4 -P -DHELP -I" commandsdir lib src "|"
|
-- "m4 -P -DHELP -I" commandsdir lib src "|"
|
||||||
pandoc fromsrcmd src "-t plain"
|
pandoc fromsrcmd src "--lua-filter" "tools/pandoc-dedent-code-blocks.lua" "-t plain" ">" out
|
||||||
"|" sed "-e" ["'s/^ //'"]
|
|
||||||
">" out
|
|
||||||
|
|
||||||
-- MISC
|
-- MISC
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user