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
http://lists.luaforge.net/pipermail/luarocks-developers/attachments/20080803/2f328c5f/lua-discount-1.2.7-1.obj).

I include the README below:

# lua-discount

A binding to [Discount](http://www.pell.portland.or.us/~orc/Code/discount/), a
fast C implementation of the
[Markdown](http://daringfireball.net/projects/markdown) text to HTML markup
system. Discount passes the Markdown test suite.

## Project links
* [Home](http://asbradbury.org/projects/lua-discount/)
* [Download](http://luaforge.net/projects/lua-discount/)
* [Documentation](http://asbradbury.org/projects/lua-discount/#usage)
* [Source](http://github.com/asb/lua-discount/)

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

## See also
* [Discount](http://www.pell.portland.or.us/~orc/Code/discount/)
* [Markdown syntax](http://daringfireball.net/projects/markdown/syntax)
* [markdown.lua](http://www.frykholm.se/files/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](http://example.com).
      ]]

      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:

=`"nolinks"`=
    do not allow `<a` or expand Markdown links.
=`"noimages"`=
    do not allow `<img` or expand Markdown images.
=`"nopants"`=
    disable [SmartyPants](http://daringfireball.net/projects/smartypants/)
    processing.
=`"tagtext"`=
    don't expand `*` or `_` when used for emphasis.
=`"noext"`=
    do not process
    [pseudo-protocols](http://www.pell.portland.or.us/~orc/Code/discount/#pseudo)
=`"cdata"`=
    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
license](http://github.com/asb/lua-discount/tree/master/LICENSE).

This product includes software developed by [David Loren
Parsons](http://www.pell.portland.or.us/~orc).

## Contact
Author: A.S. Bradbury
Email: <asb@asbradbury.org>
Homepage: <http://asbradbury.org/>