summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-28 14:39:17 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-28 14:39:17 -0700
commitfe625e053d078e03d824a1df746196b8a2c697b1 (patch)
tree0129bded228d952594d06a8ed675154d05909abc /pandoc.hs
parent3e5b4faaf2a99950991ff7b16c0e0b06234b9792 (diff)
New method for producing man pages.
This change adds `--man1` and `--man5` options to pandoc, so pandoc can generate its own man pages. It removes the old overly complex method of building a separate executable (but not installing it) just to create the man pages. The man pages are no longer automatically created in the build process. The man/ directory has been removed. The man page templates have been moved to data/. New unexported module: Text.Pandoc.ManPages. Text.Pandoc.Data now exports readmeFile, and `readDataFile` knows how to find README. Closes #2190.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/pandoc.hs b/pandoc.hs
index df50d01d0..6bc2a024a 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -39,6 +39,7 @@ import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,
safeRead, headerShift, normalize, err, warn,
openURL )
import Text.Pandoc.MediaBag ( mediaDirectory, extractMediaBag, MediaBag )
+import Text.Pandoc.ManPages ( manPandoc1, manPandocMarkdown5 )
import Text.Pandoc.XML ( toEntities )
import Text.Pandoc.SelfContained ( makeSelfContained )
import Text.Pandoc.Process (pipeProcess)
@@ -869,6 +870,20 @@ options =
(\opt -> return opt { optIgnoreArgs = True }))
"" -- "Ignore command-line arguments."
+ , Option "" ["man1"]
+ (NoArg
+ (\_ -> do
+ manPandoc1 >>= UTF8.hPutStr stdout
+ exitWith ExitSuccess ))
+ "" -- "Print pandoc.1 man page"
+
+ , Option "" ["man5"]
+ (NoArg
+ (\_ -> do
+ manPandocMarkdown5 >>= UTF8.hPutStr stdout
+ exitWith ExitSuccess ))
+ "" -- "Print pandoc_markdown.5 man page"
+
, Option "" ["verbose"]
(NoArg
(\opt -> return opt { optVerbose = True }))