crystal-vesta

Crystal executable Markdown

tests builds.sr.ht status

crystal-vesta

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

Please prefix the subject with [crystal-vesta].

Repository

crystal-vesta

Owner
Statistic
  • 5
  • 1
  • 0
  • 0
  • 2
  • about 3 years ago
  • April 2, 2021
License

GNU Affero General Public License v3.0

Links
Synced at

Wed, 24 Apr 2024 20:19:02 GMT

Languages