Aptana Zen Coding

A place for those developing Aptana plugins, scripts or extending the IDE to gather and discuss extending Studio beyond the standard features.

Moderator: Aptana Staff

Aptana Zen Coding

Postby serge.che » Tue Apr 07, 2009 12:11 pm

Hello,

I've just released a first beta for Aptana Zen Coding — a new way of hi-speed writing of HTML-code.
The idea of this project is to use CSS-like syntax (like modern JavaScript frameworks do) for writing large code blocks. For example:
Code: Select all
div#content.wide.column>h1+ul#nav>li.item$*5>a


will be expanded into
Code: Select all
<div id="content" class="wide column">
   <h1></h1>
   <ul id="nav">
      <li class="item1"><a href=""></a></li>
      <li class="item2"><a href=""></a></li>
      <li class="item3"><a href=""></a></li>
      <li class="item4"><a href=""></a></li>
      <li class="item5"><a href=""></a></li>
   </ul>
</div>


with just a single keystroke. You can see Aptana Zen Coding in action at YouTube and download it from Google Code.

How to install
Install is as a regular AptanaMonkey script (described in Aptana Docs). You shoud see Zen Coding menu item inside Scripts view and menu.

Customizing
You can add your own code snippets and tags inside settings.js file.
serge.che
 
Posts: 7
Joined: Tue Apr 07, 2009 11:43 am

Re: Aptana Zen Coding

Postby IceBox » Tue Apr 07, 2009 12:22 pm

serge.che wrote:I've just released a first beta for Aptana Zen Coding — a new way of hi-speed writing of HTML-code.


Very, very cool!

I see it useful in creating on-the-fly html for the mockup pages.
The syntax, replicating Sizzle syntax, jQuery selector, is very nice.

Congrats,
IceBox
User avatar
IceBox
 
Posts: 1003
Joined: Mon Jul 07, 2008 12:03 pm
Location: Milano, Italy

Re: Aptana Zen Coding

Postby exceptione » Wed May 06, 2009 6:28 pm

@serge.che
This is the most valuable contribution I've ever seen. This really helps. In eclipse there is the concept of user-defined templates that can be filled in by tabbing over the hooks, but you take it a mile further. Really nice. I hope you will keep improving this add-on/in, it is much appreciated!!!!!!

The characters in the youtube video are unreadable, even with HD on. The textmate video on http://pepelsbey.net/pro/2008/08/zen-html/ is clear and give a good impression though.

tnx!
exceptione
 
Posts: 14
Joined: Fri Jan 30, 2009 8:34 pm

Re: Aptana Zen Coding

Postby Psy » Wed May 06, 2009 7:42 pm

exceptione wrote:@serge.che
This is the most valuable contribution I've ever seen. This really helps. In eclipse there is the concept of user-defined templates that can be filled in by tabbing over the hooks, but you take it a mile further. Really nice. I hope you will keep improving this add-on/in, it is much appreciated!!!!!!


Totally agree. As jQuery did to Javascript, this concept can really make a change on the way we code HTML. The use of CSS-like expressions is clever and easy to memorize. Well done!
Design & UI Developer
ecimTech | www.ecimtech.com
User avatar
Psy
 
Posts: 240
Joined: Fri Sep 15, 2006 2:22 am
Location: La Plata, Argentina

Re: Aptana Zen Coding

Postby serge.che » Wed May 06, 2009 9:22 pm

exceptione wrote:@serge.che
I hope you will keep improving this add-on/in, it is much appreciated!!!!!!


I'm working hard on new version, adding new features and extending editors support. The latest version is in the SVN: http://code.google.com/p/zen-coding/sou ... unk/aptana

PS: sorry for poor video quality, I'll make a new one when the next version comes out.
serge.che
 
Posts: 7
Joined: Tue Apr 07, 2009 11:43 am

Re: Aptana Zen Coding

Postby imageaid » Thu May 07, 2009 12:05 am

This looks fantastic. I'm curious if there's a way to install in either Eclipse 3.4 (Studio plugin)? I can't seem to find any Eclipse Monkey information on 3.4 and wasn't sure how to go about installing it, unless I just can't. Sure looks awesome though!!
imageaid
 
Posts: 68
Joined: Tue May 29, 2007 5:34 am
Location: Ouray, Colorado (US)

Re: Aptana Zen Coding

Postby serge.che » Thu May 07, 2009 8:41 am

imageaid wrote:This looks fantastic. I'm curious if there's a way to install in either Eclipse 3.4 (Studio plugin)? I can't seem to find any Eclipse Monkey information on 3.4 and wasn't sure how to go about installing it, unless I just can't. Sure looks awesome though!!



You just need to install Aptana plugin on Eclipse 3.4, create sample project (for example: ZenCoding), create 'scripts' folder and extract Zen Coding zip-file in it and you're fone. Also, you might need to refresh workspace/project to let Aptana know that there are new script files.
Last edited by serge.che on Thu May 07, 2009 2:55 pm, edited 1 time in total.
serge.che
 
