Coder Social home page Coder Social logo

yari-with-buttons's Introduction

yari.el provides an Emacs frontend to Ruby's `ri' documentation
tool. It offers lookup and completion.

This version will load all completion targets the first time it's
invoked. This can be a significant startup time, but it will not
have to look up anything after that point.

This library tries to by compatible with any version of `rdoc' gem.
Self-testing covers all versions from 1.0.1 to 2.5.8 (current).

The main function you should use as interface to ri is M-x yari. I
recommend to bind it on some key local when you are ruby-mode. Here
is the example:

(defun ri-bind-key ()
  (local-set-key [f1] 'yari))

 or

(defun ri-bind-key ()
  (local-set-key [f1] 'yari-anything))

(add-hook 'ruby-mode-hook 'ri-bind-key)

You can use C-u M-x yari to reload all completion targets.

I added 'buttons' to the original code.  I am abandoning ri-emacs for yari because
it uses the ri command directly so there is far less compatibility problems.

There is no nice way I can see to communicate to the users so I'll add
my thoughts in here.

# I'd like to figure out a nicer way for the completions to work.  I
# can't do yari and type in create_type.  Instead I have to type in
# ActiveRecord::ConnectionAdapters::SchemaStatements#create_table which
# is rather painful.  It woudl be nice if I could type in "foo" and have
# the list of options be the various classes (or modules) that contain a
# method named "foo".

The above "wish" was accomplished by turning on ido-mode.  I'm
comfortable having ido-mode on all the time.  However I can see where
some might not want it on all the time.  It would be trivial to
introduce a customizable yari option so that only yari uses ido mode
keeping ido mode off for the rest of the emacs interfaces.  If I get a
request for this, I'll implement it.

I experimented with rvm and rvm.el.  If you are in a Rails app
directory (top level) and do M-x rvm-activate-corresponding-ruby, it
will load the local .rvmrc file and know which ruby and gemset to
use.  This is one step towards my goal.

The next step will be to create some new rake tasks to create the ri
documentation for the Rails application -- similar to ``rake doc:app''
but cause it to create the ri version instead of the rdoc version.  I
need to decide where to put it.  It is unfortunate that the Rails guys
decided to put the applications rdoc files in doc/app.  Perhaps put
them in doc/app/rdoc and doc/app/ri.  Then the api would be in
doc/api/rdoc and doc/api/ri.

The next step will be to invoke ri (from yari) with an
--doc-dir=doc/app/ri so that it will pick up the application's
documentation.  At that point, yari will know all about the
application, the particular rails it is using, and the particular set
of gems it is using.

Finally, I can not get the C-u M-x yari to reload the completion
targets.  On my emacs (GNU 23.1.1), I just get an error.  That is less
of an issue right now.

yari-with-buttons's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.