Skip to content

Commit

Permalink
Fix attribution link and name for tools
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjones committed Oct 14, 2018
1 parent 4cdcff8 commit a797334
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# main
# goreadme
[![GoDoc](https://godoc.org/github.com/dmjones/goreadme?status.svg)](https://godoc.org/github.com/dmjones/goreadme)


Expand Down Expand Up @@ -56,4 +56,4 @@ This tool leans heavily on the godoc->markdown work by Dave Cheney.



<sub>*generated with [go2readme](https://github.com/dmjones/go2readme)*</sub>
<sub>*generated with [goreadme](https://github.com/dmjones/goreadme)*</sub>
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"io/ioutil"
"log"
"os"
"path"
"text/template"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -123,7 +124,14 @@ func getPackageDocs() (docs, name, importPath string, err error) {
docPkg := doc.New(pkgs[buildPkg.Name], buildPkg.ImportPath, 0)

docs = docPkg.Doc
name = buildPkg.Name

if buildPkg.Name == "main" {
// In 99% of cases, this is a tool. We want the name of the containing
// directory instead.
name = path.Base(buildPkg.ImportPath)
} else {
name = buildPkg.Name
}
importPath = buildPkg.ImportPath
return
}
Expand Down
2 changes: 1 addition & 1 deletion template.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ var pkgtemplate = `# {{.PackageName}}
{{.ExtraMarkdown}}
{{end}}
{{if .Config.ShowGeneratedSuffix}}
<sub>*generated with [go2readme](https://github.com/dmjones/go2readme)*</sub>
<sub>*generated with [goreadme](https://github.com/dmjones/goreadme)*</sub>
{{end}}`

0 comments on commit a797334

Please sign in to comment.