File: md2man.go

package info (click to toggle)
go-md2man 1.0.8%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 132 kB
  • sloc: sh: 18; makefile: 10
file content (20 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package md2man

import (
	"github.com/russross/blackfriday"
)

// Render converts a markdown document into a roff formatted document.
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)
}