Go to file
Kevin Burke e95ae00e83
Initial commit
2017-10-22 10:29:44 -07:00
vendor/github.com Initial commit 2017-10-22 10:29:44 -07:00
.gitignore Initial commit 2017-10-22 10:29:44 -07:00
.travis.yml Initial commit 2017-10-22 10:29:44 -07:00
Gopkg.lock Initial commit 2017-10-22 10:29:44 -07:00
Gopkg.toml Initial commit 2017-10-22 10:29:44 -07:00
Makefile Initial commit 2017-10-22 10:29:44 -07:00
README.md Initial commit 2017-10-22 10:29:44 -07:00
main.go Initial commit 2017-10-22 10:29:44 -07:00

README.md

chroma-markdown

This binary compiles Markdown files into HTML. In particular, code blocks of the following format:


```go
fmt.Println("hello world")
```

Will be parsed and compiled to HTML using chroma, a tool for generating syntax highlights. The rest of the file will be compiled from markdown to HTML.

Input can be sent either on standard input or by specifying a filename at the command line. All outputs are printed to standard output, where they can be redirected to a file:

cat index.md | chroma-markdown > output.html

Why?

You can use this with content management systems that want you to use an HTML editor, like WordPress. There are tools that do Markdown compilation and tools that do syntax highlighting but few that do both.

Requirements

This requires either Commonmark (cmark) or Markdown (markdown) binaries to be present on your $PATH. The Go markdown renderer has a critical error that prevents in-memory Markdown compilation.