https://github.com/ruivieira/crystal-vesta
Crystal executable Markdown
https://github.com/ruivieira/crystal-vesta
crystal literate-programming markdown
Last synced: 2 months ago
JSON representation
Crystal executable Markdown
- Host: GitHub
- URL: https://github.com/ruivieira/crystal-vesta
- Owner: ruivieira
- License: agpl-3.0
- Created: 2021-04-02T14:04:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T20:21:09.000Z (over 4 years ago)
- Last Synced: 2025-07-21T09:56:43.146Z (3 months ago)
- Topics: crystal, literate-programming, markdown
- Language: Crystal
- Homepage: https://ruivieira.github.io/crystal-vesta/
- Size: 98.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/ruivieira/crystal-vesta/actions/workflows/main.yml) [](https://builds.sr.ht/~ruivieira/crystal-vesta/commits/.build.yml?)
# crystal-vesta

Crystal executable Markdown.
## installation
Add the dependency to your `shard.yml`:
```yaml
dependencies:
holst:
github: ruivieira/crystal-vesta
```
and run `shards install`.
### command line
To install the CLI, clone this repository and run
```shell
crystal build vestacli.cr
```
The basic usage to render a markdown file `foo.md` is
```shell
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:
```crystal
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](https://ruivieira.github.io/crystal-vesta/).
A git mirror is available at [https://git.sr.ht/~ruivieira/crystal-vesta](https://git.sr.ht/~ruivieira/crystal-vesta).
## mailing lists
- Announcements: [https://lists.sr.ht/~ruivieira/crystal-announce](https://lists.sr.ht/~ruivieira/crystal-announce)
- Discussion: [https://lists.sr.ht/~ruivieira/crystal-discuss](https://lists.sr.ht/~ruivieira/crystal-discuss)
- Development: [https://lists.sr.ht/~ruivieira/crystal-devel](https://lists.sr.ht/~ruivieira/crystal-devel)
Please prefix the subject with `[crystal-vesta]`.