gleam icon indicating copy to clipboard operation
gleam copied to clipboard

Compile markdown files as snapshot tests, support it in LSP

Open lucasavila00 opened this issue 2 years ago • 2 comments

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.

lucasavila00 avatar Aug 07 '22 12:08 lucasavila00

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?

lpil avatar Aug 07 '22 13:08 lpil

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.

lucasavila00 avatar Aug 07 '22 13:08 lucasavila00

Is the feature to add "literate programming" to Gleam?

lpil avatar Aug 22 '22 19:08 lpil

Is the feature to add "literate programming" to Gleam?

Yes, but I'll re-open this in future with a better description.

lucasavila00 avatar Aug 22 '22 19:08 lucasavila00