From 4e6535fd3ef19814098a833e29e95473e4690b08 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 26 Jan 2025 21:40:10 +0100 Subject: [PATCH] man: vendor github.com/cpuguy83/go-md2man/v2 v2.0.6 full diff: https://github.com/cpuguy83/go-md2man/compare/v2.0.5...v2.0.6 Signed-off-by: Sebastiaan van Stijn --- man/go.mod | 2 +- man/go.sum | 4 ++-- man/vendor/github.com/cpuguy83/go-md2man/v2/README.md | 11 +++++------ man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go | 4 ++-- .../github.com/cpuguy83/go-md2man/v2/md2man/roff.go | 11 ++++++++++- man/vendor/modules.txt | 4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/man/go.mod b/man/go.mod index 9f0db0cfb3..f6d5833886 100644 --- a/man/go.mod +++ b/man/go.mod @@ -2,6 +2,6 @@ module github.com/docker/docker/man go 1.19 -require github.com/cpuguy83/go-md2man/v2 v2.0.5 +require github.com/cpuguy83/go-md2man/v2 v2.0.6 require github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/man/go.sum b/man/go.sum index f6d48cc3b4..7553224e35 100644 --- a/man/go.sum +++ b/man/go.sum @@ -1,4 +1,4 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= -github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 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= diff --git a/man/vendor/github.com/cpuguy83/go-md2man/v2/README.md b/man/vendor/github.com/cpuguy83/go-md2man/v2/README.md index 0e30d34148..dedc16d0c6 100644 --- a/man/vendor/github.com/cpuguy83/go-md2man/v2/README.md +++ b/man/vendor/github.com/cpuguy83/go-md2man/v2/README.md @@ -3,13 +3,12 @@ go-md2man Converts markdown into roff (man pages). -Uses blackfriday to process markdown into man pages. +Uses [blackfriday](https://github.com/russross/blackfriday) to process markdown into man pages. ### Usage -./md2man -in /path/to/markdownfile.md -out /manfile/output/path +```bash +go install github.com/cpuguy83/go-md2man@latest -### How to contribute - -We use go modules to manage dependencies. -As such you must be using at lest go1.11. +go-md2man -in /path/to/markdownfile.md -out /manfile/output/path +``` diff --git a/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go b/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go index 4ea49f3734..4ff873b8e7 100644 --- a/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go +++ b/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go @@ -3,7 +3,7 @@ package main import ( "flag" "fmt" - "io" + "io/ioutil" "os" "github.com/cpuguy83/go-md2man/v2/md2man" @@ -28,7 +28,7 @@ func main() { } defer inFile.Close() // nolint: errcheck - doc, err := io.ReadAll(inFile) + doc, err := ioutil.ReadAll(inFile) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index 9d6c473fdc..96a80c99b8 100644 --- a/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -104,7 +104,7 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering node.Parent.Prev.Type == blackfriday.Heading && node.Parent.Prev.FirstChild != nil && bytes.EqualFold(node.Parent.Prev.FirstChild.Literal, []byte("NAME")) { - before, after, found := bytes.Cut(node.Literal, []byte(" - ")) + before, after, found := bytesCut(node.Literal, []byte(" - ")) escapeSpecialChars(w, before) if found { out(w, ` \- `) @@ -406,3 +406,12 @@ func escapeSpecialCharsLine(w io.Writer, text []byte) { w.Write([]byte{'\\', text[i]}) // nolint: errcheck } } + +// bytesCut is a copy of [bytes.Cut] to provide compatibility with go1.17 +// and older. We can remove this once we drop support for go1.17 and older. +func bytesCut(s, sep []byte) (before, after []byte, found bool) { + if i := bytes.Index(s, sep); i >= 0 { + return s[:i], s[i+len(sep):], true + } + return s, nil, false +} diff --git a/man/vendor/modules.txt b/man/vendor/modules.txt index 3f8719e951..e3bdbf1f07 100644 --- a/man/vendor/modules.txt +++ b/man/vendor/modules.txt @@ -1,5 +1,5 @@ -# github.com/cpuguy83/go-md2man/v2 v2.0.5 -## explicit; go 1.11 +# github.com/cpuguy83/go-md2man/v2 v2.0.6 +## explicit; go 1.12 github.com/cpuguy83/go-md2man/v2 github.com/cpuguy83/go-md2man/v2/md2man # github.com/russross/blackfriday/v2 v2.1.0