diff options
Diffstat (limited to 'man')
-rw-r--r-- | man/make-pandoc-man-pages.hs | 10 | ||||
-rw-r--r-- | man/man1/pandoc.1.template | 2 | ||||
-rw-r--r-- | man/man5/pandoc_markdown.5.template | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/man/make-pandoc-man-pages.hs b/man/make-pandoc-man-pages.hs index 008294433..65178a15b 100644 --- a/man/make-pandoc-man-pages.hs +++ b/man/make-pandoc-man-pages.hs @@ -27,7 +27,7 @@ main = do unless (null ds1 && null ds2) $ do rmContents <- UTF8.readFile "README" - let (Pandoc meta blocks) = readMarkdown def rmContents + let (Pandoc meta blocks) = normalize $ readMarkdown def rmContents let manBlocks = removeSect [Str "Wrappers"] $ removeSect [Str "Pandoc's",Space,Str "markdown"] blocks let syntaxBlocks = extractSect [Str "Pandoc's",Space,Str "markdown"] blocks @@ -47,8 +47,10 @@ makeManPage verbose page meta blocks = do writeManPage :: FilePath -> String -> Pandoc -> IO () writeManPage page templ doc = do + let version = pandocVersion let opts = def{ writerStandalone = True - , writerTemplate = templ } + , writerTemplate = templ + , writerVariables = [("version",version)] } let manPage = writeMan opts $ bottomUp (concatMap removeLinks) $ bottomUp capitalizeHeaders doc @@ -67,13 +69,13 @@ capitalize (Str xs) = Str $ map toUpper xs capitalize x = x removeSect :: [Inline] -> [Block] -> [Block] -removeSect ils (Header 1 _ x:xs) | normalize x == normalize ils = +removeSect ils (Header 1 _ x:xs) | x == ils = dropWhile (not . isHeader1) xs removeSect ils (x:xs) = x : removeSect ils xs removeSect _ [] = [] extractSect :: [Inline] -> [Block] -> [Block] -extractSect ils (Header 1 _ z:xs) | normalize z == normalize ils = +extractSect ils (Header 1 _ z:xs) | z == ils = bottomUp promoteHeader $ takeWhile (not . isHeader1) xs where promoteHeader (Header n attr x) = Header (n-1) attr x promoteHeader x = x diff --git a/man/man1/pandoc.1.template b/man/man1/pandoc.1.template index 167d6ed8c..00e7675e7 100644 --- a/man/man1/pandoc.1.template +++ b/man/man1/pandoc.1.template @@ -1,7 +1,7 @@ $if(has-tables)$ .\"t $endif$ -.TH PANDOC 1 "$date$" "$title$" +.TH PANDOC 1 "$date$" "$version$" .SH NAME pandoc - general markup converter $body$ diff --git a/man/man5/pandoc_markdown.5.template b/man/man5/pandoc_markdown.5.template index f775a4683..6006e90c4 100644 --- a/man/man5/pandoc_markdown.5.template +++ b/man/man5/pandoc_markdown.5.template @@ -1,7 +1,7 @@ $if(has-tables)$ .\"t $endif$ -.TH PANDOC_MARKDOWN 5 "$date$" "$title$" +.TH PANDOC_MARKDOWN 5 "$date$" "$version$" .SH NAME pandoc_markdown - markdown syntax for pandoc(1) .SH DESCRIPTION |