mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
vendor: github.com/docker/cli-docs-tool v0.7.0
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> (cherry picked from commit ce66d8830da8750d27ab4016d499368f77dbd7ac) Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
d43cf8c2c6
commit
b3e7827871
2
go.mod
2
go.mod
@ -14,7 +14,7 @@ require (
|
|||||||
github.com/creack/pty v1.1.18
|
github.com/creack/pty v1.1.18
|
||||||
github.com/distribution/reference v0.5.0
|
github.com/distribution/reference v0.5.0
|
||||||
github.com/docker/cli v24.0.5+incompatible
|
github.com/docker/cli v24.0.5+incompatible
|
||||||
github.com/docker/cli-docs-tool v0.6.0
|
github.com/docker/cli-docs-tool v0.7.0
|
||||||
github.com/docker/docker v24.0.5+incompatible
|
github.com/docker/docker v24.0.5+incompatible
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
github.com/gofrs/flock v0.8.1
|
github.com/gofrs/flock v0.8.1
|
||||||
|
4
go.sum
4
go.sum
@ -155,8 +155,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK
|
|||||||
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||||
github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc=
|
github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc=
|
||||||
github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA=
|
github.com/docker/cli-docs-tool v0.7.0 h1:M2Da98Unz2kz3A5d4yeSGbhyOge2mfYSNjAFt01Rw0M=
|
||||||
github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
github.com/docker/cli-docs-tool v0.7.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||||
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
|
4
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
4
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
@ -241,7 +241,7 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
|||||||
name += mdMakeLink("`--"+f.Name+"`", f.Name, f, isLink)
|
name += mdMakeLink("`--"+f.Name+"`", f.Name, f, isLink)
|
||||||
|
|
||||||
var ftype string
|
var ftype string
|
||||||
if f.Value.Type() != "bool" {
|
if f.Value.Type() != "bool" || (f.Value.Type() == "bool" && f.DefValue == "true") {
|
||||||
ftype = "`" + f.Value.Type() + "`"
|
ftype = "`" + f.Value.Type() + "`"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
|||||||
} else if cd, ok := cmd.Annotations[annotation.CodeDelimiter]; ok {
|
} else if cd, ok := cmd.Annotations[annotation.CodeDelimiter]; ok {
|
||||||
defval = strings.ReplaceAll(defval, cd, "`")
|
defval = strings.ReplaceAll(defval, cd, "`")
|
||||||
}
|
}
|
||||||
} else if f.DefValue != "" && (f.Value.Type() != "bool" && f.DefValue != "true") && f.DefValue != "[]" {
|
} else if f.DefValue != "" && ((f.Value.Type() != "bool" && f.DefValue != "true") || (f.Value.Type() == "bool" && f.DefValue == "true")) && f.DefValue != "[]" {
|
||||||
defval = "`" + f.DefValue + "`"
|
defval = "`" + f.DefValue + "`"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
vendor/github.com/docker/cli-docs-tool/markdown.go
generated
vendored
13
vendor/github.com/docker/cli-docs-tool/markdown.go
generated
vendored
@ -29,6 +29,9 @@ var (
|
|||||||
// for our use-case; DO NOT consider using this as a generic regex, or at least
|
// for our use-case; DO NOT consider using this as a generic regex, or at least
|
||||||
// not before reading https://stackoverflow.com/a/1732454/1811501.
|
// not before reading https://stackoverflow.com/a/1732454/1811501.
|
||||||
htmlAnchor = regexp.MustCompile(`<a\s+(?:name|id)="?([^"]+)"?\s*></a>\s*`)
|
htmlAnchor = regexp.MustCompile(`<a\s+(?:name|id)="?([^"]+)"?\s*></a>\s*`)
|
||||||
|
// relativeLink matches parts of internal links between .md documents
|
||||||
|
// e.g. "](buildx_build.md)"
|
||||||
|
relativeLink = regexp.MustCompile(`\]\((\.\/)?[a-z-_]+\.md(#.*)?\)`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// getSections returns all H2 sections by title (lowercase)
|
// getSections returns all H2 sections by title (lowercase)
|
||||||
@ -58,6 +61,16 @@ func cleanupMarkDown(mdString string) (md string, anchors []string) {
|
|||||||
mdString = strings.ReplaceAll(mdString, "\t", " ")
|
mdString = strings.ReplaceAll(mdString, "\t", " ")
|
||||||
mdString = strings.ReplaceAll(mdString, "https://docs.docker.com", "")
|
mdString = strings.ReplaceAll(mdString, "https://docs.docker.com", "")
|
||||||
|
|
||||||
|
// Rewrite internal links, replacing relative paths with absolute path
|
||||||
|
// e.g. from [docker buildx build](buildx_build.md#build-arg)
|
||||||
|
// to [docker buildx build](/reference/cli/docker/buildx/build/#build-arg)
|
||||||
|
mdString = relativeLink.ReplaceAllStringFunc(mdString, func(link string) string {
|
||||||
|
link = strings.TrimLeft(link, "](./")
|
||||||
|
link = strings.ReplaceAll(link, "_", "/")
|
||||||
|
link = strings.ReplaceAll(link, ".md", "/")
|
||||||
|
return "](/reference/cli/docker/" + link
|
||||||
|
})
|
||||||
|
|
||||||
var id string
|
var id string
|
||||||
// replace trailing whitespace per line, and handle custom anchors
|
// replace trailing whitespace per line, and handle custom anchors
|
||||||
lines := strings.Split(mdString, "\n")
|
lines := strings.Split(mdString, "\n")
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -224,7 +224,7 @@ github.com/docker/cli/cli/streams
|
|||||||
github.com/docker/cli/cli/trust
|
github.com/docker/cli/cli/trust
|
||||||
github.com/docker/cli/cli/version
|
github.com/docker/cli/cli/version
|
||||||
github.com/docker/cli/opts
|
github.com/docker/cli/opts
|
||||||
# github.com/docker/cli-docs-tool v0.6.0
|
# github.com/docker/cli-docs-tool v0.7.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/docker/cli-docs-tool
|
github.com/docker/cli-docs-tool
|
||||||
github.com/docker/cli-docs-tool/annotation
|
github.com/docker/cli-docs-tool/annotation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user