diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-10-24 22:09:20 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-10-24 22:09:20 +0200 |
commit | 74d65dfec32374cb99ebfc71ce781420a1127171 (patch) | |
tree | 84392e26a6d0bb2f6c70c230c549dab55655534c | |
parent | f9e1699a2cecac26d5a00c19285fea16eb20c508 (diff) | |
download | metatile-74d65dfec32374cb99ebfc71ce781420a1127171.tar metatile-74d65dfec32374cb99ebfc71ce781420a1127171.zip |
Grab the xmonad.cabal version for putting into the manpage
Ignore-this: 574565100ef9198588dcc36b4262a07f
darcs-hash:20091024200920-1499c-5e457705cbaa2005cf7415f5d8ef33b961d7d0e0
-rw-r--r-- | man/xmonad.1.in | 4 | ||||
-rw-r--r-- | util/GenerateManpage.hs | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/man/xmonad.1.in b/man/xmonad.1.in index b32af64..2d088dc 100644 --- a/man/xmonad.1.in +++ b/man/xmonad.1.in @@ -1,6 +1,8 @@ ./" man page created by David Lazar on April 24, 2007 ./" uses ``tmac.an'' macro set -.TH xmonad 1 "18 April 07" xmonad\-1.0 "xmonad manual" +.TH xmonad 1 "8 September 09"\ +___RELEASE___\ +"xmonad manual" .SH NAME xmonad \- a tiling window manager .SH DESCRIPTION diff --git a/util/GenerateManpage.hs b/util/GenerateManpage.hs index 327db81..6be229b 100644 --- a/util/GenerateManpage.hs +++ b/util/GenerateManpage.hs @@ -20,6 +20,13 @@ import Text.Regex.Posix import Data.Char import Data.List +import Distribution.PackageDescription.Parse +import Distribution.Verbosity +import Distribution.Package +import Distribution.PackageDescription +import Text.PrettyPrint.HughesPJ +import Distribution.Text + trim :: String -> String trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace @@ -42,6 +49,9 @@ replace :: Eq a => a -> a -> [a] -> [a] replace x y = map (\a -> if a == x then y else a) main = do + releaseName <- ((' ':) . (++" \\") . show . disp . package . packageDescription) `liftM` readPackageDescription normal "xmonad.cabal" + troffBindings <- (concatMap troff . allBindings) `liftM` readFile "./XMonad/Config.hs" - let sed = unlines . replace "___KEYBINDINGS___" troffBindings . lines + + let sed = unlines . replace "___RELEASE___\\" releaseName . replace "___KEYBINDINGS___" troffBindings . lines readFile "./man/xmonad.1.in" >>= return . sed >>= writeFile "./man/xmonad.1" |