Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown doctest

Installation

$ cabal install markdown-doctest

Usage

$ ./markdown-doctest <filename.md>

The ghc environment file should exist in the package being tested:

$ cabal build --write-ghc-environment-files=always

Syntax

3 type of codeblocks are parsed,

  • haskell: All haskell blocks are tangled into a common file and checked.
  • haskell unshared: These blocks are loaded independently and dont share anything.
  • haskell docspec: These blocks share the syntax of docspec and share the env.

Example

markdown-doctest will successfully validate this file.

import qualified Prelude as P
import qualified Prelude as P

main =
    P.print "Hello, World!"
>>> import qualified Prelude as P
main =
    P.print "Hello, World!"
>>> P.filter P.odd [1..10]
[1,3,5,7,9]

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages