Clint writes: > On Sun, Jul 05, 2020 at 05:58:57PM +0200, Adam Sjøgren wrote:
>> Maybe I should try to get rid of the dependency on Text.Pandoc in >> xmonad, it is only used to generate the man-page from a markdown file >> with some keybindings inserted. > Or now that we have a newer version of pandoc, you could port > util/GenerateManpage.hs to build with the changed API. Ok, I will give it a shot. I have sent a patch upstream: · https://mail.haskell.org/pipermail/xmonad/2020-July/015392.html And here is a patch for the current xmonad package in unstable: Description: update GenerateManPage to new Pandoc API --- Last-Update: 2020-07-14 --- xmonad-0.15.orig/util/GenerateManpage.hs +++ xmonad-0.15/util/GenerateManpage.hs @@ -9,6 +9,7 @@ -- Public License version 2 or later. import Control.Monad.IO.Class (liftIO) +import Control.Error.Util (hush) import Data.Char import Data.List import qualified Data.Text as T @@ -30,14 +31,16 @@ main = do . lines $ markdownSource - manTemplate <- getDefaultTemplate "man" - manBody <- writeMan def { writerTemplate = Just manTemplate } parsed + manTemplate <- getDefaultTemplate (T.pack "man") + compiledManTemplate <- compileTemplate "" manTemplate + manBody <- writeMan def { writerTemplate = hush compiledManTemplate } parsed liftIO $ TIO.writeFile "./man/xmonad.1" $ manBody liftIO $ putStrLn "Documentation created: man/xmonad.1" - htmltemplate <- getDefaultTemplate "html" + htmltemplate <- getDefaultTemplate (T.pack "html") + compiledHtmlTemplate <- compileTemplate "" htmltemplate htmlBody <- writeHtml5String def - { writerTemplate = Just htmltemplate + { writerTemplate = hush compiledHtmlTemplate , writerTableOfContents = True } parsed liftIO $ TIO.writeFile "./man/xmonad.1.html" htmlBody Best regards, Adam -- "It seems like the finals for "least helpful answer Adam Sjøgren on a mailing list" are coming up again." [email protected]
