crystal-vesta
Crystal executable Markdown.
installation
Add the dependency to your shard.yml
:
dependencies:
holst:
github: ruivieira/crystal-vesta
and run shards install
.
command line
To install the CLI, clone this repository and run
crystal build vestacli.cr
The basic usage to render a markdown file foo.md
is
vestacli -i foo.md -o bar.md
examples
Given a Markdown file with crystal
code block, e.g.
# Title
This is a test, and with
a code block (`Crystal`)
```crystal
a = [1, 2, 3]
b = a.map{ |x| x*2 }
b
```
Let's try with another one
```crystal
c = 4
c
```
And ... the end.
vesta
will execute the code block and add the result after the block:
require "vesta"
vesta = Vesta::Renderer.new("test_file.md")
result = vesta.render
will result in:
# Title
This is a test, and with a code block (`Crystal`)
``` crystal
a = [1, 2, 3]
b = a.map{ |x| x*2 }
b
```
[2, 4, 6]
Let's try with another one
``` crystal
c = 4
c
```
```
4
```
And ... the end.
documentation
API documentation is available here.
A git mirror is available at https://git.sr.ht/~ruivieira/crystal-vesta.
mailing lists
- Announcements: https://lists.sr.ht/~ruivieira/crystal-announce
- Discussion: https://lists.sr.ht/~ruivieira/crystal-discuss
- Development: https://lists.sr.ht/~ruivieira/crystal-devel
Please prefix the subject with [crystal-vesta]
.