commonmark icon indicating copy to clipboard operation
commonmark copied to clipboard

A CommonMark parser and HTML generator for Go

CommonMark for Go

commonmark aims to be a standards-compliant, pluggable and fast CommonMark implementation for Go (golang).

It is not ready for use, and probably never will be. As it turns out, writing a CommonMark implementation that (a) conforms to the spec, (b) does not mirror the inextensible, inflexible design of the reference implementation, and (c) is pluggable, is harder than I estimated, and I don't have time for it.

Installing

go get github.com/ttencate/commonmark

Documentation

See the generated documentation on godoc.org.

Developing

After you cloned the repository, please run

./scripts/install_hooks.sh

to install a Git pre-commit hook that reminds you to run gofmt.

  • TODO write about running the test suite

Benchmarks

  • TODO benchmark and compare to some other implementations, in particular the C reference implementation

License

Three-clause BSD license. See the LICENSE file for details.

Alternatives

  • sudhirj/godown, at the time of writing (Oct 2014), claims to be a "Fast and parallel CommonMark parser" but is as of yet incomplete (only 55 lines of code), and doesn't appear to be parallel.
  • valoox/gomk, at the time of writing (Oct 2014), claims to be a "Go implementation of the standard CommonMark markdown parser" but contains no code yet.
  • go-commonmark is a Go wrapper around the official C implementation.