Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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/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/ -- might do everything you need in a simpler way!



Out of curiosity, would you be able to write a parser that uses the markdown style for image links?


Yes, 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) into a ChatGpt or Claude.ai prompt and ask it to write one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: