vesta

Version, currently 0.2.24 versions

github.com/ruivieira/crystal-vesta

Crystal executable Markdown

6 stars
0 dependents
License: AGPL3

Installation

# Add this to your shard.yml
dependencies:
  vesta:
    github: ruivieira/crystal-vesta
    version: ~> 0.2.2

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
AGPL3
Author
Rui Vieira <ruidevieira@googlemail.com>

Dependencies

Runtime Dependencies

  • icr*github: crystal-community/icr, branch: master
  • cmark*github: amauryt/cr-cmark-gfm

README

[![tests](https://github.com/ruivieira/crystal-vesta/actions/workflows/main.yml/badge.svg)](https://github.com/ruivieira/crystal-vesta/actions/workflows/main.yml) [![builds.sr.ht status](https://builds.sr.ht/~ruivieira/crystal-vesta/commits/.build.yml.svg)](https://builds.sr.ht/~ruivieira/crystal-vesta/commits/.build.yml?)

# crystal-vesta

![vesta](./docs/vesta.png)

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]`.