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.hscontains all of our parsers for HTML plus any helpers that are specific to parsing HTMLHTMLPrettyPrinter.hscontains HMTL PrettyPrint instances of our abstract syntaxLib.hscontains reusable general parser functions used by for parsing both HTML and MarkdownMarkdownParser.hscontains all of our parsers for Markdown plus any helpers that are specific to parsing MarkdownMarkdownPrettyPrinter.hscontains Markdown PrettyPrint instances of our abstract syntaxSyntax.hscontains all our abstract representation syntax, plus reserved characters
We wrote HUnit and QuickCheck tests in this directory.
MDHUnitTests.hscontains unit tests for each markdown parser element to ensure that they are translated correctly into our AST elements.HTMLHUnitTests.hscontains unit tests for each HTML parser.SampleText.hscontains sample text test cases for larger blocks of text.QCTests.hscontains 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