diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-26 18:59:21 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-26 18:59:21 +0000 |
commit | 8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b (patch) | |
tree | 901192d658e0ba24b93b5bb84fd2e3d382bd0aa2 /README.md | |
parent | 5657f574f139ed73b3942687ba6cdb189cf6cf2d (diff) | |
download | FMark-8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b.tar.gz FMark-8111c2ea48e9f39846cdcc5c13eb8d1cdb85177b.zip |
[doc] Adding more specification
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 60 |
1 files changed, 56 insertions, 4 deletions
@@ -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 |