mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.27.6 to 2.27.7. - [Release notes](https://github.com/urfave/cli/releases) - [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/urfave/cli/compare/v2.27.6...v2.27.7) --- updated-dependencies: - dependency-name: github.com/urfave/cli/v2 dependency-version: 2.27.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
25 lines
580 B
Go
25 lines
580 B
Go
// Package md2man aims in converting markdown into roff (man pages).
|
|
package md2man
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
|
|
"github.com/russross/blackfriday/v2"
|
|
)
|
|
|
|
// Render converts a markdown document into a roff formatted document.
|
|
func Render(doc []byte) []byte {
|
|
renderer := NewRoffRenderer()
|
|
var r blackfriday.Renderer = renderer
|
|
if v, _ := strconv.ParseBool(os.Getenv("MD2MAN_DEBUG")); v {
|
|
r = &debugDecorator{Renderer: r}
|
|
}
|
|
|
|
return blackfriday.Run(doc,
|
|
[]blackfriday.Option{
|
|
blackfriday.WithRenderer(r),
|
|
blackfriday.WithExtensions(renderer.GetExtensions()),
|
|
}...)
|
|
}
|