Applied fix to documentation.go for contribution HTML_URL.

Added period to documentation templates sentences.
Added logic to documentation.go to fix broken links for godoc in sub-packages.
Fix coding style to conform to golang idiomatic practice.
Applied fix to access main godocs in tools and test data.
Generated new documents using tools.
This commit is contained in:
Ryan O'Hara-Reid
2018-02-20 11:56:25 +11:00
parent 51755d214b
commit dd00eba27e
40 changed files with 148 additions and 106 deletions

View File

@@ -6,6 +6,7 @@ import (
"html/template"
"log"
"os"
"strings"
"github.com/thrasher-/gocryptotrader/common"
)
@@ -46,11 +47,12 @@ var (
type readme struct {
Name string
Contributors []contributor
NameURL string
}
type contributor struct {
Login string `json:"login"`
URL string `json:"url"`
URL string `json:"html_url"`
Contributions int `json:"contributions"`
}
@@ -153,10 +155,23 @@ func addReadmeData(packageName string) {
readmeInfo := readme{
Name: packageName,
Contributors: contributors,
NameURL: getslashFromName(packageName),
}
codebaseReadme[packageName] = readmeInfo
}
// returns a string for godoc package names
func getslashFromName(packageName string) string {
if strings.Contains(packageName, " ") {
s := strings.Split(packageName, " ")
return strings.Join(s, "/")
}
if packageName == "testdata" || packageName == "tools" {
return ""
}
return packageName
}
// adds all the template files
func addTemplates() error {
glob, err := template.ParseGlob(fmt.Sprintf("readme_templates%s*", path))