man: vendor github.com/cpuguy83/go-md2man/v2 v2.0.7

full diff: https://github.com/cpuguy83/go-md2man/compare/v2.0.6...v2.0.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-04-26 16:22:46 +02:00
parent 890d48de19
commit 878de14c8d
8 changed files with 39 additions and 16 deletions

View File

@@ -2,6 +2,6 @@ module github.com/docker/docker/man
go 1.19 go 1.19
require github.com/cpuguy83/go-md2man/v2 v2.0.6 require github.com/cpuguy83/go-md2man/v2 v2.0.7
require github.com/russross/blackfriday/v2 v2.1.0 // indirect require github.com/russross/blackfriday/v2 v2.1.0 // indirect

View File

@@ -1,4 +1,4 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

View File

@@ -1,6 +1,20 @@
# For documentation, see https://golangci-lint.run/usage/configuration/ # For documentation, see https://golangci-lint.run/usage/configuration/
linters: version: "2"
formatters:
enable: enable:
- gofumpt - gofumpt
linters:
enable:
- errorlint
- nolintlint
- unconvert
- unparam
settings:
staticcheck:
checks:
- all
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.

View File

@@ -8,7 +8,16 @@ Uses [blackfriday](https://github.com/russross/blackfriday) to process markdown
### Usage ### Usage
```bash ```bash
go install github.com/cpuguy83/go-md2man@latest go install github.com/cpuguy83/go-md2man/v2@latest
go-md2man -in /path/to/markdownfile.md -out /manfile/output/path go-md2man -in /path/to/markdownfile.md -out /manfile/output/path
``` ```
For go 1.24 and above, you can run it with `go tool`:
```bash
go get -tool github.com/cpuguy83/go-md2man/v2@latest
# it will be appended to `tool` directive in go.mod file
go tool go-md2man -in /path/to/markdownfile.md -out /manfile/output/path
```

View File

@@ -26,7 +26,7 @@ func main() {
os.Exit(1) os.Exit(1)
} }
} }
defer inFile.Close() // nolint: errcheck defer inFile.Close() //nolint:errcheck
doc, err := ioutil.ReadAll(inFile) doc, err := ioutil.ReadAll(inFile)
if err != nil { if err != nil {
@@ -43,7 +43,7 @@ func main() {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
defer outFile.Close() // nolint: errcheck defer outFile.Close() //nolint:errcheck
} }
_, err = outFile.Write(out) _, err = outFile.Write(out)
if err != nil { if err != nil {

View File

@@ -1,3 +1,4 @@
// Package md2man aims in converting markdown into roff (man pages).
package md2man package md2man
import ( import (

View File

@@ -47,13 +47,13 @@ const (
tableStart = "\n.TS\nallbox;\n" tableStart = "\n.TS\nallbox;\n"
tableEnd = ".TE\n" tableEnd = ".TE\n"
tableCellStart = "T{\n" tableCellStart = "T{\n"
tableCellEnd = "\nT}\n" tableCellEnd = "\nT}"
tablePreprocessor = `'\" t` tablePreprocessor = `'\" t`
) )
// NewRoffRenderer creates a new blackfriday Renderer for generating roff documents // NewRoffRenderer creates a new blackfriday Renderer for generating roff documents
// from markdown // from markdown
func NewRoffRenderer() *roffRenderer { // nolint: golint func NewRoffRenderer() *roffRenderer {
return &roffRenderer{} return &roffRenderer{}
} }
@@ -316,9 +316,8 @@ func (r *roffRenderer) handleTableCell(w io.Writer, node *blackfriday.Node, ente
} else if nodeLiteralSize(node) > 30 { } else if nodeLiteralSize(node) > 30 {
end = tableCellEnd end = tableCellEnd
} }
if node.Next == nil && end != tableCellEnd { if node.Next == nil {
// Last cell: need to carriage return if we are at the end of the // Last cell: need to carriage return if we are at the end of the header row.
// header row and content isn't wrapped in a "tablecell"
end += crTag end += crTag
} }
out(w, end) out(w, end)
@@ -356,7 +355,7 @@ func countColumns(node *blackfriday.Node) int {
} }
func out(w io.Writer, output string) { func out(w io.Writer, output string) {
io.WriteString(w, output) // nolint: errcheck io.WriteString(w, output) //nolint:errcheck
} }
func escapeSpecialChars(w io.Writer, text []byte) { func escapeSpecialChars(w io.Writer, text []byte) {
@@ -395,7 +394,7 @@ func escapeSpecialCharsLine(w io.Writer, text []byte) {
i++ i++
} }
if i > org { if i > org {
w.Write(text[org:i]) // nolint: errcheck w.Write(text[org:i]) //nolint:errcheck
} }
// escape a character // escape a character
@@ -403,7 +402,7 @@ func escapeSpecialCharsLine(w io.Writer, text []byte) {
break break
} }
w.Write([]byte{'\\', text[i]}) // nolint: errcheck w.Write([]byte{'\\', text[i]}) //nolint:errcheck
} }
} }

View File

@@ -1,4 +1,4 @@
# github.com/cpuguy83/go-md2man/v2 v2.0.6 # github.com/cpuguy83/go-md2man/v2 v2.0.7
## explicit; go 1.12 ## explicit; go 1.12
github.com/cpuguy83/go-md2man/v2 github.com/cpuguy83/go-md2man/v2
github.com/cpuguy83/go-md2man/v2/md2man github.com/cpuguy83/go-md2man/v2/md2man