aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-26 10:52:35 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-26 11:40:24 +0200
commit393fbb26231c57309e8bfa92c9b209c5f4b6c70e (patch)
treea2524e2390d865df2824aac07cfbdf039f5a8d64
parent0e9dcfb9067585e4698b050c0d4f4dff3efe4377 (diff)
consistently mark new syntax with dotted line
-rw-r--r--_markdown.qmd6
-rwxr-xr-xsyntax/def_Curie.py16
-rwxr-xr-xsyntax/def_PrefixDefinition.py16
-rwxr-xr-xsyntax/def_SEMPREFIX.py2
-rwxr-xr-xsyntax/def_SemWord.py4
-rwxr-xr-xsyntax/def_SemWords.py22
6 files changed, 35 insertions, 31 deletions
diff --git a/_markdown.qmd b/_markdown.qmd
index 542b175..c78ba87 100644
--- a/_markdown.qmd
+++ b/_markdown.qmd
@@ -209,10 +209,6 @@ as [Appendix @sec-def-dia].
Semantic Markdown mainly extends the syntax for `AnnotatedWords`,
and introduces a new syntax similar to `LinkDefinition`.
-The syntax drawings in this subsection has the extended syntax marked
-with a dotted frame.
-
-*FIXME: add dot-frame for all drawings used here*
`AnnotatedWords` can in principle contain any word,
but in practice expects CSS id or class definitions,
@@ -221,6 +217,8 @@ New higher prioritized syntaxes are added,
prioritized since that is simplest
and it should not cause clash with existing elements,
as in @fig-def-extensions.
+Syntax newly introduced as part of Semantic Markdown
+is marked with a dotted frame.
*FIXME: mention and draw extended LinkedWordsX as well.*
diff --git a/syntax/def_Curie.py b/syntax/def_Curie.py
index 98a69c5..a78815b 100755
--- a/syntax/def_Curie.py
+++ b/syntax/def_Curie.py
@@ -6,13 +6,15 @@
from railroad import *
Diagram(
- Choice(0,
- Sequence(
- Choice(0, NonTerminal("CuriePrefix"), Skip() ),
- (":")
+ Group(Sequence(
+ Choice(0,
+ Sequence(
+ Choice(0, NonTerminal("CuriePrefix"), Skip() ),
+ (":")
+ ),
+ Skip()
),
- Skip()
- ),
- NonTerminal("CurieReference"),
+ NonTerminal("CurieReference")
+ )),
type="complex"
).writeStandalone(sys.stdout.write)
diff --git a/syntax/def_PrefixDefinition.py b/syntax/def_PrefixDefinition.py
index c0e108a..d838c6b 100755
--- a/syntax/def_PrefixDefinition.py
+++ b/syntax/def_PrefixDefinition.py
@@ -6,12 +6,14 @@
from railroad import *
Diagram(
- "{",
- NonTerminal("CuriePrefix"),
- "}",
- ":",
- Choice(0, NonTerminal("_"), Skip()),
- NonTerminal("SemWord"),
- NonTerminal("NEWLINE"),
+ Group(Sequence(
+ "{",
+ NonTerminal("CuriePrefix"),
+ "}",
+ ":",
+ Choice(0, NonTerminal("_"), Skip()),
+ NonTerminal("SemWord"),
+ NonTerminal("NEWLINE")
+ )),
type="complex"
).writeStandalone(sys.stdout.write)
diff --git a/syntax/def_SEMPREFIX.py b/syntax/def_SEMPREFIX.py
index cb7d555..c1048f0 100755
--- a/syntax/def_SEMPREFIX.py
+++ b/syntax/def_SEMPREFIX.py
@@ -6,6 +6,6 @@
from railroad import *
Diagram(
- "[.=]",
+ Group("[.=]"),
type="complex"
).writeStandalone(sys.stdout.write)
diff --git a/syntax/def_SemWord.py b/syntax/def_SemWord.py
index d0768ad..243c707 100755
--- a/syntax/def_SemWord.py
+++ b/syntax/def_SemWord.py
@@ -6,7 +6,7 @@
from railroad import *
Diagram(
- Choice(0,
+ Group(Choice(0,
Sequence(
NonTerminal("SEMPREFIX"),
"<",
@@ -17,6 +17,6 @@ Diagram(
NonTerminal("SEMPREFIX"),
NonTerminal("CURIE"),
)
- ),
+ )),
type="complex"
).writeStandalone(sys.stdout.write)
diff --git a/syntax/def_SemWords.py b/syntax/def_SemWords.py
index dbf2a1d..83867ef 100755
--- a/syntax/def_SemWords.py
+++ b/syntax/def_SemWords.py
@@ -6,15 +6,17 @@
from railroad import *
Diagram(
- NonTerminal("SemWord"),
- Choice(0,
- OneOrMore(
- Sequence(
- NonTerminal("_"),
- NonTerminal("SemWord")
- )
- ),
- Skip()
- ),
+ Group(Sequence(
+ NonTerminal("SemWord"),
+ Choice(0,
+ OneOrMore(
+ Sequence(
+ NonTerminal("_"),
+ NonTerminal("SemWord")
+ )
+ ),
+ Skip()
+ )
+ )),
type="complex"
).writeStandalone(sys.stdout.write)