Posts: 7
Joined: Tue Apr 07, 2009 11:43 am

Re: Aptana Zen Coding

Postby imageaid » Thu May 07, 2009 2:03 pm

That's awesome. Thank you! I'm going to try that this morning. Thanks for your hard work on this. It truly looks amazing (I also installed the TextMate bundle for when I'm using it on non-project related files :)! ). Cheers! Craig
imageaid
 
Posts: 68
Joined: Tue May 29, 2007 5:34 am
Location: Ouray, Colorado (US)

Re: Aptana Zen Coding

Postby imageaid » Thu May 07, 2009 2:33 pm

For those, like me, who haven't delved into the Aptana Scripting world yet (i.e., Eclipse Monkey, etc.), when you setup your base project, I used ZenCoding per serge's suggestion, make sure you name your folder scripts (plural-with the 's' at the end). Then, refresh your workspace and/or restart Aptana.

Finally, and this is what I did not know, you can use the Zen Coding features in ANY project! I thought, incorrectly, that it would only be available for the project in which it is created. Nope! It's across all your projects (including PHP files, which I thought was cool). Also, I installed this and have just tried it in Andretti Alpha 2 without any issues.

Thanks, again!
imageaid
 
Posts: 68
Joined: Tue May 29, 2007 5:34 am
Location: Ouray, Colorado (US)

Re: Aptana Zen Coding

Postby serge.che » Thu May 07, 2009 2:54 pm

This script works in all Aptana editors by default. It tries to determine current region's content type (i.e. HTML, CSS, XML) and use appropriate snippets. If it can't determine content type — nothing happens.

Zen Coding currently supported by all Aptana editors and XSL editor from Eclipse WTP Project (there are unknown issues XML editor of this project). But you can add support for all Eclipse editor by doing the following:

1. Open 'Expand Abbreviation.js' file
2. On line 24 replace this:
Code: Select all
var editor_type = zen_coding.getEditorType();

on this:
Code: Select all
var editor_type = zen_coding.getEditorType() || 'html';

3. Save the file
4. You may also need to refresh project and Scripts view to make sure that Aptana reloads script.

That's it, now Zen Coding can be used in all Eclipse editors (it was tested on PDT PHP Editor, Spket IDE, Ant Editor).
serge.che
 
Posts: 7
Joined: Tue Apr 07, 2009 11:43 am

Re: Aptana Zen Coding

Postby pabbec » Thu Jul 23, 2009 4:20 pm

Thanks serge.che! It's a very cool tool! :D

Congratulations!

Pablo
pabbec
 
Posts: 1
Joined: Thu Jul 23, 2009 4:18 pm
Location: Santa Fe, Argentina

Re: Aptana Zen Coding

Postby bobdobs » Thu Sep 03, 2009 12:33 pm

The zen-coding scripts are awesome!
Thanks!

I'm having a problem though: I can't seem to use the keyboard shortcut.

When I use Alt+E, the 'edit' menu in the eclipse toolbar becomes active.
I can still use the zen-coding from scripts menu, but I'd really like to use the shortcut. Or, at least configure a usable shortcut.

I suspect that this might have to do with my window-manager.
I am using gnome under ubuntu 9.04.

Does anyone know how I can make Alt-E work ?

Thanks.
bobdobs
 
Posts: 2
Joined: Mon May 26, 2008 7:55 am

Re: Aptana Zen Coding

Postby serge.che » Thu Sep 03, 2009 12:59 pm

Read Aptana Help about how to change keybinding: http://www.aptana.com/docs/index.php/Ad ... key_script
serge.che
 
Posts: 7
Joined: Tue Apr 07, 2009 11:43 am

Re: Aptana Zen Coding

Postby wazp » Wed Sep 23, 2009 10:27 am

bobdobs wrote:I suspect that this might have to do with my window-manager.
I am using gnome under ubuntu 9.04.

Does anyone know how I can make Alt-E work ?


It took me a while, but finally found a way. You need to edit the gtkrc file of the theme you are using (resides under /usr/share/themes/<theme>/gtk-2.0/gtkrc

Add this line to the end of this file:
gtk-enable-mnemonics = 0

Please note that you need to be superuser to edit this file so use gksu or regular su from a terminal to open the file.

This will disable the alt-<letter> mnemonic shortcut in Ubuntu, so it doesn't take the keypress and shows the menu. After that just logout/login and you can happily press alt-e in Aptana to get the, if I may say so, fabulous Zen Coding to work :)
wazp
 
Posts: 1
Joined: Wed Sep 23, 2009 10:21 am

A

Postby dd09 » Wed Sep 23, 2009 8:23 pm

UPDATE: nevermind... I obviously forgot the 'lib' folder lol... :)
Last edited by dd09 on Wed Sep 23, 2009 8:35 pm, edited 1 time in total.
dd09
 
Posts: 1
Joined: Wed Sep 23, 2009 8:18 pm

Next

Return to Customizing and Extending Studio