mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Add a basic header to the html manpage output
This commit is contained in:
parent
37dc284460
commit
02693d307c
@ -33,7 +33,7 @@ import Distribution.Text
|
|||||||
|
|
||||||
import Text.Pandoc
|
import Text.Pandoc
|
||||||
|
|
||||||
releaseDate = "\"8 September 09\""
|
releaseDate = "25 October 09"
|
||||||
|
|
||||||
trim :: String -> String
|
trim :: String -> String
|
||||||
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
||||||
@ -64,7 +64,7 @@ main = do
|
|||||||
keybindings <- (intercalate "\n\n" . map markdownDefn . allBindings)
|
keybindings <- (intercalate "\n\n" . map markdownDefn . allBindings)
|
||||||
`liftM` readFile "./XMonad/Config.hs"
|
`liftM` readFile "./XMonad/Config.hs"
|
||||||
|
|
||||||
let manHeader = unwords [".TH xmonad 1",releaseDate,releaseName,"\"xmonad manual\""]
|
let manHeader = unwords [".TH xmonad 1","\""++releaseDate++"\"",releaseName,"\"xmonad manual\""]
|
||||||
writeOpts = defaultWriterOptions -- { writerLiterateHaskell = True }
|
writeOpts = defaultWriterOptions -- { writerLiterateHaskell = True }
|
||||||
|
|
||||||
parsed <- readMarkdown defaultParserState { stateLiterateHaskell = True }
|
parsed <- readMarkdown defaultParserState { stateLiterateHaskell = True }
|
||||||
@ -80,6 +80,12 @@ main = do
|
|||||||
putStrLn "Documentation created: man/xmonad.1"
|
putStrLn "Documentation created: man/xmonad.1"
|
||||||
|
|
||||||
writeFile "./man/xmonad.1.html"
|
writeFile "./man/xmonad.1.html"
|
||||||
. writeHtmlString writeOpts { writerStandalone = True }
|
. writeHtmlString writeOpts
|
||||||
|
{ writerHeader = "<h1>"++releaseName++"</h1>"++
|
||||||
|
"<p>Section: xmonad manual (1)<br>"++
|
||||||
|
"Updated: "++releaseDate++"</p>"++
|
||||||
|
"<hr>"
|
||||||
|
, writerStandalone = True
|
||||||
|
, writerTableOfContents = True }
|
||||||
$ parsed
|
$ parsed
|
||||||
putStrLn "Documentation created: man/xmonad.1.html"
|
putStrLn "Documentation created: man/xmonad.1.html"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user