Giter Club home page Giter Club logo

markdown's Introduction

markdown.lua

Build Status Coverage Status

This is an implementation of the popular text markup language Markdown in pure Lua. Markdown can convert documents written in a simple and easy to read text format to well-formatted HTML. For a more thorough description of Markdown and the Markdown syntax, see http://daringfireball.net/projects/markdown/.

The original Markdown source is written in Perl and makes heavy use of advanced regular expression techniques (such as negative look-ahead, etc) which are not available in Lua's simple regex engine. Therefore this Lua port has been rewritten from the ground up. It is probably not completely bug free. If you notice any bugs, please report them using GitHub issues. A unit test that exposes the error is helpful.

markdown.lua has been written by Niklas Frykholm (original). This version has been updated to run under Lua 5.2 and Lua 5.3 in addition to Lua 5.1.

Usage

local markdown = require "markdown"
markdown(source)

markdown module returns a single function which applies the Markdown transformation to the specified string. For compatibility it is also set as a global.

markdown.lua can also be used directly from the command line:

lua markdown.lua test.md

Creates a file test.html with the converted content of test.md. Run:

lua markdown.lua -h

For a description of the command-line options.

Installation

Simply copy markdown.lua into your directory for Lua libraries. Alternatively, use LuaRocks and run [sudo] luarocks install markdown.

Miscellaneous

markdown.lua uses the same license as Lua, the MIT license.

An alternative Markdown implementation is lua-discount. It is faster than markdown.lua, at the cost of being written in C.

markdown's People

Contributors

mpeterv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.