diff options
| author | Jonas Smedegaard <dr@jones.dk> | 2025-05-17 16:34:36 +0200 |
|---|---|---|
| committer | Jonas Smedegaard <dr@jones.dk> | 2025-05-17 16:34:36 +0200 |
| commit | 8f185d6a88b13eea2f5fdfb6bc34f197b40fb121 (patch) | |
| tree | 6fd4adcdfcd630df0a7ca7c40ea6f75a4a0d4ef1 /_markdown.qmd | |
| parent | b4125c5a22700f86784b94fdb8587b7cef8d110b (diff) | |
add chapter on Markdown and annotation
Diffstat (limited to '_markdown.qmd')
| -rw-r--r-- | _markdown.qmd | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/_markdown.qmd b/_markdown.qmd new file mode 100644 index 0000000..6966e99 --- /dev/null +++ b/_markdown.qmd @@ -0,0 +1,65 @@ +Markdown consists of blocks of content, +optionally prepended a set of Metadata blocks. +Visually, this can be described using a syntax diagram +where the possible order of elements are laid out +like trains on rails, +as seen in @fig-def-Markdown and @fig-def-Block. + +{#fig-def-Markdown} + +{#fig-def-Block} + +Reading order matter. +These syntax diagrams should be read left-to-right and top-to-bottom, +also at places with choice -- +e.g. the block type "Header" should be tried before "Paragraph". +since (as elaborated below) a paragraph begins with any words, +including the initial words defitive for other block types. +In other words, +these syntax diagrams do not reflect the more common EBNF grammars, +but instead a parsing expression grammar [@Ford2004], +because context-free grammars are unlikely to cover Markdown +[@MacFarlane2014]. +The grammar is included as [Appendix @sec-def-peg]. + +The most common content block is a paragraph, +which consists of lines of space-delimited words +followed by two or more line breaks. + +{#fig-def-Paragraph} + +Words are sets of printable characters +(including punctuation and other printable characters). +they can be styled +(@fig-def-StyledWords), +have a hyperlink attached +(@fig-def-LinkedWords) +and have annotations attached +(@fig-def-AnnotatedWords). + +{#fig-def-StyledWords} + +{#fig-def-LinkedWords} + +{#fig-def-AnnotatedWords} + +{#fig-def-PlainWords} + +Other content blocks include a header +consisting of words +(@fig-def-Header), +and a list consisting of list items, +each containing a block +(@fig-def-List). + +{#fig-def-Header} + +{#fig-def-List} + +Yet other content blocks and inline types exist. +Those are omitted in this description, +which is limited to the comonents affected +by extending the Markdown language with additional types of annotation. + +Syntax diagrams for additional Markdown components are included +as [Appendix @sec-def-dia]. |
