git.iko.soy/typeable/pandoc
on master help sign in
Changed '--smartypants' to '--smart' and adjusted documentation
a8bbd95fiddlosopher
README+1−1
@@ -232,7 +232,7 @@ at the beginning of the title that appears in the HTML header (but not
232in the title as it appears at the beginning of the HTML body). (See
232in the title as it appears at the beginning of the HTML body). (See
233below on Titles.)
233below on Titles.)
234
234
235−`-S` or `--smartypants` causes `pandoc` to produce typographically
235+`-S` or `--smart` causes `pandoc` to produce typographically
236correct HTML output, along the lines of John Gruber's [Smartypants].
236correct HTML output, along the lines of John Gruber's [Smartypants].
237Straight quotes are converted to curly quotes, `---` to dashes, and
237Straight quotes are converted to curly quotes, `---` to dashes, and
238`...` to ellipses.
238`...` to ellipses.
src/Main.hs+7−7
@@ -73,7 +73,7 @@ data Opt = Opt
73 , optTitlePrefix :: String -- ^ Optional prefix for HTML title
73 , optTitlePrefix :: String -- ^ Optional prefix for HTML title
74 , optNumberSections :: Bool -- ^ If @True@, number sections in LaTeX
74 , optNumberSections :: Bool -- ^ If @True@, number sections in LaTeX
75 , optIncremental :: Bool -- ^ If @True@, show lists incrementally in S5
75 , optIncremental :: Bool -- ^ If @True@, show lists incrementally in S5
76− , optSmartypants :: Bool -- ^ If @True@, use smart quotes, dashes, ...
76+ , optSmart :: Bool -- ^ If @True@, use smart quotes, dashes, ...
77 , optASCIIMathML :: Bool -- ^ If @True@, use ASCIIMathML in HTML or S5
77 , optASCIIMathML :: Bool -- ^ If @True@, use ASCIIMathML in HTML or S5
78 }
78 }
79
79
@@ -95,7 +95,7 @@ startOpt = Opt
95 , optTitlePrefix = ""
95 , optTitlePrefix = ""
96 , optNumberSections = False
96 , optNumberSections = False
97 , optIncremental = False
97 , optIncremental = False
98− , optSmartypants = False
98+ , optSmart = False
99 , optASCIIMathML = False
99 , optASCIIMathML = False
100 }
100 }
101
101
@@ -157,10 +157,10 @@ options =
157 (\opt -> return opt { optParseRaw = True }))
157 (\opt -> return opt { optParseRaw = True }))
158 "Parse untranslatable HTML codes and LaTeX environments as raw"
158 "Parse untranslatable HTML codes and LaTeX environments as raw"
159
159
160− , Option "S" ["smartypants"]
160+ , Option "S" ["smart"]
161 (NoArg
161 (NoArg
162− (\opt -> return opt { optSmartypants = True }))
162+ (\opt -> return opt { optSmart = True }))
163− "Use smartypants for html output"
163+ "Use smart quotes, dashes, and ellipses in HTML output"
164
164
165 , Option "m" ["asciimathml"]
165 , Option "m" ["asciimathml"]
166 (NoArg
166 (NoArg
@@ -255,7 +255,7 @@ main = do
255 , optTitlePrefix = titlePrefix
255 , optTitlePrefix = titlePrefix
256 , optNumberSections = numberSections
256 , optNumberSections = numberSections
257 , optIncremental = incremental
257 , optIncremental = incremental
258− , optSmartypants = smartypants
258+ , optSmart = smart
259 , optASCIIMathML = asciiMathML
259 , optASCIIMathML = asciiMathML
260 } = opts
260 } = opts
261
261
@@ -278,7 +278,7 @@ main = do
278 let writerOptions = WriterOptions { writerStandalone = standalone,
278 let writerOptions = WriterOptions { writerStandalone = standalone,
279 writerHeader = header,
279 writerHeader = header,
280 writerTitlePrefix = titlePrefix,
280 writerTitlePrefix = titlePrefix,
281− writerSmartypants = smartypants,
281+ writerSmart = smart,
282 writerTabStop = tabStop,
282 writerTabStop = tabStop,
283 writerS5 = writingS5,
283 writerS5 = writingS5,
284 writerIncremental = incremental,
284 writerIncremental = incremental,
src/Text/Pandoc/Shared.hs+1−1
@@ -276,7 +276,7 @@ data WriterOptions = WriterOptions
276 , writerHeader :: String -- ^ Header for the document
276 , writerHeader :: String -- ^ Header for the document
277 , writerIncludeBefore :: String -- ^ String to include before the document body
277 , writerIncludeBefore :: String -- ^ String to include before the document body
278 , writerIncludeAfter :: String -- ^ String to include after the document body
278 , writerIncludeAfter :: String -- ^ String to include after the document body
279− , writerSmartypants :: Bool -- ^ If @True@, use smart quotes, dashes, and ellipses
279+ , writerSmart :: Bool -- ^ If @True@, use smart quotes, dashes, and ellipses
280 , writerS5 :: Bool -- ^ @True@ if we're writing S5 instead of normal HTML
280 , writerS5 :: Bool -- ^ @True@ if we're writing S5 instead of normal HTML
281 , writerIncremental :: Bool -- ^ If @True@, display S5 lists incrementally
281 , writerIncremental :: Bool -- ^ If @True@, display S5 lists incrementally
282 , writerNumberSections :: Bool -- ^ If @True@, number sections in LaTeX
282 , writerNumberSections :: Bool -- ^ If @True@, number sections in LaTeX
src/Text/Pandoc/Writers/HTML.hs+3−3
@@ -51,7 +51,7 @@ obfuscateChar char = let num = ord char in
51stringToHtml :: String -> String
51stringToHtml :: String -> String
52stringToHtml str = escapePreservingRegex stringToHtmlString (mkRegex "\"|(&[[:alnum:]]*;)") str
52stringToHtml str = escapePreservingRegex stringToHtmlString (mkRegex "\"|(&[[:alnum:]]*;)") str
53
53
54−-- | Escape string as in 'stringToHtml' but add smartypants filter.
54+-- | Escape string as in 'stringToHtml' but add smart typography filter.
55stringToSmartHtml :: String -> String
55stringToSmartHtml :: String -> String
56stringToSmartHtml =
56stringToSmartHtml =
57 let escapeDoubleQuotes =
57 let escapeDoubleQuotes =
@@ -157,7 +157,7 @@ listItemToHtml options list = "<li>" ++ (concatMap (blockToHtml options) list) +
157inlineListToHtml :: WriterOptions -> [Inline] -> String
157inlineListToHtml :: WriterOptions -> [Inline] -> String
158inlineListToHtml options lst =
158inlineListToHtml options lst =
159 -- consolidate adjacent Str and Space elements for more intelligent
159 -- consolidate adjacent Str and Space elements for more intelligent
160− -- smartypants filtering
160+ -- smart typography filtering
161 let lst' = consolidateList lst in
161 let lst' = consolidateList lst in
162 concatMap (inlineToHtml options) lst'
162 concatMap (inlineToHtml options) lst'
163
163
@@ -166,7 +166,7 @@ inlineToHtml :: WriterOptions -> Inline -> String
166inlineToHtml options (Emph lst) = "<em>" ++ (inlineListToHtml options lst) ++ "</em>"
166inlineToHtml options (Emph lst) = "<em>" ++ (inlineListToHtml options lst) ++ "</em>"
167inlineToHtml options (Strong lst) = "<strong>" ++ (inlineListToHtml options lst) ++ "</strong>"
167inlineToHtml options (Strong lst) = "<strong>" ++ (inlineListToHtml options lst) ++ "</strong>"
168inlineToHtml options (Code str) = "<code>" ++ (codeStringToHtml str) ++ "</code>"
168inlineToHtml options (Code str) = "<code>" ++ (codeStringToHtml str) ++ "</code>"
169−inlineToHtml options (Str str) = if (writerSmartypants options) then
169+inlineToHtml options (Str str) = if (writerSmart options) then
170 stringToSmartHtml str
170 stringToSmartHtml str
171 else
171 else
172 stringToHtml str
172 stringToHtml str