# Marka

Bidirectional mapping between Markdown and JSON (Schema.org-style) via small, declarative templates. Marka enables you to parse Markdown to JSON and render JSON back to Markdown using the same template.

## Features

*   **Bidirectional Mapping:** Convert Markdown to JSON and JSON to Markdown using a single template.
*   **Declarative Templates:** Define your mappings with concise, easy-to-understand templates.
*   **JSON Schema Validation:** Validate parsed JSON against Schema.org entities using JSON Schema.

## How it works

Marka uses a custom template file to enable bidirectional between Markdown and Data. A minimal `marka` schema could look like:

```markdown
# { articleTitle }

{ articleBody }
```

Then it could parse the following markdown:

```markdown
# MyArticle

The article body which could 
contain newlines.
```

Into the following data:

```json
{
  "articleTitle": "MyArticle",
  "articleBody": "The article body which could\ncontain newlines.",
}
```

And reversely if you give it the json it could reproduce the input markdown. If you want to dive into the deeper workings of the template look at [template/README.md](./template/README.md)

## Docker Image (CRUD API)

A Docker image is available to transform a specified directory into a CRUD API. This allows you to expose your Markdown-to-JSON mappings as a web service.

To run the Docker image:
```bash
docker run -p 8080:8080 -v /path/to/your/data:/app/data max/marka-server
```
*(Replace `/path/to/your/data` with the absolute path to the directory you want to expose.)*

## License

This project is licensed under the [GNU General Public License v3.0](LICENSE.md).
