madfun 0.1.0

Autogenerate Atlassian Document Format (ADF) from Markdown
Documentation
# madfun

## `madfun`

**WARNING**: This crate is incomplete, and does not include full support for
all Markdown blocks. Known working blocks:

* links
* paragraphs
* text

<hr/>

Would you like to use `Ma`rkdown to post `A`tlassian `D`ocument `F`ormat while
still having `fun`? Then this tool's for you!

### How It Works

`madfun` works by taking input in
[Markdown](https://www.markdownguide.org/), either as text or a parsed
abstract syntax tree
([AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)) and converting
it to a `serde_json::Value` that conforms to Atlassian's
[ADF](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/).

Once you've got that, it should be simple to use any HTTP or Atlassian
client to send it wherever it's going.

### Usage

The core of `madfun` is the [`ToAdf`] trait; this exposes methods for
converting text or pre-parsed Markdown (via the `markdown` crate) into a
`serde_json::Value` that can then be serialized as you desire.

If you have Markdown text:

```rust
let adf: serde_json::Value = madfun::from_str(
    "Here is my Markdown content",
    &markdown::ParseOptions::default(),
).unwrap();
```

If you've already got the Markdown parsed into a `markdown::Node`, then you
can use the infallible [`ToAdf::to_adf`] method:

```rust
use madfun::ToAdf;

let mdast = markdown::to_mdast(
    "Here is my Markdown content",
    &markdown::ParseOptions::default(),
).unwrap();

let adf: serde_json::Value = mdast.to_adf();
```

### Limitations

`madfun` is currently unidirectional; it takes Markdown and renders ADF
JSON. Unfortunately, it can't (yet?) take ADF as returned from the Atlassian
APIs and convert it back to Markdown, though in theory this should be doable
(if not actually isomorphic).

### LICENSE

`madfun` is dual-licensed as MIT or Apache-2.0. Have fun.

License: MIT OR Apache-2.0