mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Added contributor generation function. Applied updates to README docs.
This commit is contained in:
27
README.md
27
README.md
@@ -135,3 +135,30 @@ If this framework helped you in any way, or you would like to support the develo
|
||||
## Binaries
|
||||
|
||||
Binaries will be published once the codebase reaches a stable condition.
|
||||
|
||||
## Contributor List
|
||||
|
||||
|User|Github|Contribution Amount|
|
||||
|--|--|--|
|
||||
| thrasher- | https://api.github.com/users/thrasher- | 411 |
|
||||
| gloriousCode | https://api.github.com/users/gloriousCode | 113 |
|
||||
| shazbert | https://api.github.com/users/shazbert | 108 |
|
||||
| 140am | https://api.github.com/users/140am | 8 |
|
||||
| faddat | https://api.github.com/users/faddat | 4 |
|
||||
| crackcomm | https://api.github.com/users/crackcomm | 3 |
|
||||
| bretep | https://api.github.com/users/bretep | 2 |
|
||||
| gam-phon | https://api.github.com/users/gam-phon | 2 |
|
||||
| cornelk | https://api.github.com/users/cornelk | 2 |
|
||||
| if1live | https://api.github.com/users/if1live | 2 |
|
||||
| daniel-cohen | https://api.github.com/users/daniel-cohen | 1 |
|
||||
| starit | https://api.github.com/users/starit | 1 |
|
||||
| mattkanwisher | https://api.github.com/users/mattkanwisher | 1 |
|
||||
| mKurrels | https://api.github.com/users/mKurrels | 1 |
|
||||
| m1kola | https://api.github.com/users/m1kola | 1 |
|
||||
| tongxiaofeng | https://api.github.com/users/tongxiaofeng | 1 |
|
||||
| idealhack | https://api.github.com/users/idealhack | 1 |
|
||||
| askew- | https://api.github.com/users/askew- | 1 |
|
||||
| snipesjr | https://api.github.com/users/snipesjr | 1 |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ const (
|
||||
toolsPath = "..%s..%stools%s"
|
||||
webPath = "..%s..%sweb%s"
|
||||
rootPath = "..%s..%s"
|
||||
|
||||
contributorsList = "https://api.github.com/repos/thrasher-/gocryptotrader/contributors"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -38,11 +40,18 @@ var (
|
||||
codebaseReadme map[string]readme
|
||||
tmpl *template.Template
|
||||
path string
|
||||
contributors []contributor
|
||||
)
|
||||
|
||||
type readme struct {
|
||||
Name string
|
||||
Contributors string
|
||||
Contributors []contributor
|
||||
}
|
||||
|
||||
type contributor struct {
|
||||
Login string `json:"login"`
|
||||
URL string `json:"url"`
|
||||
Contributions int `json:"contributions"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -63,6 +72,11 @@ func main() {
|
||||
codebaseTemplatePath = make(map[string]string)
|
||||
codebaseReadme = make(map[string]readme)
|
||||
path = common.GetOSPathSlash()
|
||||
|
||||
if err := getContributorList(); err != nil {
|
||||
log.Fatal("GoCryptoTrader: Exchange documentation tool GET error ", err)
|
||||
}
|
||||
|
||||
if err := addTemplates(); err != nil {
|
||||
log.Fatal("GoCryptoTrader: Exchange documentation tool add template error ", err)
|
||||
}
|
||||
@@ -87,7 +101,9 @@ func updateReadme() error {
|
||||
fmt.Printf("* %s Readme file FOUND.\n", packageName)
|
||||
}
|
||||
if replace {
|
||||
fmt.Println("file replacement")
|
||||
if verbose {
|
||||
fmt.Println("file replacement")
|
||||
}
|
||||
if err := replaceReadme(packageName); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -99,7 +115,9 @@ func updateReadme() error {
|
||||
fmt.Printf("* %s Readme file NOT FOUND.\n", packageName)
|
||||
}
|
||||
if replace {
|
||||
log.Println("file creation")
|
||||
if verbose {
|
||||
log.Println("file creation")
|
||||
}
|
||||
if err := createReadme(packageName); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -134,7 +152,7 @@ func addPaths() {
|
||||
func addReadmeData(packageName string) {
|
||||
readmeInfo := readme{
|
||||
Name: packageName,
|
||||
Contributors: "", //future implementation to track contributors
|
||||
Contributors: contributors,
|
||||
}
|
||||
codebaseReadme[packageName] = readmeInfo
|
||||
}
|
||||
@@ -175,10 +193,16 @@ func createReadme(packageName string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("File done")
|
||||
if verbose {
|
||||
fmt.Println("File done")
|
||||
}
|
||||
return tmpl.ExecuteTemplate(file, packageName, codebaseReadme[packageName])
|
||||
}
|
||||
|
||||
func deleteFile(path string) error {
|
||||
return os.Remove(path)
|
||||
}
|
||||
|
||||
func getContributorList() error {
|
||||
return common.SendHTTPGetRequest(contributorsList, true, false, &contributors)
|
||||
}
|
||||
|
||||
@@ -118,4 +118,5 @@ If this framework helped you in any way, or you would like to support the develo
|
||||
## Binaries
|
||||
|
||||
Binaries will be published once the codebase reaches a stable condition.
|
||||
{{template "contributors" .}}
|
||||
{{end}}
|
||||
|
||||
10
tools/documentation/sub_templates/contributors.tmpl
Normal file
10
tools/documentation/sub_templates/contributors.tmpl
Normal file
@@ -0,0 +1,10 @@
|
||||
{{define "contributors"}}
|
||||
## Contributor List
|
||||
|
||||
|User|Github|Contribution Amount|
|
||||
|--|--|--|
|
||||
{{ range $contributor := .Contributors -}}
|
||||
| {{$contributor.Login}} | {{$contributor.URL}} | {{$contributor.Contributions}} |
|
||||
{{ end }}
|
||||
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user