Markdown implementation?

Has anyone seen/found a good Markdown implementation in Lua, preferably one that supports footnotes? [import]uid: 118600 topic_id: 33741 reply_id: 333741[/import]

Hello, I’m a bit confused what you mean by “implementation in Lua”. What do you want to do with markdown, read/parse it into Lua data?

Brent [import]uid: 200026 topic_id: 33741 reply_id: 134123[/import]

Brent, I’m looking to read in a plaintext Markdown file and convert the contents to HTML. I can’t seem to find a good Lua implementation for this, though there are plenty in other languages. The one decent one I found for Lua doesn’t support footnotes.

I have an idea for an app, but I’m trying to gauge whether all the pieces exist to put it together. [import]uid: 118600 topic_id: 33741 reply_id: 134276[/import]

Hi @wyldkard,
Well, I don’t know of such a converter, and if you’ve searched extensively, there probably isn’t one better than the one you found. So, I guess you’d be forced to write your own, using string/pattern matching, substitution, etc. It would be a fairly intensive routine, but since Markdown isn’t necessarily an ultra-complicated format, maybe it’s not so bad to consider.

If you do attempt it, best of luck, and please consider posting it to the Code Share if you do, so others can benefit from your efforts. :slight_smile:

Brent
[import]uid: 200026 topic_id: 33741 reply_id: 134300[/import]

Hello, I’m a bit confused what you mean by “implementation in Lua”. What do you want to do with markdown, read/parse it into Lua data?

Brent [import]uid: 200026 topic_id: 33741 reply_id: 134123[/import]

Brent, I’m looking to read in a plaintext Markdown file and convert the contents to HTML. I can’t seem to find a good Lua implementation for this, though there are plenty in other languages. The one decent one I found for Lua doesn’t support footnotes.

I have an idea for an app, but I’m trying to gauge whether all the pieces exist to put it together. [import]uid: 118600 topic_id: 33741 reply_id: 134276[/import]

Hi @wyldkard,
Well, I don’t know of such a converter, and if you’ve searched extensively, there probably isn’t one better than the one you found. So, I guess you’d be forced to write your own, using string/pattern matching, substitution, etc. It would be a fairly intensive routine, but since Markdown isn’t necessarily an ultra-complicated format, maybe it’s not so bad to consider.

If you do attempt it, best of luck, and please consider posting it to the Code Share if you do, so others can benefit from your efforts. :slight_smile:

Brent
[import]uid: 200026 topic_id: 33741 reply_id: 134300[/import]

As a follow-up, Wikipedia has a list of Markdown implementations which includes three written in Lua: http://en.wikipedia.org/wiki/List_of_Markdown_implementations

Luamark is the most promising of the three, as it supports footnotes, but I haven’t delved into it enough to see if I can incorporate it into a Corona project. [import]uid: 118600 topic_id: 33741 reply_id: 134716[/import]

Hi,

I’ll also suggest to have a look at Doctool and LDoc. They are both documentation generators. I haven’t used Doctool yet, only LDoc, which is really great at generating HTML documents.
Anyway, they both process Markdown files and turn them into HTML documents.
Hope this helps. [import]uid: 142361 topic_id: 33741 reply_id: 134950[/import]

As a follow-up, Wikipedia has a list of Markdown implementations which includes three written in Lua: http://en.wikipedia.org/wiki/List_of_Markdown_implementations

Luamark is the most promising of the three, as it supports footnotes, but I haven’t delved into it enough to see if I can incorporate it into a Corona project. [import]uid: 118600 topic_id: 33741 reply_id: 134716[/import]

Hi,

I’ll also suggest to have a look at Doctool and LDoc. They are both documentation generators. I haven’t used Doctool yet, only LDoc, which is really great at generating HTML documents.
Anyway, they both process Markdown files and turn them into HTML documents.
Hope this helps. [import]uid: 142361 topic_id: 33741 reply_id: 134950[/import]

roland.yonaba, does LDoc let you take a single markdown document (or string) and convert it into HTML? The documentation at the respective GitHub page isn’t clear.

I looked at Lunamark and lua-discount, but both require C bindings and thus won’t work with Corona. Markdown.lua is the only one that works, but it doesn’t support footnotes (and breaks them). Any other suggestions?

roland.yonaba, does LDoc let you take a single markdown document (or string) and convert it into HTML? The documentation at the respective GitHub page isn’t clear.

I looked at Lunamark and lua-discount, but both require C bindings and thus won’t work with Corona. Markdown.lua is the only one that works, but it doesn’t support footnotes (and breaks them). Any other suggestions?

Sorry for the delay.

Short answer is “yes” :).

Roland, does LDoc support footnotes? Can you provide an example for how to call and use it?

I’m answering my own question here, but LDoc doesn’t support footnotes either, in that it relies on the aforementioned Markdown utilities.

Sorry for the delay.

Short answer is “yes” :).

Roland, does LDoc support footnotes? Can you provide an example for how to call and use it?

I’m answering my own question here, but LDoc doesn’t support footnotes either, in that it relies on the aforementioned Markdown utilities.