readme-lhs-0.2.0: See readme.md

Safe HaskellNone
LanguageHaskell2010

Readme.Lhs

Synopsis

Documentation

para :: Text -> Block Source #

doctest >>> :set -XOverloadedStrings

turn text into a Pandoc Paragraph Block >>> para "hello" Para [Str "hello"]

plain :: Text -> Block Source #

turn text into a Pandoc Plain Block >>> plain "hello" Plain [Str "hello"]

table :: Text -> [Text] -> [Alignment] -> [Int] -> [[Text]] -> Block Source #

table caption headers alignments widths rows >>> table "an example table" ["first column", "second column"] [AlignLeft, AlignRight] [0,0] [["first row", "1"], ["second row", "1000"]] Table [Str "an example table"] [AlignLeft,AlignRight] [0.0,0.0] [[Para [Str "first column"]],[Para [Str "second column"]]] [[[Para [Str "first row"]],[Para [Str "1"]]],[[Para [Str "second row"]],[Para [Str "1000"]]]]

code :: Text -> [Text] -> Text -> Block Source #

code identifier classes text >>> code "name" ["sourceCode", "literate", "haskell"] "x = 1n" CodeBlock ("name",["sourceCode","literate","haskell"],[]) "x = 1n"

data Flavour Source #

use LHS when you want to just add output to a *.lhs | use GitHubMarkdown for rendering code and results on github

Constructors

GitHubMarkdown 
LHS 

readPandoc :: FilePath -> Flavour -> IO (Either PandocError Pandoc) Source #

read a file into the pandoc AST

output :: Monad m => Text -> Text -> StateT (Map Text Text) m () Source #

add an output key-value pair to state

runOutput :: (FilePath, Flavour) -> (FilePath, Flavour) -> StateT Output IO () -> IO (Either PandocError ()) Source #

insert outputs into a new file

tweakHaskellCodeBlock :: Block -> Block Source #

literate haskell code blocks comes out of markdown+lhs to native pandoc with the following classes:

"sourceCode","literate","haskell"

and then conversion to github flavour gives:

``` sourceCode ```

which doesn't lead to nice code highlighting on github (and elsewhere). This function tweaks the list so that ["haskell"] is the class, and it all works.