benmills / robotskirt

A node wrapper for the awesome C markdown parser, sundown.
benmills.org/robotskirt
MIT License
165 stars 21 forks source link

Question: AST from Markdown #18

Closed zzen closed 11 years ago

zzen commented 12 years ago

This is more akin a quick question/feasibility - I need to get parsed AST tree out of robotskirt (and write my own renderer). Is there a guide/how-to/API for that?

mildsunrise commented 12 years ago

Support for custom renderers is really haaard to implement, but it seems we are finally getting it working.

Soon it'll be fully stable (for now there's only one function to customize) but if you're impatient, keep an eye on the unstable branch and the wiki page of that feature.

mildsunrise commented 12 years ago

With v2, there's (finally) full support for custom renderers! The new readme (to be published soon) explains how to use them. There's also an example of an ANSI renderer bundled with Robotskirt.

I'm not closing this issue. If you have trouble with custom renderers in Robotskirt, please post them here. Also feel free to leave any other feedback at #21.

mildsunrise commented 11 years ago

@zzen Which format should be the parsed AST tree? JSON? XML? YAML?

zzen commented 11 years ago

Well, since the interface is in Javascript, and I will consume the AST tree in Javascript, I would certainly prefer getting just a plain Javascript object.

However if you must serialize it into a string, then JSON would be my choice.

mildsunrise commented 11 years ago

OK, I'll try to make something these days. Meanwhile, I'm closing the issue, because this isn't related to a bug or feature request in Robotskirt.