2018-08-21 08:50:30 +00:00
|
|
|
// create taskell configuration
|
2018-08-21 08:57:59 +00:00
|
|
|
// run taskell and read content ?
|
|
|
|
// use https://github.com/adlio/trello ?
|
2018-08-21 08:50:30 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
2018-08-21 08:57:59 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
2018-08-21 17:21:46 +00:00
|
|
|
//"github.com/VojtechVitek/go-trello"
|
2018-08-21 08:57:59 +00:00
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2018-08-21 17:21:46 +00:00
|
|
|
type TrelloCtx struct {
|
|
|
|
Token string
|
|
|
|
}
|
|
|
|
|
|
|
|
type TrelloItem struct {
|
|
|
|
Title string
|
|
|
|
}
|
|
|
|
|
|
|
|
type TrelloList struct {
|
|
|
|
Items []TrelloItem
|
|
|
|
}
|
|
|
|
|
|
|
|
type TrelloBoard struct {
|
|
|
|
Ctx TrelloCtx
|
|
|
|
Lists []TrelloList
|
|
|
|
}
|
|
|
|
|
2018-08-21 08:57:59 +00:00
|
|
|
func runcmd(command string) string {
|
|
|
|
shell := "/bin/sh"
|
|
|
|
flag := "-c"
|
|
|
|
|
|
|
|
out, err := exec.Command(shell, flag, command).Output()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return string(out)
|
|
|
|
}
|
|
|
|
|
2018-08-21 17:21:46 +00:00
|
|
|
func NewTrello(token string) *TrelloCtx {
|
|
|
|
return &TrelloCtx{Token: token}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ctx *TrelloCtx) GetBoard(boardUrl string) TrelloBoard {
|
|
|
|
return TrelloBoard{Ctx: *ctx}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*TrelloBoard) ExportToMarkdown() []string {
|
2018-08-21 08:50:30 +00:00
|
|
|
}
|
|
|
|
|
2018-08-21 08:57:59 +00:00
|
|
|
func RunTaskell(boardUrl string) {
|
|
|
|
cmd := fmt.Sprintf("taskell -t %s -", boardUrl)
|
|
|
|
markdown := strings.TrimSpace(runcmd(cmd))
|
2018-08-21 08:50:30 +00:00
|
|
|
}
|