Jasmine Cao (jcao3
)
Audrey Yang (auyang
)
This project creates a parser which translates Markdown into HTML, and converts HTML into Markdown (for testing purposes).
This directory contains the entry point for our executable in Main.hs, which has a method that prompts the user for a .md file name and parses that file into HTML.
We developed reusable libraries in this directory.
HTMLParser.hs
contains all of our parsers for HTML plus any helpers that are specific to parsing HTMLHTMLPrettyPrinter.hs
contains HMTL PrettyPrint instances of our abstract syntaxLib.hs
contains reusable general parser functions used by for parsing both HTML and MarkdownMarkdownParser.hs
contains all of our parsers for Markdown plus any helpers that are specific to parsing MarkdownMarkdownPrettyPrinter.hs
contains Markdown PrettyPrint instances of our abstract syntaxSyntax.hs
contains all our abstract representation syntax, plus reserved characters
We wrote HUnit and QuickCheck tests in this directory.
MDHUnitTests.hs
contains unit tests for each markdown parser element to ensure that they are translated correctly into our AST elements.HTMLHUnitTests.hs
contains unit tests for each HTML parser.SampleText.hs
contains sample text test cases for larger blocks of text.QCTests.hs
contains our quickCheck tests with arbitrary generators for each of our AST elements and roundtrip properties to test our Markdown Parsers and HTML Pretty Printing. This includes properties for AST => Markdown Pretty Print => Markdown Parse => AST, AST -> HTML Pretty Print -> HTML Parse -> AST, and AST -> Markdown Pretty Print -> Markdown Parse -> AST -> HTML Pretty Print -> HTML Parse -> AST.
- Syntax
- MarkdownParser
- HTMLParser
- MarkdownPrettyPrinter
- HTMLPrettyPrinter
- MDHUnitTests
- HTMLHUnitTests
- QCTests
This project compiles with stack build
.
You can run the main executable with stack run
.
You can run the tests with stack test
.
Lastly, you can start a REPL with stack ghci
.
- parsec
- pretty