4 ms·
Here is how you would do your image example in Scroll: rst: .. image:: example.jpg :alt: alttext scroll: image example.jpg caption alttex
by breck 2y ago
Here is how you would do your image example in Scroll:
rst:
.. image:: example.jpg
:alt: alttext
scroll:
image example.jpg
caption alttext
"Directives" in rST are "Parsers" in Scroll. The item above would be parsed by the `imageParser`, which at ~50 lines of code (https://github.com/breck7/scroll/blob/b8fd72aa38742cc6cd575fa57aa764d0b35a44a7/parsers/images.parsers#L25 https://github.com/breck7/scroll/blob/b8fd72aa38742cc6cd575f...), is actually more code than the average parser.
To write your "exercise extension" in Scroll, you would just need to write a few lines of code definining an "exerciseParser". You could put that in the same file you use it in, or in a file named "exercise.parsers".
I think you should explore Scroll -- https://scroll.pub/ https://scroll.pub/ -- might do everything you need in a simpler way!
- eviks 2y agoOut of curiosity, would you be able to write a parser that uses the markdown style for image links?
- breck 2y agoYes, you could do that. At some point soon (perhaps this already works today), you could probably just copy/paste the entire Scroll Parsers code (https://try.scroll.pub/scroll.parsers https://try.scroll.pub/scroll.parsers) into a ChatGpt or Claude.ai prompt and ask it to write one.