Zen-Coding Support

Hello,

Is there anyway to support this feature as described here: http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/
In essence, they speed of code development by using css selector for snippets


"...take things a step further, and turn a complex html structure into

something as simple as a CSS selector? Well, thanks to a new project,

called Zen-Coding, we can do this very thing!"


This means that I could type:

div#sales>div+div.sales_header+div.sales_body+div.sales_footer

which (via some keyboard short-cut) would get converted to:

<div id="sales">

    <div tag">sales_header"></div>

    <div tag">sales_body"></div>

    <div tag">sales_footer"></div>

</div>



H

11 comments
Comment actions Permalink

I recall reading something about Ruby extensions in RubyMine. I AFAIK, this feature allows you to define ruby scripts that can then be called from RubyMine.I would guess a ruby script with a bit of RegEx might do it?

Some more info here: http://www.jetbrains.net/devnet/docs/DOC-1161

HTH

0
Comment actions Permalink

zen-coding is nice, but I keep hoping someone will write a haml emitter..

0
Comment actions Permalink

Yes, you are right, it can be implemented using RubyMine extension on Ruby. E.g. you may fetch current selected text from an editor and invoke python script similar to "Expand Abbreviation.tmCommand" (see [zen-coding sources]/zen-coding-read-only/plugins/TextMate/Zen Coding.tmbundle/Commands folder).

I've just implement such extension. Today I'll play with it and most likely tomorrow I'll publish an initial version.

0
Comment actions Permalink

This is great! Looking forward to the post.

H

0
Comment actions Permalink

See http://github.com/iromeo/zen-coding-rm-plugin. I've tested it on MacOS. Also should work on other platforms.

0
Comment actions Permalink

Thanks mate. Will have a swing at this tomorrow.

H

0
Comment actions Permalink

Roman! Works like a charm. How do I buy you a beer

Thanks.

H

0
Comment actions Permalink

I am getting the error "Template 'div.class' isn't correct!".

I am on Build #RM-93.202

Any help would be appreciated!  This is the one thing I miss from Textmate and WebStorm.

0
Comment actions Permalink

Hello Michael,

Next RubyMine version (2.5) will include the same Zen-Coding Support as in our WebStorm IDE. RubyMine 2.5 EAP (Early Access Program) will start soon.

I am getting the error "Template 'div.class' isn't correct!".

I am on Build #RM-93.202

Any help would be appreciated!  This is the one thing I miss from Textmate and WebStorm.

I don't plan to support my simple RubyMine's Zen-Coding ruby extension because built-in Zen Coding support has been already done in RubyMine 2.5 trunk.

0
Comment actions Permalink

Hhow do I sign-up for your  EAP?

0
Comment actions Permalink

Any registration isn't required. We will announce it in our blog - http://blogs.jetbrains.com/ruby/

0

Please sign in to leave a comment.