lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I'm please to announce the first public release of lua-discount, which
provides a fast C Markdown implementation. This release will not
compile on windows due to the lack of funopen/fopencookie, but should
compile on Linux or *BSD. Thanks to 'InsertWittyName' on #lua for
testing on OSX. I package the Discount sources so there are no
external dependencies. I've set the version number to match the
Discount release used. To install, either grab the .tar.gz from
luaforge or `luarocks install lua-discount` (if the rock has not yet
been added to the central repository, grab it from

I include the README below:

# lua-discount

A binding to [Discount](, a
fast C implementation of the
[Markdown]( text to HTML markup
system. Discount passes the Markdown test suite.

## Project links
* [Home](
* [Download](
* [Documentation](
* [Source](

## Release history
* lua-discount-1.2.7 (2008-08-03)
  * first public release

## See also
* [Discount](
* [Markdown syntax](
* [markdown.lua](

## [Usage](id:usage)
Note that `require("discount")` returns a single function, which you are
responsible for giving a suitable name. Example:

    discount = require("discount")

    local markdown_string = [[
      # Demonstration
      This is a demonstration of lua-discount. Passing the options `"nolinks"`
      disables links such as [this](

      local html_string = discount(markdown_string, "nolinks")

The `discount` function takes as its first argument the Markdown string to
convert, and for its subsequent arguments takes any combination of the
following strings as options:

    do not allow `<a` or expand Markdown links.
    do not allow `<img` or expand Markdown images.
    disable [SmartyPants](
    don't expand `*` or `_` when used for emphasis.
    do not process
    generate output suitable for use as data in an XML document.
= `"embed"`=
    equivalent to specifying `"nolinks"`, `"noimages"` and `"tagtext"`.

## License and acknowledgements
lua-discount is distributed under [a BSD-style

This product includes software developed by [David Loren

## Contact
Author: A.S. Bradbury
Email: <>
Homepage: <>