hoedown/hoedown — pull request #26 by jmendeth (2013-10-06 19:03:04+00:00)
Title: [prototype] API v2

Based on the work of @devinus in 9881652c7823544a92be705b23fc116dc250bbed,
I've sketched out the following API:

#### Markdown interface

- A `hoedown_renderer` (previously `hoedown_callbacks`) contains the callbacks
necessary to produce output. But now, it also contains a `void* opaque`. So it
is a *truly independent renderer*, since it carries both options and callbacks.
- Thus, instead of passing the options object as a *separate argument* in the call to `hoedown_markdown_new`
it'll be set in the `hoedown_renderer` struct.

#### HTML interface

- `hoedown_html_renderer_new` (previously `hoedown_html_renderer`) allocates and
returns a `hoedown_renderer` with the callbacks and the (also allocated) options object set.
- The options struct (`hoedown_html_renderopt`) is now invisible to the user, since he
only has to care about allocating a `hoedown_renderer` and feeing it.

This makes the new API simple, consistent and to the point. From `hoedown.c`:

```c
renderer = hoedown_html_renderer_new(0, 0);
markdown = hoedown_markdown_new(0, 16, renderer);

hoedown_markdown_render(ob, ib->data, ib->size, markdown);

hoedown_markdown_free(markdown);
hoedown_html_renderer_free(renderer);
```

That's it. New renderer, new parser, call `render`, and free both.

What do you think @devinus @FSX?