From bb2342ee99b9d88e5e0f408fae0f71a2fe572a81 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Wed, 28 Feb 2018 09:53:41 +1100 Subject: [PATCH] Added new functionality for documentation tool. Added new documents to list to track the entire project document range. --- tools/documentation/documentation.go | 122 +++++++++++++++++- .../exchange_readme_templates/alphapoint.tmpl | 12 ++ .../exchange_readme_templates/anx.tmpl | 12 ++ .../exchange_readme_templates/binance.tmpl | 12 ++ .../exchange_readme_templates/bitfinex.tmpl | 12 ++ .../exchange_readme_templates/bitflyer.tmpl | 12 ++ .../exchange_readme_templates/bithumb.tmpl | 12 ++ .../exchange_readme_templates/bitstamp.tmpl | 12 ++ .../exchange_readme_templates/bittrex.tmpl | 12 ++ .../exchange_readme_templates/btcc.tmpl | 12 ++ .../exchange_readme_templates/btcmarkets.tmpl | 12 ++ .../exchange_readme_templates/coinut.tmpl | 12 ++ .../exchange_readme_templates/exmo.tmpl | 12 ++ .../exchange_readme_templates/gdax.tmpl | 12 ++ .../exchange_readme_templates/gemini.tmpl | 12 ++ .../exchange_readme_templates/hitbtc.tmpl | 12 ++ .../exchange_readme_templates/huobi.tmpl | 12 ++ .../exchange_readme_templates/itbit.tmpl | 12 ++ .../exchange_readme_templates/kraken.tmpl | 12 ++ .../exchange_readme_templates/lakebtc.tmpl | 12 ++ .../exchange_readme_templates/liqui.tmpl | 12 ++ .../localbitcoins.tmpl | 12 ++ .../exchange_readme_templates/okcoin.tmpl | 12 ++ .../exchange_readme_templates/okex.tmpl | 12 ++ .../exchange_readme_templates/poloniex.tmpl | 12 ++ .../exchange_readme_templates/wex.tmpl | 12 ++ .../exchange_readme_templates/yobit.tmpl | 12 ++ .../general_templates/CONTRIBUTORS | 6 + tools/documentation/general_templates/LICENSE | 23 ++++ .../sub_templates/contributors.tmpl | 2 + tools/documentation/sub_templates/header.tmpl | 2 +- 31 files changed, 464 insertions(+), 3 deletions(-) create mode 100644 tools/documentation/exchange_readme_templates/alphapoint.tmpl create mode 100644 tools/documentation/exchange_readme_templates/anx.tmpl create mode 100644 tools/documentation/exchange_readme_templates/binance.tmpl create mode 100644 tools/documentation/exchange_readme_templates/bitfinex.tmpl create mode 100644 tools/documentation/exchange_readme_templates/bitflyer.tmpl create mode 100644 tools/documentation/exchange_readme_templates/bithumb.tmpl create mode 100644 tools/documentation/exchange_readme_templates/bitstamp.tmpl create mode 100644 tools/documentation/exchange_readme_templates/bittrex.tmpl create mode 100644 tools/documentation/exchange_readme_templates/btcc.tmpl create mode 100644 tools/documentation/exchange_readme_templates/btcmarkets.tmpl create mode 100644 tools/documentation/exchange_readme_templates/coinut.tmpl create mode 100644 tools/documentation/exchange_readme_templates/exmo.tmpl create mode 100644 tools/documentation/exchange_readme_templates/gdax.tmpl create mode 100644 tools/documentation/exchange_readme_templates/gemini.tmpl create mode 100644 tools/documentation/exchange_readme_templates/hitbtc.tmpl create mode 100644 tools/documentation/exchange_readme_templates/huobi.tmpl create mode 100644 tools/documentation/exchange_readme_templates/itbit.tmpl create mode 100644 tools/documentation/exchange_readme_templates/kraken.tmpl create mode 100644 tools/documentation/exchange_readme_templates/lakebtc.tmpl create mode 100644 tools/documentation/exchange_readme_templates/liqui.tmpl create mode 100644 tools/documentation/exchange_readme_templates/localbitcoins.tmpl create mode 100644 tools/documentation/exchange_readme_templates/okcoin.tmpl create mode 100644 tools/documentation/exchange_readme_templates/okex.tmpl create mode 100644 tools/documentation/exchange_readme_templates/poloniex.tmpl create mode 100644 tools/documentation/exchange_readme_templates/wex.tmpl create mode 100644 tools/documentation/exchange_readme_templates/yobit.tmpl create mode 100644 tools/documentation/general_templates/CONTRIBUTORS create mode 100644 tools/documentation/general_templates/LICENSE diff --git a/tools/documentation/documentation.go b/tools/documentation/documentation.go index 449af062..b395d1ed 100644 --- a/tools/documentation/documentation.go +++ b/tools/documentation/documentation.go @@ -7,6 +7,7 @@ import ( "log" "os" "strings" + "time" "github.com/thrasher-/gocryptotrader/common" ) @@ -31,7 +32,38 @@ const ( webPath = "..%s..%sweb%s" rootPath = "..%s..%s" + // exchange packages + alphapoint = "..%s..%sexchanges%salphapoint%s" + anx = "..%s..%sexchanges%sanx%s" + binance = "..%s..%sexchanges%sbinance%s" + bitfinex = "..%s..%sexchanges%sbitfinex%s" + bitflyer = "..%s..%sexchanges%sbitflyer%s" + bithumb = "..%s..%sexchanges%sbithumb%s" + bitstamp = "..%s..%sexchanges%sbitstamp%s" + bittrex = "..%s..%sexchanges%sbittrex%s" + btcc = "..%s..%sexchanges%sbtcc%s" + btcmarkets = "..%s..%sexchanges%sbtcmarkets%s" + coinut = "..%s..%sexchanges%scoinut%s" + exmo = "..%s..%sexchanges%sexmo%s" + gdax = "..%s..%sexchanges%sgdax%s" + gemini = "..%s..%sexchanges%sgemini%s" + hitbtc = "..%s..%sexchanges%shitbtc%s" + huobi = "..%s..%sexchanges%shuobi%s" + itbit = "..%s..%sexchanges%sitbit%s" + kraken = "..%s..%sexchanges%skraken%s" + lakebtc = "..%s..%sexchanges%slakebtc%s" + localbitcoins = "..%s..%sexchanges%slocalbitcoins%s" + okcoin = "..%s..%sexchanges%sokcoin%s" + okex = "..%s..%sexchanges%sokex%s" + poloniex = "..%s..%sexchanges%spoloniex%s" + wex = "..%s..%sexchanges%swex%s" + yobit = "..%s..%sexchanges%syobit%s" + liqui = "..%s..%sexchanges%sliqui%s" + contributorsList = "https://api.github.com/repos/thrasher-/gocryptotrader/contributors" + + licenseName = "LICENSE" + contributorName = "CONTRIBUTORS" ) var ( @@ -42,12 +74,16 @@ var ( tmpl *template.Template path string contributors []contributor + // exchanges []string{"alphapoint", "anx", "binance", "bitfinex", "bitflyer", + // "bithumb"} ) type readme struct { Name string Contributors []contributor NameURL string + Year int + CapitalName string } type contributor struct { @@ -149,24 +185,77 @@ func addPaths() { codebasePaths["tools"] = fmt.Sprintf(toolsPath, path, path, path) codebasePaths["web"] = fmt.Sprintf(webPath, path, path, path) codebasePaths["root"] = fmt.Sprintf(rootPath, path, path) + + codebasePaths["exchanges alphapoint"] = fmt.Sprintf(alphapoint, path, path, path, path) + codebasePaths["exchanges anx"] = fmt.Sprintf(anx, path, path, path, path) + codebasePaths["exchanges binance"] = fmt.Sprintf(binance, path, path, path, path) + codebasePaths["exchanges bitfinex"] = fmt.Sprintf(bitfinex, path, path, path, path) + codebasePaths["exchanges bitflyer"] = fmt.Sprintf(bitflyer, path, path, path, path) + codebasePaths["exchanges bithumb"] = fmt.Sprintf(bithumb, path, path, path, path) + codebasePaths["exchanges bitstamp"] = fmt.Sprintf(bitstamp, path, path, path, path) + codebasePaths["exchanges bittrex"] = fmt.Sprintf(bittrex, path, path, path, path) + codebasePaths["exchanges btcc"] = fmt.Sprintf(btcc, path, path, path, path) + codebasePaths["exchanges btcmarkets"] = fmt.Sprintf(btcmarkets, path, path, path, path) + codebasePaths["exchanges coinut"] = fmt.Sprintf(coinut, path, path, path, path) + codebasePaths["exchanges exmo"] = fmt.Sprintf(exmo, path, path, path, path) + codebasePaths["exchanges gdax"] = fmt.Sprintf(gdax, path, path, path, path) + codebasePaths["exchanges gemini"] = fmt.Sprintf(gemini, path, path, path, path) + codebasePaths["exchanges hitbtc"] = fmt.Sprintf(hitbtc, path, path, path, path) + codebasePaths["exchanges huobi"] = fmt.Sprintf(huobi, path, path, path, path) + codebasePaths["exchanges itbit"] = fmt.Sprintf(itbit, path, path, path, path) + codebasePaths["exchanges kraken"] = fmt.Sprintf(kraken, path, path, path, path) + codebasePaths["exchanges lakebtc"] = fmt.Sprintf(lakebtc, path, path, path, path) + codebasePaths["exchanges liqui"] = fmt.Sprintf(liqui, path, path, path, path) + codebasePaths["exchanges localbitcoins"] = fmt.Sprintf(localbitcoins, path, path, path, path) + codebasePaths["exchanges okcoin"] = fmt.Sprintf(okcoin, path, path, path, path) + codebasePaths["exchanges okex"] = fmt.Sprintf(okex, path, path, path, path) + codebasePaths["exchanges poloniex"] = fmt.Sprintf(poloniex, path, path, path, path) + codebasePaths["exchanges wex"] = fmt.Sprintf(wex, path, path, path, path) + codebasePaths["exchanges yobit"] = fmt.Sprintf(yobit, path, path, path, path) + + codebasePaths["CONTRIBUTORS"] = fmt.Sprintf(rootPath, path, path) + codebasePaths["LICENSE"] = fmt.Sprintf(rootPath, path, path) } func addReadmeData(packageName string) { readmeInfo := readme{ - Name: packageName, + Name: getName(packageName, false), Contributors: contributors, NameURL: getslashFromName(packageName), + Year: time.Now().Year(), + CapitalName: getName(packageName, true), } codebaseReadme[packageName] = readmeInfo } +func getName(name string, capital bool) string { + newStrings := strings.Split(name, " ") + if len(newStrings) > 1 { + if capital { + return getCapital(newStrings[1]) + } + return newStrings[1] + } + if capital { + return getCapital(name) + } + return name +} + +func getCapital(name string) string { + cap := strings.ToUpper(string(name[0])) + last := name[1:] + + return cap + last +} + // 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" { + if packageName == "testdata" || packageName == "tools" || packageName == contributorName || packageName == licenseName { return "" } return packageName @@ -182,6 +271,14 @@ func addTemplates() error { if err != nil { return err } + _, err = glob.ParseGlob(fmt.Sprintf("exchange_readme_templates%s*", path)) + if err != nil { + return err + } + _, err = glob.ParseGlob(fmt.Sprintf("general_templates%s*", path)) + if err != nil { + return err + } tmpl = glob return nil @@ -189,12 +286,22 @@ func addTemplates() error { // checkReadme checks to see if the file exists func checkReadme(packageName string) bool { + if packageName == licenseName || packageName == contributorName { + _, err := os.Stat(codebasePaths[packageName] + packageName) + return os.IsNotExist(err) + } _, err := os.Stat(codebasePaths[packageName] + "README.md") return os.IsNotExist(err) } // replaces readme file func replaceReadme(packageName string) error { + if packageName == licenseName || packageName == contributorName { + if err := deleteFile(codebasePaths[packageName] + packageName); err != nil { + return err + } + return createReadme(packageName) + } if err := deleteFile(codebasePaths[packageName] + "README.md"); err != nil { return err } @@ -203,6 +310,17 @@ func replaceReadme(packageName string) error { // creates new readme file and executes template func createReadme(packageName string) error { + if packageName == licenseName || packageName == contributorName { + file, err := os.Create(codebasePaths[packageName] + packageName) + defer file.Close() + if err != nil { + return err + } + if verbose { + fmt.Println("File done") + } + return tmpl.ExecuteTemplate(file, packageName, codebaseReadme[packageName]) + } file, err := os.Create(codebasePaths[packageName] + "README.md") defer file.Close() if err != nil { diff --git a/tools/documentation/exchange_readme_templates/alphapoint.tmpl b/tools/documentation/exchange_readme_templates/alphapoint.tmpl new file mode 100644 index 00000000..1dcefc88 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/alphapoint.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges alphapoint" -}} +{{template "header" .}} +## Alphapoint Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/anx.tmpl b/tools/documentation/exchange_readme_templates/anx.tmpl new file mode 100644 index 00000000..464ea7c8 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/anx.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges anx" -}} +{{template "header" .}} +## ANX Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/binance.tmpl b/tools/documentation/exchange_readme_templates/binance.tmpl new file mode 100644 index 00000000..f3b832c7 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/binance.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges binance" -}} +{{template "header" .}} +## Binance Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/bitfinex.tmpl b/tools/documentation/exchange_readme_templates/bitfinex.tmpl new file mode 100644 index 00000000..df6a92f9 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/bitfinex.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges bitfinex" -}} +{{template "header" .}} +## Bitfinex Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/bitflyer.tmpl b/tools/documentation/exchange_readme_templates/bitflyer.tmpl new file mode 100644 index 00000000..3c16331c --- /dev/null +++ b/tools/documentation/exchange_readme_templates/bitflyer.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges bitflyer" -}} +{{template "header" .}} +## Bitflyer Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/bithumb.tmpl b/tools/documentation/exchange_readme_templates/bithumb.tmpl new file mode 100644 index 00000000..f3c637b7 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/bithumb.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges bithumb" -}} +{{template "header" .}} +## Bithumb Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/bitstamp.tmpl b/tools/documentation/exchange_readme_templates/bitstamp.tmpl new file mode 100644 index 00000000..86c88652 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/bitstamp.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges bitstamp" -}} +{{template "header" .}} +## Bitstamp Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/bittrex.tmpl b/tools/documentation/exchange_readme_templates/bittrex.tmpl new file mode 100644 index 00000000..b84c8f92 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/bittrex.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges bittrex" -}} +{{template "header" .}} +## Bittrex Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/btcc.tmpl b/tools/documentation/exchange_readme_templates/btcc.tmpl new file mode 100644 index 00000000..51da03a2 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/btcc.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges btcc" -}} +{{template "header" .}} +## BTCC Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/btcmarkets.tmpl b/tools/documentation/exchange_readme_templates/btcmarkets.tmpl new file mode 100644 index 00000000..9c5310a2 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/btcmarkets.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges btcmarkets" -}} +{{template "header" .}} +## BTCMarkets Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/coinut.tmpl b/tools/documentation/exchange_readme_templates/coinut.tmpl new file mode 100644 index 00000000..21eda7ad --- /dev/null +++ b/tools/documentation/exchange_readme_templates/coinut.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges coinut" -}} +{{template "header" .}} +## Coinut Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/exmo.tmpl b/tools/documentation/exchange_readme_templates/exmo.tmpl new file mode 100644 index 00000000..79b09dc8 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/exmo.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges exmo" -}} +{{template "header" .}} +## Exmo Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/gdax.tmpl b/tools/documentation/exchange_readme_templates/gdax.tmpl new file mode 100644 index 00000000..a25173e0 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/gdax.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges gdax" -}} +{{template "header" .}} +## GDAX Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/gemini.tmpl b/tools/documentation/exchange_readme_templates/gemini.tmpl new file mode 100644 index 00000000..e2e642f8 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/gemini.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges gemini" -}} +{{template "header" .}} +## Gemini Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/hitbtc.tmpl b/tools/documentation/exchange_readme_templates/hitbtc.tmpl new file mode 100644 index 00000000..63f14ade --- /dev/null +++ b/tools/documentation/exchange_readme_templates/hitbtc.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges hitbtc" -}} +{{template "header" .}} +## HitBTC Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/huobi.tmpl b/tools/documentation/exchange_readme_templates/huobi.tmpl new file mode 100644 index 00000000..f05d10a4 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/huobi.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges huobi" -}} +{{template "header" .}} +## Huobi Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/itbit.tmpl b/tools/documentation/exchange_readme_templates/itbit.tmpl new file mode 100644 index 00000000..b4516424 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/itbit.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges itbit" -}} +{{template "header" .}} +## Itbit Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/kraken.tmpl b/tools/documentation/exchange_readme_templates/kraken.tmpl new file mode 100644 index 00000000..4975e68a --- /dev/null +++ b/tools/documentation/exchange_readme_templates/kraken.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges kraken" -}} +{{template "header" .}} +## Kraken Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/lakebtc.tmpl b/tools/documentation/exchange_readme_templates/lakebtc.tmpl new file mode 100644 index 00000000..f5f225e0 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/lakebtc.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges lakebtc" -}} +{{template "header" .}} +## LakeBTC Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/liqui.tmpl b/tools/documentation/exchange_readme_templates/liqui.tmpl new file mode 100644 index 00000000..0f768994 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/liqui.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges liqui" -}} +{{template "header" .}} +## Liqui Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/localbitcoins.tmpl b/tools/documentation/exchange_readme_templates/localbitcoins.tmpl new file mode 100644 index 00000000..a88265d9 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/localbitcoins.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges localbitcoins" -}} +{{template "header" .}} +## LocalBitcoins Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/okcoin.tmpl b/tools/documentation/exchange_readme_templates/okcoin.tmpl new file mode 100644 index 00000000..c732f595 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/okcoin.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges okcoin" -}} +{{template "header" .}} +## OKCoin Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/okex.tmpl b/tools/documentation/exchange_readme_templates/okex.tmpl new file mode 100644 index 00000000..bc0d482e --- /dev/null +++ b/tools/documentation/exchange_readme_templates/okex.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges okex" -}} +{{template "header" .}} +## OKex Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/poloniex.tmpl b/tools/documentation/exchange_readme_templates/poloniex.tmpl new file mode 100644 index 00000000..30bd1a08 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/poloniex.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges poloniex" -}} +{{template "header" .}} +## Poloniex Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/wex.tmpl b/tools/documentation/exchange_readme_templates/wex.tmpl new file mode 100644 index 00000000..a4637dc4 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/wex.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges wex" -}} +{{template "header" .}} +## Wex Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchange_readme_templates/yobit.tmpl b/tools/documentation/exchange_readme_templates/yobit.tmpl new file mode 100644 index 00000000..8cb95788 --- /dev/null +++ b/tools/documentation/exchange_readme_templates/yobit.tmpl @@ -0,0 +1,12 @@ +{{define "exchanges yobit" -}} +{{template "header" .}} +## Yobit Exchange + +### Current Features + ++ Initial generation + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/general_templates/CONTRIBUTORS b/tools/documentation/general_templates/CONTRIBUTORS new file mode 100644 index 00000000..eda72237 --- /dev/null +++ b/tools/documentation/general_templates/CONTRIBUTORS @@ -0,0 +1,6 @@ +{{define "CONTRIBUTORS"}} +Thanks to the following contributors: +{{ range $contributor := .Contributors -}} +{{$contributor.Login}} | {{$contributor.URL}} +{{ end }} +{{end}} diff --git a/tools/documentation/general_templates/LICENSE b/tools/documentation/general_templates/LICENSE new file mode 100644 index 00000000..c8eb724e --- /dev/null +++ b/tools/documentation/general_templates/LICENSE @@ -0,0 +1,23 @@ +{{define "LICENSE" -}} +The MIT License (MIT) + +Copyright (c) 2014-{{- .Year}} The GoCryptoTrader Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +{{end}} diff --git a/tools/documentation/sub_templates/contributors.tmpl b/tools/documentation/sub_templates/contributors.tmpl index 123c6ca4..0d124405 100644 --- a/tools/documentation/sub_templates/contributors.tmpl +++ b/tools/documentation/sub_templates/contributors.tmpl @@ -1,6 +1,8 @@ {{define "contributors"}} ## Contributor List +### A very special thank you to all who have contributed to this program: + |User|Github|Contribution Amount| |--|--|--| {{ range $contributor := .Contributors -}} diff --git a/tools/documentation/sub_templates/header.tmpl b/tools/documentation/sub_templates/header.tmpl index b6144bd8..80686851 100644 --- a/tools/documentation/sub_templates/header.tmpl +++ b/tools/documentation/sub_templates/header.tmpl @@ -1,5 +1,5 @@ {{define "header" -}} -# GoCryptoTrader package {{.Name}} +# GoCryptoTrader package {{.CapitalName}}