Skip to content

Evaluate markdown code-blocks and render the output in markdown

License

Notifications You must be signed in to change notification settings

bas080/markatzea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markatzea

This project's README.md and stdout codeblocks are created using markatzea:

markatzea README.mz > README.md

Markatzea does not break your existing markdown. It adds a little syntax for defining the interpreter for that code block. This is defined after the code-block's language name. The code-block is then passed as stdin into the interpreter configured for that code-block.

Usage

pod2text markatzea
NAME
    markatzea - evaluate your markdown code blocks

SYNOPSIS
    markatzea <file>

DESCRIPTION
    markatzea is a tool which takes markdown, evaluates code blocks with
    interpreters and prints the output of those processes to a different
    codeblock.

Examples

Normal code-block

When no interpreter is defined, markatzea will print the markdown as is.

```bash
echo 'Does not evaluate this bash code-block'
```
echo 'Does not evaluate this bash code-block'

Evaluated code-block

```bash bash
echo 'Does evaluate this bash code-block with bash'
```
echo 'Does evaluate this bash code-block with bash'
Does evaluate this bash code-block with bash

Output Language

You can define the language to use for the output code block.

```bash|javascript bash
echo 'const value = 42;'
```
echo 'const value = 42;'
const value = 42;

Literate Programming

You can achieve a form of a literate programming using a template language that offers a command line interface. See memplate for more information.

An example:

set -eo pipefail

Now we use the aliased template in another template.

<sane-bash-defaults

ls not-a-file |
  cat - ||
  echo 'Good! The ls process caused the pipe to stop.'
Good! The ls process caused the pipe to stop.

Projects that use markatzea

A list of projects that use markatzea.

Notice that it makes it easier to maintain and test documentation by making usage examples runnable and thereby testable.

License

GPL-3.0

About

Evaluate markdown code-blocks and render the output in markdown

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages