HTMLBundle.sugar 1.0.3
Posted: 22 May 2009 07:50 AM   [ Ignore ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Partially because I wanted the snippets and partially so I could test some of the features of TEA that I don’t otherwise use much, I’ve ported most of the remaining actions and snippets in the Textmate HTML Bundle into Espresso:

HTMLBundle.sugar :: direct download

TEA 1.0b18 or higher is required for this sugar.

Most of the actions that I haven’t ported yet require GUI elements, and I currently don’t have a good way to provide generalized interface to shell scripts using TEA.  This is definitely on my radar, though, so keep an eye on this sugar if you’re interested in some of the Textmate HTML functionality that isn’t included yet.

Although all of the sugar’s actions and snippets are run through TEA to take advantage of things like smart snippet indentation, you don’t need to have custom user actions enabled in order to run the sugar.  Additionally, if you’ve been wondering about porting Textmate bundle actions to Espresso via TEA, the source code may be useful.  It is, of course, freely released on GitHub for you to tweak, modify, or whatever suits your fancy.

Let me know if you have any feedback, suggestions, find any bugs, etc.!

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 22 May 2009 10:12 AM   [ Ignore ]   [ # 1 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

Already posted this in the TEA thread, as I failed to see this thread :P

BloodDragon - 22 May 2009 10:09 AM
I just tried your HTMLBundle sugar (didn’t know it existed until now) and for some weird reason, the actions from it don’t show up in the HTML menu. I do see the snippets, but just not the actions. Any idea how I can fix this?
Profile
 
 
Posted: 22 May 2009 05:10 PM   [ Ignore ]   [ # 2 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Turns out I had a malformed XML entity that somehow crept in and under my radar at the last minute and was borking the actions XML file.  Whoops.  Github source is updated as is the downloadable zip, so just redownload or do a git pull (depending on how you installed the Sugar).

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 22 May 2009 05:19 PM   [ Ignore ]   [ # 3 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

Works great now, thanks

Profile
 
 
Posted: 04 June 2009 01:48 PM   [ Ignore ]   [ # 4 ]
Member
RankRankRank
Total Posts:  75
Joined  2009-02-04

Right, I think I may be dumb here - but what does this sugar actually do?

I installed it but not sure what has happened.

I mean has it just added a bunch of options somewhere?

Profile
 
 
Posted: 04 June 2009 04:21 PM   [ Ignore ]   [ # 5 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28
Nick Toye - 04 June 2009 01:48 PM
I mean has it just added a bunch of options somewhere?

Yeah, that’s it in a nutshell.  :-)

I mainly use the HTMLBundle.sugar for the snippets.  With it installed, you can type most any tag name and hit tab to expand it into a tab-stopped snippet.  You’ll find the specific list of available tags in Actions->HTML->Snippets.  I like this better than Espresso’s built-in HTML tag snippets because you don’t have to type the opening bracket (so slightly quicker).

It also adds the following actions (all of which are located in the Actions->HTML menu):

- Entities->Decode Entities in Selection/Line
- Encrypt Selection/Line (ROT13)
- URL Escape Selection/Line
- URL Unescape Selection/Line
- Wrap in <?= ... ?>
- Strip HTML From Document/Selection

If/when I add a way for shell scripts to generate interface via TEA, I’ll also flesh it out with the remaining actions in the Textmate HTML Bundle.

It’s not the most impressive of Sugars, but I created it because:

- I wanted the Textmate-style snippets, and since other people probably will, too, adding them via Espresso’s built-in snippet capabilities wasn’t a great option
- I needed to test TEA’s shell script capabilities
- I wanted a working example of how to port a Textmate bundle to Espresso using TEA

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 09 August 2009 02:41 AM   [ Ignore ]   [ # 6 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Bumped the version to 1.0.1.  The only change is that the sugar now uses the Support folder layout introduced by JSCocoaLoader.  If you install HTMLBundle.sugar 1.0.1, make sure to install TEA 1.0b18 first.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 10 August 2009 07:04 AM   [ Ignore ]   [ # 7 ]
Sr. Member
RankRankRankRank
Total Posts:  232
Joined  2008-11-19

Super cool! I’ve been missing this stuff.

Profile
 
 
Posted: 09 October 2009 07:57 PM   [ Ignore ]   [ # 8 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Bumped the version number to 1.0.2: newest version includes one new action (Characters to Numeric Entities).  See the release notes for more details.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 25 October 2009 07:14 PM   [ Ignore ]   [ # 9 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Bumped up the version to 1.0.3.  This version includes Balance Tag (to balance XML tags regardless of whether you’re editing HTML/XML or not) and requires TEA 1.0.2.  See the release notes for more details.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 16 November 2009 10:33 AM   [ Ignore ]   [ # 10 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-07

I’m getting an error when using the decode function on UTF data which is already decoded, for example on the character: 人

Error: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xbb' in position 2: ordinal not in range(128) 

It works correctly when encoding, but the decoding gives the error above.

I would like this to work, because sometimes I have data where only a few characters are encoded, which I would like to decode.

Profile
 
 
Posted: 16 November 2009 06:18 PM   [ Ignore ]   [ # 11 ]
Moderator
RankRankRankRank
Total Posts:  1249
Joined  2008-10-28

Hm, Textmate doesn’t throw any errors, and I’m using the same action.  I’ll try to find out what the problem is.  Here’s the bug at GitHub if you want to track it:

http://github.com/onecrayon/HTMLBundle.sugar/issues/#issue/4

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile