aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Punter <gsp14@ic.ac.uk>2018-03-22 20:41:28 +0000
committerGeorge Punter <gsp14@ic.ac.uk>2018-03-22 20:41:28 +0000
commit578af84c16b45d2f0a6cb25929a7d530c65f1b07 (patch)
treee62638bcfd1c9d1c9618709a4bcece2a8a88f559
parent8acf8426a367eb0c244eb87bd1cba75c906b8350 (diff)
parent5291e75ef835ee1bcc9a4d19519efd166a774fd3 (diff)
downloadFMark-578af84c16b45d2f0a6cb25929a7d530c65f1b07.tar.gz
FMark-578af84c16b45d2f0a6cb25929a7d530c65f1b07.zip
Merge branch 'readmes_examples' into separate_cite
-rw-r--r--FMark/src/Common/MarkdownGen/MarkdownGen.fs7
-rw-r--r--README.md30
-rw-r--r--examples/example.html1
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' ""
diff --git a/README.md b/README.md
index 3f79548..bfa6806 100644
--- a/README.md
+++ b/README.md
@@ -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">