CSS Edit like preview

View: New views
3 Messages — Rating Filter:   Alert me  

CSS Edit like preview

by Jonathan Geiger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm looking to implement a CSS Edit like "Live Preview" either as a
Textmate Plugin (or something simpler if that's an option). The
problem of updating an HTML document loaded from anywhere is simple
Cocoa and Javascript. The part I'm struggling with is getting access
to the current textmate document as an NSString (or something else
workable).

I'm able to get access to OakTextView instance and OakDocument
instance in the plugin, but I just can't figure out how to get a copy
of the current document. xmlRepresentation is the closest I can get,
but it's not really what I want. Can anyone point me in the right
direction for that?

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: CSS Edit like preview

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 01.11.2009, at 18:03, Jonathan Geiger wrote:

> I'm able to get access to OakTextView instance and OakDocument
> instance in the plugin, but I just can't figure out how to get a copy
> of the current document. xmlRepresentation is the closest I can get,
> but it's not really what I want. Can anyone point me in the right
> direction for that?

Try:
id target = [NSApp targetForAction:@selector(document)];
NSLog(@"%@", [target stringValue]);

[ “target” is an OakTextView ]

Cheers,
--Hans

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: CSS Edit like preview

by Jonathan Geiger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excellent. Thanks alot. It's there right at the bottom of the class
dump. Can't believe I missed it.

On Sun, Nov 1, 2009 at 3:18 PM, Hans-Jörg Bibiko <bibiko@...> wrote:

>
> On 01.11.2009, at 18:03, Jonathan Geiger wrote:
>
>> I'm able to get access to OakTextView instance and OakDocument
>> instance in the plugin, but I just can't figure out how to get a copy
>> of the current document. xmlRepresentation is the closest I can get,
>> but it's not really what I want. Can anyone point me in the right
>> direction for that?
>
> Try:
> id target = [NSApp targetForAction:@selector(document)];
> NSLog(@"%@", [target stringValue]);
>
> [ “target” is an OakTextView ]
>
> Cheers,
> --Hans
>
> _______________________________________________
> textmate mailing list
> textmate@...
> http://lists.macromates.com/listinfo/textmate
>

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate