RST writer: Use .. code:: language
for code blocks with language.
Closes #721. Also fixed whitespace in lhs tests.
This commit is contained in:
parent
2f50406c7f
commit
9d549ab683
11 changed files with 25 additions and 20 deletions
|
@ -177,7 +177,12 @@ blockToRST (CodeBlock (_,classes,_) str) = do
|
|||
if "haskell" `elem` classes && "literate" `elem` classes &&
|
||||
isEnabled Ext_literate_haskell opts
|
||||
then return $ prefixed "> " (text str) $$ blankline
|
||||
else return $ "::" $+$ nest tabstop (text str) $$ blankline
|
||||
else return $
|
||||
(case [c | c <- classes,
|
||||
c `notElem` ["sourceCode","literate","numberLines"]] of
|
||||
[] -> "::"
|
||||
(lang:_) -> ".. code:: " <> text lang)
|
||||
$+$ nest tabstop (text str) $$ blankline
|
||||
blockToRST (BlockQuote blocks) = do
|
||||
tabstop <- get >>= (return . writerTabStop . stOptions)
|
||||
contents <- blockListToRST blocks
|
||||
|
|
|
@ -4,7 +4,7 @@ lhs test
|
|||
``unsplit`` is an arrow that takes a pair of values and combines them to
|
||||
return a single value:
|
||||
|
||||
::
|
||||
.. code:: haskell
|
||||
|
||||
unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
|
||||
unsplit = arr . uncurry
|
||||
|
|
Loading…
Add table
Reference in a new issue