;shake: refactor

This commit is contained in:
Simon Michael 2020-01-25 15:56:00 -08:00
parent 76776e28b2
commit 84984499bb

View File

@ -211,14 +211,14 @@ main = do
infomanuals = [manualDir m </> m <.> "info" | m <- manualNames] infomanuals = [manualDir m </> m <.> "info" | m <- manualNames]
-- manuals as web-ready markdown, written into the website for Sphinx (site/hledger.md) -- manuals as web-ready markdown, written into the website for Sphinx (site/hledger.md)
webmanuals = ["site" </> manpageNameToUri m <.> "md" | m <- manpageNames] webmanuals = ["site" </> manpageNameToWebManualName m <.> "md" | m <- manpageNames]
-- -- latest version of the manuals rendered to html (site/_site/hledger.html) -- -- latest version of the manuals rendered to html (site/_site/hledger.html)
-- htmlmanuals = ["site/_site" </> manpageNameToUri m <.> "html" | m <- manpageNames] -- htmlmanuals = ["site/_site" </> manpageNameToWebManualName m <.> "html" | m <- manpageNames]
-- -- old versions of the manuals rendered to html (site/_site/doc/1.14/hledger.html) -- -- old versions of the manuals rendered to html (site/_site/doc/1.14/hledger.html)
-- oldhtmlmanuals = map (normalise . ("site/_site/doc" </>) . (<.> "html")) $ -- oldhtmlmanuals = map (normalise . ("site/_site/doc" </>) . (<.> "html")) $
-- [ v </> manpageNameToUri p | v <- docversions, v>="1.0", p <- manpageNames ++ ["manual"] ] ++ -- [ v </> manpageNameToWebManualName p | v <- docversions, v>="1.0", p <- manpageNames ++ ["manual"] ] ++
-- [ v </> "manual" | v <- docversions, v <"1.0" ] -- before 1.0 there was only the combined manual -- [ v </> "manual" | v <- docversions, v <"1.0" ] -- before 1.0 there was only the combined manual
-- the html for website pages kept in the main repo -- the html for website pages kept in the main repo
@ -241,14 +241,14 @@ main = do
| '_' `elem` m = "hledger-lib" | '_' `elem` m = "hledger-lib"
| otherwise = m | otherwise = m
-- The URI corresponding to this man page. -- The web manual name (& URI "slug") corresponding to this man page.
-- hledger.1 -> hledger, hledger_journal.5 -> journal -- hledger.1 -> hledger, hledger_journal.5 -> journal
manpageNameToUri m | "hledger_" `isPrefixOf` m = dropExtension $ drop 8 m manpageNameToWebManualName m | "hledger_" `isPrefixOf` m = dropExtension $ drop 8 m
| otherwise = dropExtension m | otherwise = dropExtension m
-- The man page corresponding to this URI. -- The man page corresponding to this web manual name.
-- hledger -> hledger.1, journal -> hledger_journal.5 -- hledger -> hledger.1, journal -> hledger_journal.5
manpageUriToName u | "hledger" `isPrefixOf` u = u <.> "1" webManualNameToManpageName u | "hledger" `isPrefixOf` u = u <.> "1"
| otherwise = "hledger_" ++ u <.> "5" | otherwise = "hledger_" ++ u <.> "5"
-- MANUALS -- MANUALS