1{-# OPTIONS_GHC -Wall #-}
2module Generate.Markdown where
4import qualified Cheapskate as CS
5import qualified Cheapskate.Html as CS
6import qualified Data.Text as Text
7import qualified Text.Blaze.Html.Renderer.String as Blaze
8import qualified Text.Highlighting.Kate as Kate
12toHtml :: String -> String
15 |> CS.markdown options
16 |> CS.walk highlightCode
24 , CS.allowRawHtml = True
25 , CS.preserveHardBreaks = False
29highlightCode :: CS.Block -> CS.Block
32 CS.CodeBlock (CS.CodeAttr lang _info) src ->
33 Kate.highlightAs (Text.unpack lang) (Text.unpack src)
34 |> Kate.formatHtmlBlock Kate.defaultFormatOpts
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list