mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 15:10:37 +00:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user