Skip to content

Commit

Permalink
links main Summary info
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitavoloboev committed May 27, 2020
1 parent 9d6dea2 commit 2dcc5a4
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 31 deletions.
9 changes: 4 additions & 5 deletions links.go
Expand Up @@ -11,13 +11,13 @@ import (

type bookmarks map[string]string

func searchLinks() {
func searchLinks(wikiPath string) {
showUpdateStatus()
bookmarks := make(bookmarks)

files := parseSummary()
for _, file := range files {
parseLinks(file, bookmarks)
parseLinks(wikiPath, file, bookmarks)
}
for name, link := range bookmarks {
wf.NewItem(name).UID(name).Valid(true).Arg(link)
Expand Down Expand Up @@ -52,9 +52,8 @@ func parseSummary() []string {
}

// Parse file for links and update bookmarks.
func parseLinks(path string, bookmarks bookmarks) {
wikiPath := "/Users/nikivi/Dropbox/Write/knowledge/"
file, err := os.Open(wikiPath + path)
func parseLinks(wikiPath string, filePath string, bookmarks bookmarks) {
file, err := os.Open(wikiPath + filePath)
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 3 additions & 1 deletion main.go
Expand Up @@ -29,7 +29,9 @@ func run() {
searchWiki()
return
} else if *links {
searchLinks()
// TODO: read from env var
// TODO: show description as subtitle
searchLinks("/Users/nikivi/Dropbox/Write/knowledge/")
return
}
}
Expand Down

0 comments on commit 2dcc5a4

Please sign in to comment.