All Projects → fanzeyi → alfred-rustdoc

fanzeyi / alfred-rustdoc

Licence: other
An Alfred workflow uses rustdoc's search index to provide local search result

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to alfred-rustdoc

alfred-night-shift
🌝 Alfred 3 workflow to toggle night shift
Stars: ✭ 18 (-28%)
Mutual labels:  alfred-workflow
alfred-adb-workflow
an alfred workflow that wraps the adb command to avoid the "more than one device/emulator" error.
Stars: ✭ 22 (-12%)
Mutual labels:  alfred-workflow
alfred-sublime-text
Filter and open your Sublime Text (2 and 3) project files from Alfred.
Stars: ✭ 66 (+164%)
Mutual labels:  alfred-workflow
alfred-urban-dictionary
Search Urban Dictionary from Alfred.
Stars: ✭ 53 (+112%)
Mutual labels:  alfred-workflow
gist-alfred
An alfred workflow for accessing gists
Stars: ✭ 113 (+352%)
Mutual labels:  alfred-workflow
alfred-string-operations
Perform string operations to clipboard content
Stars: ✭ 70 (+180%)
Mutual labels:  alfred-workflow
alfred-last2imgur
Alfred workflow to upload the last screenshot taken to Imgur + (delete and minify image)
Stars: ✭ 15 (-40%)
Mutual labels:  alfred-workflow
alfred-wf-bluetooth-manager
Connect and disconnect a bluetooth device easily
Stars: ✭ 58 (+132%)
Mutual labels:  alfred-workflow
mldocs
Alfred Workflow for TensorFlow, PyTorch, Scikit-learn, NumPy, Pandas, Matplotlib, Statsmodels, Jax, RLLib API Docs
Stars: ✭ 54 (+116%)
Mutual labels:  alfred-workflow
alfred-git-commit-message-example
Alfred Git Commit Message Example
Stars: ✭ 55 (+120%)
Mutual labels:  alfred-workflow
alfred-workflows
Hopefully useful workflows for Alfred
Stars: ✭ 54 (+116%)
Mutual labels:  alfred-workflow
alfred-shush
Shush! — Alfred workflow for muting your microphone
Stars: ✭ 18 (-28%)
Mutual labels:  alfred-workflow
search-alfred-workflows
Search Alfred Workflows
Stars: ✭ 45 (+80%)
Mutual labels:  alfred-workflow
alfred-jira-search
Alfred Workflow to quickly search through Jira issues 🔎
Stars: ✭ 23 (-8%)
Mutual labels:  alfred-workflow
alfred-currency-conversion
Alfred 4 Workflow - See foreign exchange rates and currency conversion
Stars: ✭ 149 (+496%)
Mutual labels:  alfred-workflow
alfred bluetooth controller
Alfred workflow for managing bluetooth settings and -connections
Stars: ✭ 63 (+152%)
Mutual labels:  alfred-workflow
bookends-tools
Alfred Workflow to Integrate with Bookends, an academic reference manager/bibliography tool for macOS
Stars: ✭ 78 (+212%)
Mutual labels:  alfred-workflow
alfred-otter
Alfred workflow for searching and retrieving transcripts from Otter.ai
Stars: ✭ 20 (-20%)
Mutual labels:  alfred-workflow
alfred-craftdocs-searchindex
Note searching for Craft Docs
Stars: ✭ 20 (-20%)
Mutual labels:  alfred-workflow
alfred
A fast, simple way to make Alfred workflow script filters in Go
Stars: ✭ 25 (+0%)
Mutual labels:  alfred-workflow

Alfred-rustdoc

An Alfred workflow for searching Rust crate documentations on docs.rs. It uses the search index file built during cargo doc to generate typeahead list in Alfred, and it opens docs.rs for you.

preview

It supports the same query syntax in cargo-doc. For example, you can use fn: to priortize functions in the search result, or use vec -> usize to search all the functions that accepts a Vec as parameter and returns an usize. For details, please read the "search tricks" section from cargo doc (press "h" in any documentation generated by cargo doc):

Prefix searches with a type followed by a colon (e.g., fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g., vec -> usize or * -> vec)

Search multiple things at once by splitting your query with comma (e.g., str,u8 or String,struct:Vec,test)

You can look for items with an exact name by putting double quotes around your request: "string"

Look for items inside another one by searching for a path: vec::Vec

Installation

This workflow requires you have NodeJS installed in your system. To install NodeJS, run (w/ Homebrew):

brew install node

Then download the .alfredworkflow file from the Release page.

If you want the workflow to use a copy of NodeJS that is not located at /usr/local/bin/node, please configure the environment variable ALFRED_NODE_PATH in Aflred to your copy of NodeJS.

Details

This project directly uses the initSearch function in rust-lang/rust (hence written in NodeJS) with some stubs to make it work outside the browser. Then it fetches the search-index.js file generated during the documentation building process (cargo doc) from docs.rs to serve the search result in Alfred. The search-index.js is evaluated inside a sandbox provided by vm2. This means this workflow will be running code downloaded from the Internet inside a sandbox. This is really unfortunate since some big crates rely on some JavaScript features to do compression (for example, this search index file). Please let me know if there is an alternative way to acquire the search index without actually executing any remote code.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].