HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecommonmark-extensions-0.2.5.4Haskell2010

Commonmark.Extensions

Syntax extensions for the commonmark library. Usage example:

{-# LANGUAGE ScopedTypeVariables #-}
import Commonmark
import Commonmark.Extensions
import Data.Text.IO as TIO
import Data.Text.Lazy.IO as TLIO

main :: IO ()
main = do
  let customSyntax =
         (mathSpec <> smartPunctuationSpec <> defaultSyntaxSpec)
  inp <- TIO.getContents
  res <- commonmarkWith customSyntax "stdin" inp
  case res of
    Left e                  -> error (show e)
    Right (html :: Html ()) -> TLIO.putStr $ renderHtml html
  • 1 value