2017-08-05 09:08:33 +00:00
|
|
|
package md2man
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/russross/blackfriday"
|
|
|
|
)
|
|
|
|
|
2018-03-30 09:48:16 +00:00
|
|
|
// Render converts a markdown document into a roff formatted document.
|
2017-08-05 09:08:33 +00:00
|
|
|
func Render(doc []byte) []byte {
|
|
|
|
renderer := RoffRenderer(0)
|
|
|
|
extensions := 0
|
|
|
|
extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS
|
|
|
|
extensions |= blackfriday.EXTENSION_TABLES
|
|
|
|
extensions |= blackfriday.EXTENSION_FENCED_CODE
|
|
|
|
extensions |= blackfriday.EXTENSION_AUTOLINK
|
|
|
|
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
|
|
|
|
extensions |= blackfriday.EXTENSION_FOOTNOTES
|
|
|
|
extensions |= blackfriday.EXTENSION_TITLEBLOCK
|
|
|
|
|
|
|
|
return blackfriday.Markdown(doc, renderer, extensions)
|
|
|
|
}
|