mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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 <github@gone.nl>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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=
|
||||
|
||||
11
man/vendor/github.com/cpuguy83/go-md2man/v2/README.md
generated
vendored
11
man/vendor/github.com/cpuguy83/go-md2man/v2/README.md
generated
vendored
@@ -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
|
||||
```
|
||||
|
||||
4
man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go
generated
vendored
4
man/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go
generated
vendored
@@ -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)
|
||||
|
||||
11
man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go
generated
vendored
11
man/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
4
man/vendor/modules.txt
vendored
4
man/vendor/modules.txt
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user