The cmp.markdown library contains DSL functions to generate markdown documents with Clojure. Functions ar provided for standard markdown and Github flavoured markdown extensions.
Include cmp.markdown as a dependency.
Leiningen
[org.soulspace.clj/cmp.markdown "0.4.1"]
Example code to generate markdown
(ns markdown.example
(:require [org.soulspace.cmp.md.markdown-dsl :as md]))
(def md
(md/markdown
(md/h1 "Markdown Example")
(md/p "This is an example of the programmatic generation of markdown files with the cmp.markdown library.")
(md/h2 "Markdown Formats")
(md/p "The cmp.markdown library supports the following markdown formats:\n"
(md/ol (md/link "Markdown" "http://daringfireball.net/projects/markdown/")
(md/link "Github flavoured markdown" "https://help.github.com/articles/github-flavored-markdown")))))
(println md)
Generated markdown
Markdown Example
================
This is an example of the programmatic generation of markdown files with the cmp.markdown library.
Markdown Formats
----------------
The cmp.markdown library supports the following markdown formats:
1. [Markdown](http://daringfireball.net/projects/markdown/)
2. [Github flavoured markdown](https://help.github.com/articles/github-flavored-markdown)
© 2012-2020 Ludger Solbach