[ 6 posts ]

K o v a c s

  • Username: Kovacs
  • Joined: Wed Feb 11, 2009 8:55 am
  • Posts: 100
  • Location: The Biggest Little City in the World
  • Offline
  • Profile

Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 12:24 pm
+0-
I'd like to inquire about the feasibility of using YUI 2 RTE along with Auto-Complete (and possibly other components) to implement a Ruby editor with application-specific extensions (abut 100 classes and 1,000 methods).

I can use HTML, JavaScript, and CSS to implement this "web dialog" interface to the application's Ruby API. (There will also be at least one Ruby file for the application to load at start-up to make the application aware of this extension/plug-in.)

The application (which I prefer not to publicly identify) ships with a bare-bones, one-line-at-a-time "web dialog" interface with history recall (via up- and down-arrow on keyboard). There is no syntax highlighting, no auto-suggest, no auto-completion, etc. features. So I want to replace it with one that does these things (at least).

I've already looked at an existing 3rd party's product, which was based on jquery. Unfortunately this product falls well short of my standards, so I'd like to write my own. (The jquery files used were: ui.core.js; widget,js; 1.7.2.min.js; console-extensions.js; and fieldselection.js)

I've also looked at Dav's YUI: Editor: Code Editor w/Syntax Highlighting and CodePress--so it seems I'm on the right track in terms of being able to do this with YUI 2.

However, what about the feasibility to include such features as auto-suggest and auto-complete? That is, as one is typing in Ruby code, the following happens:

Type 'A' -> immediately causes a pop-up to appear containing Ruby modules starting with 'A'; user then presses the tab key to select the first item in the list (let's say it's 'Abc'):

Abc -> type '.d' -> causes all methods assigned to module 'Abc' to appear in a pop-up; then press the tab key/arrow keys to select one ('def'):

etc.

Then once the user has entered all the code, it has to be stripped-of-HTML so the "plain text" can be sent to the application's Ruby interpreter.

While I'm not desirous of implementing Notepad++ or CodeWright 7.5 (remember this?), I do want to produce a polished product.

So I'm looking for some guidance, suggestions, examples, and some measure for how difficult an undertaking this will be.


Thank you.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 12:32 pm
+0-
Implementing AutoComplete on top of the YUI 2 Editor is not a trivial task ;)

K o v a c s

  • Username: Kovacs
  • Joined: Wed Feb 11, 2009 8:55 am
  • Posts: 100
  • Location: The Biggest Little City in the World
  • Offline
  • Profile

Re: Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 12:40 pm
+0-
How about this instead?

User types 'Abc.', then clicks a dynamically-configured button named "Methods"--which in this case since the user typed 'Abc' plus '.', all the methods of Abc would appear in a list when the user clicks the button; from this list the user could select a method, which would then automatically be inserted after the '.' -

Abc.def.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 12:48 pm
+0-
Yeah, if you had some way of triggering the list without judging the typing it would be way easier.

For the record, the issue is that the Editor's content is an iframe so a standard AutoComplete won't like to attach to it. Also, the Editor's content is HTML and not plain text, so some processing needs to happen on the content before it can be matched.

K o v a c s

  • Username: Kovacs
  • Joined: Wed Feb 11, 2009 8:55 am
  • Posts: 100
  • Location: The Biggest Little City in the World
  • Offline
  • Profile
Tags:

Re: Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 12:51 pm
+0-
Thank you, Dav.

K o v a c s

  • Username: Kovacs
  • Joined: Wed Feb 11, 2009 8:55 am
  • Posts: 100
  • Location: The Biggest Little City in the World
  • Offline
  • Profile

Re: Using RTE for Ruby IDE?

Post Posted: Wed Aug 22, 2012 7:08 pm
+0-
For the benefit of others interested in this, you may want to consider this:

HIGHLIGHT.JS

Quote:
Highlight.js highlights syntax in code examples on blogs, forums and in fact on any web pages. It's very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.

The library knows 52 languages and is bundled with 26 style themes.
  [ 6 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum