gleam
gleam copied to clipboard
Compile markdown files as snapshot tests, support it in LSP
I think that having a mechanical mechanism to verify and generate markdown content would be a nice feature.
It should read markdown files and execute the content of gleam code blocks.
```gleam --format-out="one_line" // we can use the info string as a CLI arguments calling interface
import string/concat
concat(["butter", "fly"])
```
```
"butterfly"
```
A lot of this backend could later support an Elixir Livebook or Jupyter Notebook thing.
But as a starter, I think the scope should be something similar to:
MDX https://github.com/realworldocaml/mdx which generated https://dev.realworldocaml.org/guided-tour.html
or https://github.com/lucasavila00/eval-md which generated https://lucasavila00.github.io/sql-select-ts/examples/getting-started.html
It would be nice if the LSP supported it.
Sorry, I am not understanding the precise feature is here. Are you talking about markdown in documentation comments? Which can then be run with gleam test
?
Are you talking about markdown in documentation comments? Which can then be run with gleam test?
Sorry. I didn't know it existed.
I'll edit the issue.
Is the feature to add "literate programming" to Gleam?
Is the feature to add "literate programming" to Gleam?
Yes, but I'll re-open this in future with a better description.