vendor: update all dependencies to latest versions
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
FROM golang:1.8 AS build
|
||||
COPY . /go/src/github.com/cpuguy83/go-md2man
|
||||
WORKDIR /go/src/github.com/cpuguy83/go-md2man
|
||||
RUN CGO_ENABLED=0 go build
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/go-md2man /go-md2man
|
||||
ENTRYPOINT ["/go-md2man"]
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/russross/blackfriday"
|
||||
packages = ["."]
|
||||
revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c"
|
||||
version = "v1.5"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "d4fdd599038b13752bbcaf722cac55d8e6d81b6fd60bb325df3e31d71aaf358c"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
# Gopkg.toml example
|
||||
#
|
||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
||||
# for detailed Gopkg.toml documentation.
|
||||
#
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project"
|
||||
# version = "1.0.0"
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project2"
|
||||
# branch = "dev"
|
||||
# source = "github.com/myfork/project2"
|
||||
#
|
||||
# [[override]]
|
||||
# name = "github.com/x/y"
|
||||
# version = "2.4.0"
|
||||
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/russross/blackfriday"
|
||||
version = "1.4"
|
||||
+27
-8
@@ -118,11 +118,24 @@ func (r *roffRenderer) Paragraph(out *bytes.Buffer, text func() bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This might now work
|
||||
func (r *roffRenderer) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) {
|
||||
out.WriteString(".TS\nallbox;\n")
|
||||
out.WriteString("\n.TS\nallbox;\n")
|
||||
|
||||
max_delims := 0
|
||||
lines := strings.Split(strings.TrimRight(string(header), "\n")+"\n"+strings.TrimRight(string(body), "\n"), "\n")
|
||||
for _, w := range lines {
|
||||
cur_delims := strings.Count(w, "\t")
|
||||
if cur_delims > max_delims {
|
||||
max_delims = cur_delims
|
||||
}
|
||||
}
|
||||
out.Write([]byte(strings.Repeat("l ", max_delims+1) + "\n"))
|
||||
out.Write([]byte(strings.Repeat("l ", max_delims+1) + ".\n"))
|
||||
out.Write(header)
|
||||
if len(header) > 0 {
|
||||
out.Write([]byte("\n"))
|
||||
}
|
||||
|
||||
out.Write(body)
|
||||
out.WriteString("\n.TE\n")
|
||||
}
|
||||
@@ -132,24 +145,30 @@ func (r *roffRenderer) TableRow(out *bytes.Buffer, text []byte) {
|
||||
out.WriteString("\n")
|
||||
}
|
||||
out.Write(text)
|
||||
out.WriteString("\n")
|
||||
}
|
||||
|
||||
func (r *roffRenderer) TableHeaderCell(out *bytes.Buffer, text []byte, align int) {
|
||||
if out.Len() > 0 {
|
||||
out.WriteString(" ")
|
||||
out.WriteString("\t")
|
||||
}
|
||||
out.Write(text)
|
||||
out.WriteString(" ")
|
||||
if len(text) == 0 {
|
||||
text = []byte{' '}
|
||||
}
|
||||
out.Write([]byte("\\fB\\fC" + string(text) + "\\fR"))
|
||||
}
|
||||
|
||||
// TODO: This is probably broken
|
||||
func (r *roffRenderer) TableCell(out *bytes.Buffer, text []byte, align int) {
|
||||
if out.Len() > 0 {
|
||||
out.WriteString("\t")
|
||||
}
|
||||
if len(text) > 30 {
|
||||
text = append([]byte("T{\n"), text...)
|
||||
text = append(text, []byte("\nT}")...)
|
||||
}
|
||||
if len(text) == 0 {
|
||||
text = []byte{' '}
|
||||
}
|
||||
out.Write(text)
|
||||
out.WriteString("\t")
|
||||
}
|
||||
|
||||
func (r *roffRenderer) Footnotes(out *bytes.Buffer, text func() bool) {
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package md2man
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBlockCode(t *testing.T) {
|
||||
r := &roffRenderer{}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
code := []byte("$ echo hello world\nhello world\n")
|
||||
r.BlockCode(buf, code, "")
|
||||
|
||||
expected := `
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
$ echo hello world
|
||||
hello world
|
||||
|
||||
.fi
|
||||
.RE
|
||||
`
|
||||
result := buf.String()
|
||||
if expected != result {
|
||||
t.Fatalf("got incorrect output:\nexpected:\n%v\n\ngot:\n%v", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTableCell(t *testing.T) {
|
||||
r := &roffRenderer{}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
cell := []byte{}
|
||||
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected := " "
|
||||
if buf.String() != expected {
|
||||
t.Fatal("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t "
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("*")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t*"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("this is a test with some really long string")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\tT{\nthis is a test with some really long string\nT}"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("some short string")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\tsome short string"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte{}
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t "
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("*")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t*"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
vendors:
|
||||
- path: github.com/russross/blackfriday
|
||||
rev: 93622da34e54fb6529bfb7c57e710f37a8d9cbd8
|
||||
- path: github.com/shurcooL/sanitized_anchor_name
|
||||
rev: 10ef21a441db47d8b13ebcc5fd2310f636973c77
|
||||
Reference in New Issue
Block a user