GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C
Перейти к файлу
John MacFarlane 4051f2ec7d Added ansi so we don't need to install anything to run testjs. 2014-08-13 22:56:32 -07:00
data Initial commit 2014-08-13 22:56:32 -07:00
js Added ansi so we don't need to install anything to run testjs. 2014-08-13 22:56:32 -07:00
oldtests Initial commit 2014-08-13 22:56:32 -07:00
src Initial commit 2014-08-13 22:56:32 -07:00
.gitignore Initial commit 2014-08-13 22:56:32 -07:00
LICENSE Initial commit 2014-08-13 22:56:32 -07:00
Makefile Initial commit 2014-08-13 22:56:32 -07:00
README.md Initial commit 2014-08-13 22:56:32 -07:00
TODO Initial commit 2014-08-13 22:56:32 -07:00
alternative-html-blocks.txt Initial commit 2014-08-13 22:56:32 -07:00
license.bstrlib.txt Initial commit 2014-08-13 22:56:32 -07:00
license.uthash.txt Initial commit 2014-08-13 22:56:32 -07:00
mkcasefold.pl Initial commit 2014-08-13 22:56:32 -07:00
runtests.pl Initial commit 2014-08-13 22:56:32 -07:00
spec.txt Initial commit 2014-08-13 22:56:32 -07:00
spec2js.js Initial commit 2014-08-13 22:56:32 -07:00
spec2md.pl Initial commit 2014-08-13 22:56:32 -07:00
specfilter.hs Initial commit 2014-08-13 22:56:32 -07:00
template.html Initial commit 2014-08-13 22:56:32 -07:00
template.tex Initial commit 2014-08-13 22:56:32 -07:00

README.md

Standard markdown

Standard markdown is a specification of markdown syntax, together with implementations (stmd) in C and javascript.

The C implementation provides both a library and a standalone program that converts markdown to HTML. It is written in standard C99 and has no library dependencies. (However, if you check it out from the repository, you'll need re2c to generate scanners.c from scanners.re. This is only a build dependency for developers, since scanners.c can be provided in a released source tarball.)

The javascript implementation is a single javascript file that can be linked to an HTML page. A standalone version (using node.js) is also provided (js/markdown), and there is a "dingus" for playing with it interactively. (make dingus will start this.)

The spec contains over 400 embedded examples which serve as conformance tests. To run the tests for stmd, do make test. To run them for another markdown program, say myprog, do make test PROG=myprog. To run the tests for stmd.js, do make testjs.

The source of the spec is spec.txt. This is basically a markdown file, with code examples written in a shorthand form:

.
markdown source
.
expected HTML output
.

To build an HTML version of the spec, do make spec.html. To build a PDF version, do make spec.pdf. Both these commands require that pandoc is installed, and creating a PDF requires a latex installation.