From 87f33b3d9acafc9c2e31a002b751aae1435e8fcf Mon Sep 17 00:00:00 2001 From: Nikita Voloboev Date: Wed, 22 Aug 2018 00:10:19 +0200 Subject: [PATCH] update --- .vscode/tasks.json | 2 +- curated-lists.go | 7 +-- learn-anything.go | 3 +- main.go | 1 - workflow/info.plist | 126 ++++++++++++++++---------------------------- workflow/maps.json | 4 +- 6 files changed, 53 insertions(+), 90 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ebdcf4f..621f88e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,7 +2,7 @@ "version": "2.0.0", "tasks": [ { - "taskName": "alfred build", + "label": "alfred build", "type": "shell", "command": "alfred build", "group": { diff --git a/curated-lists.go b/curated-lists.go index 66dfbd4..00280ac 100644 --- a/curated-lists.go +++ b/curated-lists.go @@ -27,7 +27,8 @@ func doSearchLists() error { log.Printf("query=%s", query) - parseList() + // TODO: where is cache placed? + parseList("lists.md") if query != "" { wf.Filter(query) @@ -40,8 +41,8 @@ func doSearchLists() error { } // parseList parses a markdown list for links. -func parseList() { - bytes, _ := ioutil.ReadFile("lists.md") +func parseList(file string) { + bytes, _ := ioutil.ReadFile(file) // Regex to extract markdown links re := regexp.MustCompile(`\[([^\]]*)\]\(([^)]*)\)`) diff --git a/learn-anything.go b/learn-anything.go index 38088f3..4ea646d 100644 --- a/learn-anything.go +++ b/learn-anything.go @@ -15,7 +15,7 @@ type Topic struct { Key string `json:"key"` } -// doSearch searches all Learn Anything topics. +// doSearchTopics searches all Learn Anything topics. func doSearchTopics() error { showUpdateStatus() log.Printf("query=%s", query) @@ -37,7 +37,6 @@ func doSearchTopics() error { wf.WarnEmpty("No matching items", "Try a different query?") wf.SendFeedback() return nil - } // loadVaules returns ID's and keys from read JSON file. diff --git a/main.go b/main.go index bfa630c..d30cfe8 100644 --- a/main.go +++ b/main.go @@ -89,7 +89,6 @@ func doTest() error { return nil } -// main wraps run() (actual entry point) to catch errors func main() { wf.Run(run) } diff --git a/workflow/info.plist b/workflow/info.plist index ea7bdb8..28f67f6 100644 --- a/workflow/info.plist +++ b/workflow/info.plist @@ -3,7 +3,7 @@ bundleid - nikivi.learn-anything + nikivi.learn.anything category Mine connections @@ -65,7 +65,7 @@ modifiers 1048576 modifiersubtext - Contributing guidelines + View contributing guidelines vitoclose @@ -108,16 +108,6 @@ 790627A4-87DA-408A-BC71-90FA3D9CDF36 - - destinationuid - D42BF709-D05C-44B7-94A2-3BDC5BF37CC6 - modifiers - 1048576 - modifiersubtext - Open in Chrome - vitoclose - - destinationuid 238CAD6B-EF29-4AF9-8A6D-A45407BBC0CE @@ -153,25 +143,6 @@ Learn Anything objects - - config - - browser - com.google.Chrome - spaces - - url - https://learn-anything.xyz/{query} - utf8 - - - type - alfred.workflow.action.openurl - uid - D42BF709-D05C-44B7-94A2-3BDC5BF37CC6 - version - 1 - config @@ -204,9 +175,9 @@ scriptfile subtext - Open Maps + Search topics title - Learn anything + Learn Anything type 0 withspace @@ -219,19 +190,6 @@ version 2 - - config - - triggerid - learn - - type - alfred.workflow.trigger.external - uid - 05C2CDF4-B8F6-48B5-9DCC-75AC001E1500 - version - 1 - config @@ -251,6 +209,19 @@ version 1 + + config + + triggerid + search learn anything + + type + alfred.workflow.trigger.external + uid + 05C2CDF4-B8F6-48B5-9DCC-75AC001E1500 + version + 1 + config @@ -274,7 +245,7 @@ config triggerid - lists + search curated lists type alfred.workflow.trigger.external @@ -456,7 +427,9 @@ echo -n "${query//#readme}" readme - Details on how to effectively use this workflow are found in the GitHub repository attached to this workflow. + Details on how to use this workflow are found in the GitHub repo attached to the workflow. + +Double click this workflow in sidebar -> Open website. Post any issues and feature requests you have there. πŸ’œ uidata @@ -466,28 +439,28 @@ Post any issues and feature requests you have there. πŸ’œ xpos 10 ypos - 60 + 10 0AFED35D-0B15-4070-A6C4-E762A091EC86 xpos - 460 + 420 ypos - 460 + 290 238CAD6B-EF29-4AF9-8A6D-A45407BBC0CE xpos - 370 + 360 ypos - 180 + 10 2C61650C-01F2-4BC7-AAE0-8C31508A2833 xpos 10 ypos - 400 + 230 4F774142-7D29-4E25-8B08-5CCEAA253E53 @@ -496,76 +469,67 @@ Post any issues and feature requests you have there. πŸ’œ xpos 170 ypos - 400 + 230 60D56C11-AA30-44D1-82E2-67C0A0B87073 xpos - 620 + 580 ypos - 490 + 320 62FC303E-01BA-430E-BC35-C7365486A097 note - Contributing guidelines + View contributing guidelines xpos - 720 + 670 ypos - 460 + 290 72B1AA05-3281-415B-9252-9036D705817A xpos - 460 + 420 ypos - 590 + 440 790627A4-87DA-408A-BC71-90FA3D9CDF36 note Search topics xpos - 160 + 180 ypos - 60 + 10 A2A341B0-792A-43F0-A4F7-7F2755274850 note Edit list xpos - 720 + 670 ypos - 590 + 440 AEABCB9D-9232-43D3-8640-84C9451203E0 xpos - 620 + 580 ypos - 620 + 470 C7FE3DF8-D5CD-4468-8CE0-BB050EF48F17 xpos - 460 - ypos - 320 - - D42BF709-D05C-44B7-94A2-3BDC5BF37CC6 - - note - Adding resources to maps works better on Chrome currently - xpos - 370 + 420 ypos - 10 + 150 version - 2.3.5 + 2.4 webaddress - https://github.com/nikitavoloboev/alfred-learn-anything + https://github.com/nikitavoloboev/alfred-learn-anything#readme diff --git a/workflow/maps.json b/workflow/maps.json index 96e2a52..4c2cb25 100644 --- a/workflow/maps.json +++ b/workflow/maps.json @@ -149,7 +149,7 @@ {"mapID":654,"key":"aliasing","title":"learn anything - information theory - signals - signal processing - digital signal processing - aliasing"} {"mapID":110,"key":"cell division","title":"learn anything - biology - organisms - cells - cell division"} {"mapID":8,"key":"animation","title":"learn anything - art - animation"} -{"mapID":1666,"key":"typescript programming language","title":"learn anything - programming - programming languages - typescript"} +{"mapID":1666,"key":"typeScript programming language","title":"learn anything - programming - programming languages - typescript"} {"mapID":288,"key":"lexical analysis","title":"learn anything - computer science - compilers - lexical analysis"} {"mapID":1545,"key":"uncertainty principle","title":"learn anything - physics - quantum mechanics - uncertainty principle"} {"mapID":1789,"key":"group dynamics","title":"learn anything - sociology - social groups - group dynamics"} @@ -1932,4 +1932,4 @@ {"mapID":1076,"key":"Bayes’ theorem","title":"learn anything - mathematics - statistics - bayesian statistics - bayes theorem"} {"mapID":1209,"key":"domain name system","title":"learn anything - network science - computer networking - internet - domain name system"} {"mapID":641,"key":"solid-state drives","title":"learn anything - information theory - information - data storage - solid state drives"} -{"mapID":735,"key":"polish language","title":"learn anything - linguistics - languages - polish"} \ No newline at end of file +{"mapID":735,"key":"polish language","title":"learn anything - linguistics - languages - polish"}