crystal-alfred

Small utility lib to generate JSON output that can be shown in an Alfred list

alfred

Utility lib to create items in JSON format for Alfred

Installation

Add this to your application's shard.yml:

dependencies:
  alfred:
    github: International/crystal-alfred

Usage

At this moment, the only supported format is JSON.

require "alfred"

response = Alfred::Response.new
response << Alfred::Item.new("title", "subtitle", "arg", Alfred::Icon.new("icon","icon.png"))

puts response.to_json
# {"items":[{"title":"title","subtitle":"subtitle","arg":"arg","icon":{"type":"icon","path":"icon.png"}}]}

When using Alfred::Item, probably the parameter you'll most likely be interested in is arg. This is the parameter that gets sent further when you select an item from the list.

Contributing

  1. Fork it ( https://github.com/International/crystal-alfred/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

crystal-alfred

Owner
Statistic
  • 2
  • 1
  • 0
  • 0
  • 0
  • about 8 years ago
  • October 18, 2016
License

MIT License

Links
Synced at

Thu, 21 Nov 2024 21:06:59 GMT

Languages