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))

View File

@@ -1,8 +1,8 @@
{{define "common" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package collates basic broad functions that are used throughout this codebase
+ This package collates basic broad functions that are used throughout this codebase.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "config" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package deals with configuration utilities
+ This package deals with configuration utilities.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "currency pair" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package services the currency package
+ This package services the currency package.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "currency" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ Currency package deals with currency pair generation, manipulation and tracking
+ Currency package deals with currency pair generation, manipulation and tracking.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "currency symbol" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package services the currency package
+ This package services the currency package.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "currency translation" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package services the currency package with translation functions
+ This package services the currency package with translation functions.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "events" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ The events package handles events from GoCryptoTrader bot
+ The events package handles events from GoCryptoTrader bot.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "exchanges nonce" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package services the exchanges package with nonce creation
+ This package services the exchanges package with nonce creation.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "exchanges orderbook" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package facilitates orderbook generation
+ This package facilitates orderbook generation.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "exchanges" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package is used to connect and query data from supported exchanges
+ This package is used to connect and query data from supported exchanges.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "exchanges stats" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package services the exchanges package
+ This package services the exchanges package.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "exchanges ticker" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This services the exchanges package by ticker functions
+ This services the exchanges package by ticker functions.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,8 +1,8 @@
{{define "portfolio" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package allows for the monitoring of portfolio data
+ This package allows for the monitoring of portfolio data.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -87,6 +87,24 @@ platform.
### Linux/OSX
We use the `dep` tool provided by Golang for managing dependencies. As it is not officially part
of the go tools package suite, you will need to manually install it if you have not already.
On MacOS you can install or upgrade to the latest released version with Homebrew:
```sh
brew install dep
brew upgrade dep
```
On linux or MacOS, you can also install it via `go get`:
```sh
go get -u github.com/golang/dep/cmd/dep
```
After `dep` is installed, please follow the instructions below:
```bash
go get github.com/thrasher-/gocryptotrader
cd $GOPATH/src/github.com/thrasher-/gocryptotrader

View File

@@ -1,8 +1,8 @@
{{define "smsglobal" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features for {{.Name}}
+ This package allows for the messaging of events to a personal phone number or a group of phone numbers
+ This package allows for the messaging of events to a personal phone number or a group of phone numbers.
### Please click GoDocs chevron above to view current GoDoc information for this package
{{template "contributions"}}

View File

@@ -1,5 +1,5 @@
{{define "testdata" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features
This folder contains a configuration test file for non-deployement test params.

View File

@@ -1,8 +1,8 @@
{{define "tools" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features
This folder contains an assortment of tools
This folder contains an assortment of tools.
+ Configuration
+ Documentation creation
@@ -11,10 +11,16 @@ This folder contains an assortment of tools
+ Websocket client
Example Run for documentation generation - flags -v Verbose & -R Replace files
```
Example Run for documentation generation - flags -v Verbose & -r Replace files
```sh
cd documentation/
go run documentation -v
go run documentation.go -v
```
OR for full replacement.
```sh
cd documentation/
go run documentation.go -v -r
```
{{template "contributions"}}
{{template "donations"}}

View File

@@ -1,8 +1,7 @@
{{define "web" -}}
{{template "header" .Name}}
{{template "header" .}}
## Current Features
+ It can run
+ It can be compiled with Electron to run as an executable
+ Websocket support to listen to GoCryptoTrader events

View File

@@ -1,11 +1,11 @@
{{define "header" -}}
# GoCryptoTrader package {{.}}
# GoCryptoTrader package {{.Name}}
<img src="https://github.com/thrasher-/gocryptotrader/blob/master/web/src/assets/page-logo.png?raw=true" width="350px" height="350px" hspace="70">
{{template "status" .}}
{{template "status" .NameURL}}
This {{.}} package is part of the GoCryptoTrader codebase
This {{.Name}} package is part of the GoCryptoTrader codebase.
## This is still in active development

View File

@@ -1,7 +1,7 @@
{{define "status"}}
[![Build Status](https://travis-ci.org/thrasher-/gocryptotrader.svg?branch=master)](https://travis-ci.org/thrasher-/gocryptotrader)
[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-/gocryptotrader/blob/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/{{.}})
{{with .}}[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/{{.}}){{else}}[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/){{end}}
[![Coverage Status](http://codecov.io/github/thrasher-/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-/gocryptotrader?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-/gocryptotrader)](https://goreportcard.com/report/github.com/thrasher-/gocryptotrader)
{{end}}