-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use .effekt.md
for literate Effekt code
#341
Conversation
.effekt.md
for literate Effekt code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note: In some of the case studies, we use something like
To give the output of a function etc.
directly. |
@@ -10,17 +10,22 @@ import kiama.util.Source | |||
*/ | |||
case class MarkdownSource(source: Source) extends Source { | |||
|
|||
val fenceLine = """^```[^`\n]*$""".r | |||
val fenceLine = """^```\s*(effekt)?\s*((\s|:)[^`]*)?$""".r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this regex support all the crazy flags passed on the website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should. It does support the ones here:
effekt/examples/casestudies/ad.md
Lines 16 to 23 in c4febaa
```effekt:sketch:hide | |
module examples/casestudies/ad | |
``` | |
```effekt:prelude:hide | |
import immutable/list | |
import mutable/heap | |
``` |
(which were the motivation behind allowing
(\s|:)[^`]*)?
there)
So I would be inclined to say yes, though I did not specifically test for them.
This mirrors effekt-lang/effekt-vscode#14, i.e.:
.effekt.md
instead of plain.md
for literate Effekt code.effekt
(plus optional spaces) are ignored.I.e. valid (opening and closing) fence delimiters: