├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── google.png ├── icon.png ├── info.plist ├── screenshot.png └── vuejs.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | /vendor -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Vince Mitchell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VueJS Docs Workflow for Alfred 2 | 3 | An ultra-fast VueJS docs search workflow for Alfred 3. 4 | 5 | Adapted from [Alfred Laravel Docs](https://github.com/tillkruss/alfred-laravel-docs), Thanks [Till Krüss](https://twitter.com/tillkruss)! 6 | 7 | ![Screenshot](screenshot.png) 8 | 9 | ## Installation 10 | 11 | 1. [Download the latest version](https://github.com/vmitchell85/alfred-vuejs-docs/releases/download/0.1.1/VueJS.Docs.alfredworkflow) 12 | 2. Install the workflow by double-clicking the `.alfredworkflow` file 13 | 3. You can add the workflow to a category, then click "Import" to finish importing. You'll now see the workflow listed in the left sidebar of your Workflows preferences pane. 14 | 15 | ## Usage 16 | 17 | ``` 18 | vue 19 | ``` 20 | 21 | Just type `vue` followed by your search query. 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tillkruss/alfred-lorem-ipsum", 3 | "description": "An ultra-fast Laravel docs search workflow for Alfred 3", 4 | "version": "0.2.1", 5 | "keywords": ["alfred", "alfred-workflow", "laravel", "algolia"], 6 | "homepage": "https://till.im", 7 | "support": { 8 | "source": "https://github.com/tillkruss/alfred-laravel-docs", 9 | "issues": "https://github.com/tillkruss/alfred-laravel-docs/issues" 10 | }, 11 | "license": "MIT", 12 | "require": { 13 | "joetannenbaum/alfred-workflow": "^0.1.0", 14 | "algolia/algoliasearch-client-php": "^1.27" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmitchell85/alfred-vuejs-docs/cc1f071ddb10fa34fcb2201b1fe3c95f34a4fd51/google.png -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmitchell85/alfred-vuejs-docs/cc1f071ddb10fa34fcb2201b1fe3c95f34a4fd51/icon.png -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.vmitchell85.vuejs-docs 7 | category 8 | Productivity 9 | connections 10 | 11 | 7B86D057-DA8E-4302-AF17-83B889B48EE2 12 | 13 | 14 | destinationuid 15 | D449CB87-B64C-41F5-8FF0-C93C75686459 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | 25 | createdby 26 | Vince Mitchell 27 | description 28 | An ultra-fast VueJS docs search workflow 29 | disabled 30 | 31 | name 32 | VueJS Docs 33 | objects 34 | 35 | 36 | config 37 | 38 | browser 39 | 40 | spaces 41 | 42 | url 43 | {query} 44 | utf8 45 | 46 | 47 | type 48 | alfred.workflow.action.openurl 49 | uid 50 | D449CB87-B64C-41F5-8FF0-C93C75686459 51 | version 52 | 1 53 | 54 | 55 | config 56 | 57 | alfredfiltersresults 58 | 59 | alfredfiltersresultsmatchmode 60 | 0 61 | argumenttrimmode 62 | 0 63 | argumenttype 64 | 0 65 | escaping 66 | 127 67 | keyword 68 | vue 69 | queuedelaycustom 70 | 3 71 | queuedelayimmediatelyinitially 72 | 73 | queuedelaymode 74 | 0 75 | queuemode 76 | 1 77 | runningsubtext 78 | Searching docs for "{query}"... 79 | script 80 | php vuejs.php "{query}" 81 | scriptargtype 82 | 0 83 | scriptfile 84 | 85 | subtext 86 | Search the VueJS docs... 87 | title 88 | VueJS 89 | type 90 | 0 91 | withspace 92 | 93 | 94 | type 95 | alfred.workflow.input.scriptfilter 96 | uid 97 | 7B86D057-DA8E-4302-AF17-83B889B48EE2 98 | version 99 | 2 100 | 101 | 102 | readme 103 | 104 | uidata 105 | 106 | 7B86D057-DA8E-4302-AF17-83B889B48EE2 107 | 108 | xpos 109 | 200 110 | ypos 111 | 90 112 | 113 | D449CB87-B64C-41F5-8FF0-C93C75686459 114 | 115 | xpos 116 | 510 117 | ypos 118 | 90 119 | 120 | 121 | version 122 | 0.1.1 123 | webaddress 124 | https://vincemitchell.me 125 | 126 | 127 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmitchell85/alfred-vuejs-docs/cc1f071ddb10fa34fcb2201b1fe3c95f34a4fd51/screenshot.png -------------------------------------------------------------------------------- /vuejs.php: -------------------------------------------------------------------------------- 1 | initIndex('vuejs'); 17 | $search = $index->search($query, ['facetFilters' => 'version:v2']); 18 | $results = $search['hits']; 19 | 20 | if (empty($results)) { 21 | $workflow->result() 22 | ->title('No matches') 23 | ->icon('google.png') 24 | ->subtitle("No match found in the docs. Search Google for: \"VueJS+{$query}\"") 25 | ->arg("https://www.google.com/search?q=vuejs+{$query}") 26 | ->quicklookurl("https://www.google.com/search?q=vuejs+{$query}") 27 | ->valid(true); 28 | 29 | echo $workflow->output(); 30 | exit; 31 | } 32 | 33 | foreach ($results as $hit) { 34 | $highestLvl = $hit['hierarchy']['lvl6'] ? 6 : ( 35 | $hit['hierarchy']['lvl5'] ? 5 : ( 36 | $hit['hierarchy']['lvl4'] ? 4 : ( 37 | $hit['hierarchy']['lvl3'] ? 3 : ( 38 | $hit['hierarchy']['lvl2'] ? 2 : ( 39 | $hit['hierarchy']['lvl1'] ? 1 : 0 40 | ) 41 | ) 42 | ) 43 | ) 44 | ); 45 | 46 | $title = $hit['hierarchy']['lvl' . $highestLvl]; 47 | $currentLvl = 0; 48 | $subtitle = $hit['hierarchy']['lvl0']; 49 | while ($currentLvl < $highestLvl) { 50 | $currentLvl = $currentLvl + 1; 51 | $subtitle = $subtitle . ' » ' . $hit['hierarchy']['lvl' . $currentLvl]; 52 | } 53 | 54 | $workflow->result() 55 | ->uid($hit['objectID']) 56 | ->title($title) 57 | ->autocomplete($title) 58 | ->subtitle($subtitle) 59 | ->arg($hit['url']) 60 | ->quicklookurl($hit['url']) 61 | ->valid(true); 62 | } 63 | 64 | echo $workflow->output(); 65 | --------------------------------------------------------------------------------