documenter output is now markdown
This commit is contained in:
15
gokill.go
15
gokill.go
@@ -14,25 +14,24 @@ import (
|
|||||||
func GetDocumentation() string {
|
func GetDocumentation() string {
|
||||||
actions := actions.GetDocumenters()
|
actions := actions.GetDocumenters()
|
||||||
|
|
||||||
result := "Available Actions:\n\n"
|
var result string
|
||||||
lineBreak := "----------------------------"
|
|
||||||
|
|
||||||
writeOptions := func(documenters []internal.Documenter) {
|
writeOptions := func(documenters []internal.Documenter) {
|
||||||
for _, act := range documenters {
|
for _, act := range documenters {
|
||||||
result += lineBreak
|
result += fmt.Sprintf("\n### %v\nDescription: %v \nValues:\n", act.GetName(), act.GetDescription())
|
||||||
result += fmt.Sprintf("\nName: %v\nDescription: %v\nValues:\n", act.GetName(), act.GetDescription())
|
|
||||||
|
|
||||||
for _, opt := range act.GetOptions() {
|
for _, opt := range act.GetOptions() {
|
||||||
result += fmt.Sprintf("\tName: %v\n\tType: %v\n\tDescr: %v\n\tDefault: %v\n",
|
result += fmt.Sprintf("- Name: %v\n\t- Type: %v\n\t- Descr: %v\n\t- Default: %v\n",
|
||||||
opt.Name, opt.Type, opt.Description, opt.Default)
|
opt.Name, opt.Type, opt.Description, opt.Default)
|
||||||
result += lineBreak + "\n\n"
|
result += "\n\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeOptions(actions)
|
result = "# Available Triggers:\n\n"
|
||||||
result += "\n\nAvailable Triggers:\n\n"
|
|
||||||
writeOptions(triggers.GetDocumenters())
|
writeOptions(triggers.GetDocumenters())
|
||||||
|
result += "\n\n# Available Actions:\n\n"
|
||||||
|
writeOptions(actions)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user