-
Notifications
You must be signed in to change notification settings - Fork 67
Output Markdown from AST #63
Comments
After digging around a bit more, I found that this has been discussed before at talk.commonmark.org, and furthermore it's already done in cmark as of v0.24.1, so I'd like to think it's in-scope. Maybe I'll have to submit a PR (if I can put together the renderer) |
Fyi, I have some work-in-progress code for this at https://github.com/JoshData/commonmark-py-plaintext. |
Thanks! Looks like a good start. Although the backslash escaping is excessive (e.g. for links; see http://spec.commonmark.org/0.25/#example-294) |
I will implement the CommonMark renderer in this library if jgm puts it in commonmark.js. In the meantime, JoshData's library looks cool, maybe we can incorporate that into CommonMark-py if necessary. |
@goodmami Thanks, good point. I've pushed a few more commits. |
@goodmami That's a good point.. we aren't necessarily bound to commonmark.js, that's just where the original authors of this library happened to be porting the code from. There's no reason we can't also port the C code using cmark. I'll take a closer look at cmark and see if it makes sense to use both of these reference implementations with CommonMark-py. I wasn't aware that jgm was adding different features to the different reference implementations. |
Any work done in this front? I'm currently looking for exactly this. |
@unode: I'm not sure about others, but I'm not working on it and I'm currently unable to take up the task. I would still like to see it implemented, though! Also, if this repo is de facto bound to commonmark.js, then this issue needs to be resolved first. But if this repo is free to implement features from cmark as well, then it's just a pull request away, I'd think. Any takers? |
Is it within the project's scope to generate CommonMark from the AST? I'm looking for something that lets me programmatically assemble an AST and generate Markdown, e.g. for generating GitHub wikis. For example, if this were possible:
or even:
Then I could do:
Or perhaps this is something that would first have to be done in https://github.com/jgm/commonmark.js?
The text was updated successfully, but these errors were encountered: