diff options
| author | Jonas Smedegaard <dr@jones.dk> | 2025-05-23 07:07:04 +0200 |
|---|---|---|
| committer | Jonas Smedegaard <dr@jones.dk> | 2025-05-23 07:07:04 +0200 |
| commit | 7e56c94c03727894dec1b65da923bb4bd532df52 (patch) | |
| tree | d964a2fc96af99b43133eacb046910e9d2bfff20 | |
| parent | c137bb34cf4f5875e6b959e5563dd37c0f1638bc (diff) | |
move syntax diagrams to subdir
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | _def_dia.qmd | 47 | ||||
| -rw-r--r-- | _markdown.qmd | 24 | ||||
| -rw-r--r-- | _syntax.qmd | 47 | ||||
| -rw-r--r-- | def.peg | 56 | ||||
| -rw-r--r-- | report.qmd | 4 | ||||
| -rwxr-xr-x | syntax/def_AnnotatedWords.py (renamed from def_AnnotatedWords.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_AnnotatedWordsX.py (renamed from def_AnnotatedWordsX.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Block.py (renamed from def_Block.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_HardBreak.py (renamed from def_HardBreak.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Header.py (renamed from def_Header.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_LinkDefinition.py (renamed from def_LinkDefinition.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_LinkLabel.py (renamed from def_LinkLabel.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_LinkTitle.py (renamed from def_LinkTitle.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_LinkedWords.py (renamed from def_LinkedWords.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_List.py (renamed from def_List.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Markdown.py (renamed from def_Markdown.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_NEWLINE.py (renamed from def_NEWLINE.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_PRINTABLES.py (renamed from def_PRINTABLES.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Paragraph.py (renamed from def_Paragraph.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_PlainWords.py (renamed from def_PlainWords.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_SEMPREFIX.py (renamed from def_SEMPREFIX.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_SPACE.py (renamed from def_SPACE.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_SemWords.py (renamed from def_SemWords.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_StyledWords.py (renamed from def_StyledWords.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Uri.py (renamed from def_Uri.py) | 0 | ||||
| -rwxr-xr-x | syntax/def_Words.py (renamed from def_Words.py) | 0 | ||||
| -rwxr-xr-x | syntax/def__.py (renamed from def__.py) | 0 |
28 files changed, 62 insertions, 118 deletions
@@ -17,7 +17,7 @@ DIFF = git --no-pager diff --no-index PANDOC = pandoc --from commonmark #PANDOC = quarto pandoc --from commonmark -SYNTAX_DIAGRAMS := $(patsubst %.py,%.svg,$(wildcard def_*.py)) +SYNTAX_DIAGRAMS := $(patsubst %.py,%.svg,$(wildcard syntax/def_*.py)) WORKFLOW_DIAGRAMS := $(patsubst %.cwl,%.svg,$(wildcard workflow/phase*.cwl)) diff --git a/_def_dia.qmd b/_def_dia.qmd deleted file mode 100644 index 8dc81ac..0000000 --- a/_def_dia.qmd +++ /dev/null @@ -1,47 +0,0 @@ -Subsets of Markdown syntax structure -expressed as syntax diagrams (a.k.a. railroad diagrams), -involving the negative predicate from PEG notation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/_markdown.qmd b/_markdown.qmd index 4ce8bb3..6943b19 100644 --- a/_markdown.qmd +++ b/_markdown.qmd @@ -46,7 +46,7 @@ where the possible order of elements are laid out like trains on rails, as seen in @fig-def-Markdown. -{#fig-def-Markdown} +{#fig-def-Markdown} Here is an example: @@ -69,11 +69,11 @@ See @fig-def-blocks for syntax diagrams for those block types. ::: {#fig-def-blocks} - + - + - + Syntax of `Block`, `Header` and `Paragraph`. @@ -107,13 +107,13 @@ Se @fig-def-words for their syntax diagrams. ::: {#fig-def-words} - + - + - + - + Syntax of `StyledWords`, `LinkedWords`, `AnnotatedWords` and `PlainWords`. @@ -126,7 +126,7 @@ consisting of list items, each containing a block (@fig-def-List). -{#fig-def-List} +{#fig-def-List} --> @@ -157,7 +157,7 @@ as in @fig-def-extensions. ::: {#fig-def-extensions} - + Syntax of `AnnotatedWords` and `LinkedWords`, extended with `SemWords`. @@ -175,9 +175,9 @@ See @fig-def-additions for their syntax diagrams. ::: {#fig-def-additions} - + - + Syntax of `SemWords`, `Curie`, `SEMPREFIX` and `NAME`. diff --git a/_syntax.qmd b/_syntax.qmd new file mode 100644 index 0000000..49b8734 --- /dev/null +++ b/_syntax.qmd @@ -0,0 +1,47 @@ +Subsets of Markdown syntax structure +expressed as syntax diagrams (a.k.a. railroad diagrams), +involving the negative predicate from PEG notation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/def.peg b/def.peg deleted file mode 100644 index e40610f..0000000 --- a/def.peg +++ /dev/null @@ -1,56 +0,0 @@ -# Subsets of Markdown syntax structure -# expressed in parsing expression grammar (PEG) notation. -# -# Copyright 2025, Jonas Smedegaard <dr@jones.dk> -# SPDX-License-Identifier: GPL-3+ - -# Document -Markdown <- ('---' NEWLINE MetaBlock* '---' NEWLINE)? Block* - -# Block elements -Block <- Header - / List - / LinkDefinition - / Paragraph -Header <- '#'+ SPACE* !NEWLINE Words? SPACE* NEWLINE -List <- ([-*]+ / [[:digit:]]+ [).]) (_ (List / Words))? NEWLINE -LinkDefinition <- LinkLabel ':' _? Uri (_ LinkTitle)? NEWLINE -Paragraph <- Words (HardBreak Words)* NEWLINE+ - -# Inline elements -Words <- StyledWords - / LinkedWords - / AnnotatedWords - / PlainWords -StyledWords <- '**' Words '**' - / '*' Words '*' - / '_' Words '_' -LinkedWords <- '[' Words ']' '(' ((Uri _)? LinkTitle / Uri) ')' - / '[' Words ']' LinkLabel - / LinkLabel -AnnotatedWords <- '[' Words ']' '{' ![{}] PlainWords '}' -LinkLabel <- '[' _? ![\[\]] PlainWords _? ']' -LinkTitle <- '"' _? !'"' _? PlainWords _? '"' - / "'" _? !"'" PlainWords _? "'" - / "(" _? ![()] PlainWords _? ")" -PlainWords <- PRINTABLES (_ PRINTABLES)* -Uri <- '<' ![<>] PRINTABLES? '>' - / ![<>] PRINTABLES -HardBreak <- SPACE SPACE+ NEWLINE -_ <- SPACE+ - / SPACE? NEWLINE SPACE? SPACE? SPACE? - -# Terminals -PRINTABLES <- [[:graph:]]+ -SPACE <- ' ' -NEWLINE <- '\r\n' - / '\n' - / '\r' - -# Semantic Markdown -AnnotatedWordsX <- '[' Words ']' - ('{' (SemWords / ![{}] PlainWords) '}') -SemWords <- SEMPREFIX '<' ![<>] PRINTABLES '>' - / SEMPREFIX Curie -Curie <- NAME? ':' NAME? -SEMPREFIX <- [.#] @@ -119,9 +119,9 @@ are editorial notes not intended for inclusion in the final delivery.* # Markdown syntax as PEG {.appendix #sec-def-peg} -```{.peg include="def.peg" code-line-numbers="true"} +```{.peg include="syntax/def.peg" code-line-numbers="true"} ``` # Markdown syntax as syntax diagrams {.appendix #sec-def-dia} -{{< include _def_dia.qmd >}} +{{< include _syntax.qmd >}} diff --git a/def_AnnotatedWords.py b/syntax/def_AnnotatedWords.py index 8449ace..8449ace 100755 --- a/def_AnnotatedWords.py +++ b/syntax/def_AnnotatedWords.py diff --git a/def_AnnotatedWordsX.py b/syntax/def_AnnotatedWordsX.py index a90aaf6..a90aaf6 100755 --- a/def_AnnotatedWordsX.py +++ b/syntax/def_AnnotatedWordsX.py diff --git a/def_Block.py b/syntax/def_Block.py index b44c121..b44c121 100755 --- a/def_Block.py +++ b/syntax/def_Block.py diff --git a/def_HardBreak.py b/syntax/def_HardBreak.py index b39251b..b39251b 100755 --- a/def_HardBreak.py +++ b/syntax/def_HardBreak.py diff --git a/def_Header.py b/syntax/def_Header.py index f8c1935..f8c1935 100755 --- a/def_Header.py +++ b/syntax/def_Header.py diff --git a/def_LinkDefinition.py b/syntax/def_LinkDefinition.py index c340fe0..c340fe0 100755 --- a/def_LinkDefinition.py +++ b/syntax/def_LinkDefinition.py diff --git a/def_LinkLabel.py b/syntax/def_LinkLabel.py index 869e353..869e353 100755 --- a/def_LinkLabel.py +++ b/syntax/def_LinkLabel.py diff --git a/def_LinkTitle.py b/syntax/def_LinkTitle.py index beed133..beed133 100755 --- a/def_LinkTitle.py +++ b/syntax/def_LinkTitle.py diff --git a/def_LinkedWords.py b/syntax/def_LinkedWords.py index d9d7301..d9d7301 100755 --- a/def_LinkedWords.py +++ b/syntax/def_LinkedWords.py diff --git a/def_List.py b/syntax/def_List.py index 087727e..087727e 100755 --- a/def_List.py +++ b/syntax/def_List.py diff --git a/def_Markdown.py b/syntax/def_Markdown.py index 782e3c5..782e3c5 100755 --- a/def_Markdown.py +++ b/syntax/def_Markdown.py diff --git a/def_NEWLINE.py b/syntax/def_NEWLINE.py index 2720bee..2720bee 100755 --- a/def_NEWLINE.py +++ b/syntax/def_NEWLINE.py diff --git a/def_PRINTABLES.py b/syntax/def_PRINTABLES.py index 4fc41b4..4fc41b4 100755 --- a/def_PRINTABLES.py +++ b/syntax/def_PRINTABLES.py diff --git a/def_Paragraph.py b/syntax/def_Paragraph.py index 2f8e68d..2f8e68d 100755 --- a/def_Paragraph.py +++ b/syntax/def_Paragraph.py diff --git a/def_PlainWords.py b/syntax/def_PlainWords.py index eafe2fc..eafe2fc 100755 --- a/def_PlainWords.py +++ b/syntax/def_PlainWords.py diff --git a/def_SEMPREFIX.py b/syntax/def_SEMPREFIX.py index a7fc4a0..a7fc4a0 100755 --- a/def_SEMPREFIX.py +++ b/syntax/def_SEMPREFIX.py diff --git a/def_SPACE.py b/syntax/def_SPACE.py index 102f6f4..102f6f4 100755 --- a/def_SPACE.py +++ b/syntax/def_SPACE.py diff --git a/def_SemWords.py b/syntax/def_SemWords.py index 292e4b4..292e4b4 100755 --- a/def_SemWords.py +++ b/syntax/def_SemWords.py diff --git a/def_StyledWords.py b/syntax/def_StyledWords.py index 05a7583..05a7583 100755 --- a/def_StyledWords.py +++ b/syntax/def_StyledWords.py diff --git a/def_Uri.py b/syntax/def_Uri.py index 922a49d..922a49d 100755 --- a/def_Uri.py +++ b/syntax/def_Uri.py diff --git a/def_Words.py b/syntax/def_Words.py index f4e5152..f4e5152 100755 --- a/def_Words.py +++ b/syntax/def_Words.py diff --git a/def__.py b/syntax/def__.py index 0ae7368..0ae7368 100755 --- a/def__.py +++ b/syntax/def__.py |
