3 of 6
3
TEA for Espresso, 1.0
Posted: 12 April 2009 07:37 PM   [ Ignore ]   [ # 31 ]
Newbie
Rank
Total Posts:  4
Joined  2009-04-09

And what about bug with snippets in multiple lines? http://wiki.macrabbit.com/forums/viewthread/298/.
And i found another bug.
When Wrap Selection In Tag and then type an attributes for tag these attributes appears in closing tag.
For example:
some selected text -> Wrap Selection In Tag action -> type tag and attributes.
Result:
<span class=“foo”>text</span class=“foo”>

Is it possible to fix? The same with Wrap Lines In Tag.

Profile
 
 
Posted: 12 April 2009 08:19 PM   [ Ignore ]   [ # 32 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Chupa: you need to update to Espresso 1.0.1.  The tag mirroring issues were fixed in that version.

The extra linebreaks bug in multi-line snippets should be included in TEA beta 9; if you’ve upgrade to beta 9 and are still seeing that bug please send me the snippet that you’re attempting to use so I can see if I can reproduce the problem locally.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 17 April 2009 07:36 AM   [ Ignore ]   [ # 33 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Hot on the heels of Espresso 1.0.2 comes TEA beta 10.  This is primarily a bug fix release, but I recommend it for all users of Espresso.  Why?  Because you can now install the latest version of TEA without needing to muck around in the application bundle.  Simply download the zip in the first message of this thread, double click the Sugar, and relaunch Espresso.

Improvements
- The Insert Tag From Word command will now parse the word Zen-style.  So if you type ‘div#stuff.things’ and hit control-, (control-comma), you’ll get this:

<div id="stuff" class="things"></div

Which is pretty cool.  You can do multiple classes, too: ‘div.things.bits’, or place the ID at the end: ‘div.things#stuff’ (note that the final output will always have the ID followed by the classes; let me know if this drives you bonkers).  Of course, all the old functionality is still there.  Note that currently you can either use the ID/class shorthand or write our your attributes, select them, and pass the selection to the action.  You can’t currently mix and match.

- Modified symlinks to custom user action files to allow Categories.xml files to work even if there are duplicates of the same name.

Bug fixes
- No more beeping! TEA actions should now only beep if they fail.  W00t!
- The Documentation For Tag action for HTML (and incidentally any actions that rely on the visit_url generic action) should now be several orders of magnitude faster at loading the URL in your default browser

Let me know if you have any problems!  Although I’ll be away from the internet April 18-20, so I might not be able to respond until next week sometime.  :-)

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 17 April 2009 08:39 AM   [ Ignore ]   [ # 34 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

The Aptana-style insert tag is wonderful :) Works great, thanks!

I had another question about snippets via TEA, would it be possible to let specific snippets only work in a particular environment, only while working with PHP for example?

Profile
 
 
Posted: 17 April 2009 04:17 PM   [ Ignore ]   [ # 35 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28
BloodDragon - 17 April 2009 08:39 AM
I had another question about snippets via TEA, would it be possible to let specific snippets only work in a particular environment, only while working with PHP for example?

Yep, this is baked in.  Simply stick a syntax-context tag inside the setup tag (I need to document this).  So for example:

<syntax-context>phpphp *</syntax-context

That will enable the action only when you’re in the PHP syntax or a child of the PHP syntax.  Theoretically any syntax selector string should work; let me know if you have any problems with it!

For an example of an action using the syntax-context tag, crack open the TEA Sugar and take a gander at the very last action in the TextActions/Actions.xml file.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 17 April 2009 09:57 PM   [ Ignore ]   [ # 36 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

Once again, works like a charm :) thanks for the quick reactions.

Profile
 
 
Posted: 19 April 2009 08:07 PM   [ Ignore ]   [ # 37 ]
Newbie
Rank
Total Posts:  4
Joined  2009-04-09

Hi, Ian.

It is not Aptana-style :) It is concept coding technique from russian guys. Project page: http://code.google.com/p/zen-coding/

Profile
 
 
Posted: 21 April 2009 01:46 AM   [ Ignore ]   [ # 38 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Hey Chupa,

Thanks for the clarification!  I assumed since it was in Aptana that it was an Aptana feature, but obviously I should have dug a little deeper.  I wish the zen-coding site had some English translations; that’s obviously a project to keep an eye on, but sadly I don’t read Russian.  :-)

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 28 April 2009 05:43 AM   [ Ignore ]   [ # 39 ]
Newbie
Rank
Total Posts:  1
Joined  2009-04-28

Dear Sr.Member. Why don’t use translate it in Google?

Profile
 
 
Posted: 28 April 2009 03:59 PM   [ Ignore ]   [ # 40 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

If I decide to try and integrate the rest of the zen-coding stuff (like the nesting features: ‘div>p’, etc.), I’ll definitely give that a shot.  I’ve never had much luck with automatic translation stuff, though.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 04 May 2009 09:33 PM   [ Ignore ]   [ # 41 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

TEA for Espresso beta 11 is out; you shouldn’t need to download it (it’ll be bundled with Espresso 1.0.5 when it hits the streets), but here’s the release notes:

Improvements
- Added new actions for inserting common HTML entities (non-breaking space, angle brackets, ampersand); many thanks to Colin Fyfe
- Format->Emphasize, Format->Strong, and HTML->Wrap Selection In Link now all provide Textile formatting as well as Markdown and HTML

Bug Fixes
- Both dollar signs and curly braces are escaped in selected text when wrapping it with a snippet
- syntax-context will now be more intelligent about handling root zones and empty files
- “Spaces to tabs” and “tabs to spaces” now will function on lines with mixed leading whitespace

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 05 May 2009 10:13 AM   [ Ignore ]   [ # 42 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

Thanks again for the update, it just keeps getting better and better. TEA is currently the main reason for me to use Espresso :)

I was wondering, I didn’t see this on the wiki (at a first glance), could I write my own functions (like the trimming action) in python and use these through TEA? I would like to create a sort function for example, to sort lines.

Profile
 
 
Posted: 05 May 2009 04:58 PM   [ Ignore ]   [ # 43 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28
BloodDragon - 05 May 2009 10:13 AM
I was wondering, I didn’t see this on the wiki (at a first glance), could I write my own functions (like the trimming action) in python and use these through TEA? I would like to create a sort function for example, to sort lines.

Yep, there are several different approaches you can take to add custom actions to TEA (all of which can be done just for your computer by placing stuff in ~/Library/Application Support/Espresso/TEA or for sharing with others by using MySugar.sugar/TEA).  #2 is what you’re looking for, but I’m listing them all for the benefit of others wondering how they can customize TEA:

1) Custom TextActions using TEA’s generic action API. This is pure XML on your part, and usually involves writing snippets that target specific languages/situations.

2) Custom Python actions.  The benefit of using Python is that you get access to the numerous helper functions in the tea_actions module.  If you want any examples of how to work with the helper functions and Espresso, TEA’s generic actions are the best example (located in src/TEA on GitHub).

3) Custom scripts in any language that can be on the OS X commandline.  This is very similar to Textmate’s bundle scripts, only less powerful.

If your action needs custom UI elements, you could in theory use TEA and Python to bootstrap your way in and cut down on the code necessary to get up and running (although I haven’t tried this myself).  For instance, the TEASpacesToTabs class inherits all the basic functionality from the TEAforEspresso class and then just overrides the critical performActionWithContext_error_() method (file is located in src/Contents/Resources on GitHub).  I’m not 100% sure you could do this without having your class imported in the TEA main.py file, but it might be worth a shot if you needed custom UI.

It’s also worth noting that if you do need custom UI and inheriting from TEA classes ends up not working outside of TEA, I’d definitely be interested in integrating generically useful actions written by other folks (sorting lines sounds like a great candidate).  Aside from the HTML actions that I’ve bundled with TEA because I personally use them every day, my goal for TEA is to provide actions that are generically useful across languages (hence Trim Lines, etc.).  The HTML actions in some ways are most useful as examples of what the generic action API can do.  If you want to integrate actions directly into TEA itself, feel free to fork the project on GitHub and give me a pull request when you’ve got something running.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 06 May 2009 11:58 AM   [ Ignore ]   [ # 44 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

Thanks, I will look into it :)

Edit:

Ok, I’ve created a function for sorting, removing duplicates or randomizing the order. It works correctly, but I’ve noticed one problem in passing arguments. If I use

<key>Name</key>
<
false/> 

it doesn’t work correctly. Apparently it passes true or false values as strings instead of real booleans. Is there any way to fix this? Or am I doing something wrong? If this is fixed I’ll do a pull request.

Edit 2:

As the variable I wanted to make false, is default False anyway, I’ve currently just removed the key from the actions.xml file. This works correctly and will also work if this bug is fixed. So I’ll just perform a pull request now.

Profile
 
 
Posted: 06 May 2009 05:31 PM   [ Ignore ]   [ # 45 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Thanks BloodDragon!  For those curious, sorting lines (ascending or descending), randomizing lines, and removing duplicate lines will be included in TEA beta 12 once it’s released.

I’ve also fixed the problem with boolean values getting passed as strings; for some reason I was converting all dictionary values to strings before passing them along to the act() method (this fix will also be in beta 12).

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
   
3 of 6
3