Great work @lil5 ! This is definitely an area that needs attention.
We recently did some work (that hasn’t been properly packaged for end use yet) for:
- Formatting all example code in docstrings
- Extracting all example code from docstrings (so you can compile and run them as tests for example)
It’s currently available in v12 via the Tools package: rescript/tools/bin/main.ml at master · rescript-lang/rescript · GitHub
Maybe that’s something that could be of interest as well. At some point, I’d love it if we made it super simple to:
- Write and maintain working example code in docstrings
- Package up the playground so you could embed your own ReScript code editor on your website/in your docs, and put your examples in there easily
Some loose thoughts. Anyway, great work!