git.iko.soy/typeable/pandoc
on master help sign in
Ms writer: changed some names and comments, man -> ms.
commit9945f9129fc46be38b3362fe70950f538191e194 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 24 Mar 2017, 10:13 (10 years ago) parent4248231
1 file changed+10−10
src/Text/Pandoc/Writers/Ms.hs+10−10
src/Text/Pandoc/Writers/Ms.hs+10−10
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2525 Stability : alpha
2626 Portability : portable
2727
28−Conversion of 'Pandoc' documents to groff man page format.
28+Conversion of 'Pandoc' documents to groff ms format.
2929
3030TODO:
3131
@@ -99,7 +99,7 @@ writeMs :: PandocMonad m => WriterOptions -> Pandoc -> m String
9999writeMs opts document =
100100 evalStateT (pandocToMs opts document) defaultWriterState
101101
102−-- | Return groff man representation of document.
102+-- | Return groff ms representation of document.
103103pandocToMs :: PandocMonad m => WriterOptions -> Pandoc -> MS m String
104104pandocToMs opts (Pandoc meta blocks) = do
105105 let colwidth = if writerWrapText opts == WrapAuto
@@ -139,8 +139,8 @@ pandocToMs opts (Pandoc meta blocks) = do
139139 Just tpl -> return $ renderTemplate' tpl context
140140
141141-- | Association list of characters to escape.
142−manEscapes :: Map.Map Char String
143−manEscapes = Map.fromList $
142+msEscapes :: Map.Map Char String
143+msEscapes = Map.fromList $
144144 [ ('\160', "\\ ")
145145 , ('\'', "\\[aq]")
146146 , ('’', "'")
@@ -155,7 +155,7 @@ manEscapes = Map.fromList $
155155 ]
156156
157157escapeChar :: Char -> String
158−escapeChar c = case Map.lookup c manEscapes of
158+escapeChar c = case Map.lookup c msEscapes of
159159 Just s -> s
160160 Nothing -> [c]
161161
@@ -298,7 +298,7 @@ blockToMs opts (DefinitionList items) = do
298298 contents <- mapM (definitionListItemToMs opts) items
299299 return (vcat contents)
300300
301−-- | Convert bullet list item (list of blocks) to man.
301+-- | Convert bullet list item (list of blocks) to ms.
302302bulletListItemToMs :: PandocMonad m => WriterOptions -> [Block] -> MS m Doc
303303bulletListItemToMs _ [] = return empty
304304bulletListItemToMs opts ((Para first):rest) =
@@ -316,7 +316,7 @@ bulletListItemToMs opts (first:rest) = do
316316 rest' <- blockListToMs opts rest
317317 return $ text "\\[bu] .RS 2" $$ first' $$ rest' $$ text ".RE"
318318
319−-- | Convert ordered list item (a list of blocks) to man.
319+-- | Convert ordered list item (a list of blocks) to ms.
320320orderedListItemToMs :: PandocMonad m
321321 => WriterOptions -- ^ options
322322 -> String -- ^ order marker for list item
@@ -336,7 +336,7 @@ orderedListItemToMs opts num indent (first:rest) = do
336336 else text ".RS 4" $$ rest' $$ text ".RE"
337337 return $ first'' $$ rest''
338338
339−-- | Convert definition list item (label, list of blocks) to man.
339+-- | Convert definition list item (label, list of blocks) to ms.
340340definitionListItemToMs :: PandocMonad m
341341 => WriterOptions
342342 -> ([Inline],[[Block]])
@@ -356,7 +356,7 @@ definitionListItemToMs opts (label, defs) = do
356356 return $ first' $$ text ".RS" $$ rest' $$ text ".RE"
357357 return $ nowrap (text ".IP \"" <> labelText <> text "\"") $$ contents
358358
359−-- | Convert list of Pandoc block elements to man.
359+-- | Convert list of Pandoc block elements to ms.
360360blockListToMs :: PandocMonad m
361361 => WriterOptions -- ^ Options
362362 -> [Block] -- ^ List of block elements
@@ -380,7 +380,7 @@ inlineListToMs' opts lst = do
380380 y <- handleNotes opts empty
381381 return $ x <> y
382382
383−-- | Convert Pandoc inline element to man.
383+-- | Convert Pandoc inline element to ms.
384384inlineToMs :: PandocMonad m => WriterOptions -> Inline -> MS m Doc
385385inlineToMs opts (Span _ ils) = inlineListToMs opts ils
386386inlineToMs opts (Emph lst) =