aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-01-26 18:59:21 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-01-26 18:59:21 +0000
commit8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b (patch)
tree901192d658e0ba24b93b5bb84fd2e3d382bd0aa2 /README.md
parent5657f574f139ed73b3942687ba6cdb189cf6cf2d (diff)
downloadFMark-8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b.tar.gz
FMark-8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b.zip
[doc] Adding more specification
Diffstat (limited to 'README.md')
-rw-r--r--README.md60
1 files changed, 56 insertions, 4 deletions
diff --git a/README.md b/README.md
index b7933c2..492c49a 100644
--- a/README.md
+++ b/README.md
@@ -44,10 +44,62 @@ FSharp markdown.
Global Types
-Person1 - Lexer
+- Person1 - Lexer `(lex : string -> Token list)`, PreProcessor `(preProcess : string -> string)`
+- Person2 - Formatting / print HTML: Header, Paragraph, Lists, Table ->
+Simple parser `(printHtml : ParsedObj list -> string)`, `(printToFile : string -> ())`
+- Person3 - Tables: Spreadsheet, DSL `(updateTable : Table -> Table)`
+- Person4 - Citations (extensible), Table of contents -> Simple Parser
-Person2 - Formatting / print HTML: Header, Paragraph, Lists, Table -> Simple parser
+## Overview
-Person3 - Tables: Spreadsheet, DSL
+### Pre Processor
-Person4 - Citations (extensible), Table of contents -> Simple Parser \ No newline at end of file
+Goes through the source of the markdown file and processes #define like directives.
+
+```fsharp
+type Macro = { Name : string; Body : string }
+
+val preProcess = string -> string
+
+val readMacros = string -> Macro list
+
+val replaceMacro = string -> Macro list -> string
+```
+
+### Lexer
+
+Lexes the source into tokens.
+
+```fsharp
+type Token = Word of string | TripleTick | Pipe ...
+
+val lex = string -> Token list
+```
+
+### Parser
+
+Parses the Token list
+
+```fsharp
+type InlineObj = Word | FormattedWord
+type Line = InlineObj list
+type PInside = Line
+type ParsedObj = Paragraph of PInside list | CodeBlock | MDList...
+
+type Table = Line list list
+
+val parse = Token list -> ParseObj list
+
+// outputs table with updated cells, which is determined by the DSL.
+val updateTable = Table -> Table
+```
+
+### AST
+
+Outputs html
+
+```fsharp
+val printHtml = ParsedObj list -> string
+
+val printToFile = string -> ()
+``` \ No newline at end of file