Last active
May 11, 2025 09:47
-
-
Save sogaiu/833765603954c9b2a88714433b057fa4 to your computer and use it in GitHub Desktop.
remarkable parse trees
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import ./remarkable :as r) | |
(comment | |
# extracted from jurl smtp.janet new's docstring | |
(def false-link-minimal "<[email protected]>") | |
(r/parse-md false-link-minimal) | |
# => | |
[:document @{:container? true :open? true} | |
@[[:paragraph @{:inlines? true :open? false} | |
@[[:link @{:url "mailto:[email protected]"} | |
@["[email protected]"]]]]]] | |
# use of ordinary strings causes an unintentionaly large area to | |
# become an indented codeblock | |
# | |
# on a side note, there is a bit near the end of the docstring | |
# that one might have wanted to use an indented codeblock for... | |
(def unintended-indented-codeblock-ds | |
"Return a function that calls f on each line of stdin.\n\n | |
writing the result to stdout if it is not nil.\n\n | |
Example: \n\n | |
(sh/$ echo \"a\\nb\\nc\" | (out-lines string/ascii-upper))") | |
(r/parse-md unintended-indented-codeblock-ds) | |
# => | |
[:document @{:container? true :open? true} | |
@[[:paragraph @{:inlines? true :open? false} | |
@[@"Return a function that calls f on each line of stdin."]] | |
[:codeblock @{:kind :indented :open? false} | |
@[" writing the result to stdout if it is not nil.\n" | |
"\n" | |
" Example: \n" | |
"\n" | |
" (sh/$ echo \"a\\nb\\nc\" | (out-lines string/ascii-upper))"]]]] | |
(def strong-and-emphasis | |
```` | |
**strong** and _emphasis 1_ and *emphasis 2* | |
````) | |
(r/parse-md strong-and-emphasis) | |
# => | |
[:document @{:container? true :open? true} | |
@[[:paragraph @{:inlines? true :open? false} | |
@[[:strong @{} @[@"strong"]] | |
@" and " | |
[:emphasis @{} @[@"emphasis 1"]] | |
@" and " | |
[:emphasis @{} @[@"emphasis 2"]]]]]] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment