diff options
-rw-r--r-- | FMark/src/Common/MarkdownGen/MarkdownGen.fs | 7 | ||||
-rw-r--r-- | README.md | 30 | ||||
-rw-r--r-- | examples/example.html | 1 |
3 files changed, 36 insertions, 2 deletions
diff --git a/FMark/src/Common/MarkdownGen/MarkdownGen.fs b/FMark/src/Common/MarkdownGen/MarkdownGen.fs index 2927937..5b6f50d 100644 --- a/FMark/src/Common/MarkdownGen/MarkdownGen.fs +++ b/FMark/src/Common/MarkdownGen/MarkdownGen.fs @@ -1,4 +1,5 @@ module MarkdownGen +// MarkdownGen is only used for some property-based testing and is not ready for use for anything else. open Types open Shared @@ -6,7 +7,7 @@ open Logger let logger = Logger(LogLevel.INFO) -// retunr string surrounded by pat +// return string surrounded by pat let surround pat str = let pat2 = match pat with | "(" -> ")" @@ -36,7 +37,9 @@ and mdInlineElements' b eles = | FrmtedString fStr -> mdFStr fStr | Link (ht, url) -> (mdFStr ht |> sbraSurround) + (url |> braSurround) | Picture (alt, url) -> (alt |> sbraSurround |> sprintf "!%s" ) + (url |> braSurround) - | Reference (ht, _) -> ("^" + mdFStr ht) |> sbraSurround + | InlineCitation (ht, _) -> + | InlineFootnote (ht, _) -> ("^" + mdFStr ht) |> sbraSurround + | _ -> "not implemented in MarkdownGen" List.fold convertMd (sprintf "%s" b) eles and mdInlineElements = mdInlineElements' "" @@ -38,6 +38,32 @@ at [CommonMark](http://spec.commonmark.org/0.27/). A reference implementation of the simple markdown can be found [here](http://spec.commonmark.org/dingus/). +### Lists + +* A list ends with two endlines, i.e., `\r\n\r\n` +* List items are separated by one endline +* List type is determined by the first item. + * `NUMBER ; DOT` will be ordered list + * ` - ` or ` * ` will be unordered list +* If the first item does not start with `NUMDER;DOT;Space| "- " | "* "`, the list type will be default to unordered list +* Ordered list start number is determined by the first item + * The subsequent counting is `+1` for each list item +* Two spaces as one level of indentation. +* A tab, `\t` character will be interpreted as four spaces, therefore two levels of indentation. + +### Paragraphs + +A paragraph is some characters that does not match: +* CodeBlock +* Header +* ContentTable +* List +* Quote +* Table +* Reference + +It terminates with two endlines. Any elements mentions above cannot exist in a paragraph. Otherwise, they will become normal text, and will not be rendered as expected. + # Markdown extensions (not included in standard Markdown) ## Macros @@ -175,6 +201,10 @@ _TODO: show an example?_ FMark supports simple footers and styled references. +* If multiple citations with the same reference ID is found, the first citation will be used inline. + * One `[^fmark]` inline, and two `[^fmark], some author`. The first will be used. +* Reference to non-exist citation will result in `"[Reference: %refID not found!]"` in the HTML generated. + ### Simple Footers Simple footers have numerical IDs. diff --git a/examples/example.html b/examples/example.html index be50334..5b8d288 100644 --- a/examples/example.html +++ b/examples/example.html @@ -180,6 +180,7 @@ </ul> <h3 id="Links14">Links</h3> <p> + <a href="http://www.google.com">Google</a> <!-- Images produce correct HTML but don't display in VS Code--> <img src="test_img.jpg" alt="image"> |