emmetio / emmet

The essential toolkit for web-developers
http://emmet.io
MIT License
4.46k stars 519 forks source link

Dreamweaver support #150

Closed ryrun closed 11 years ago

ryrun commented 11 years ago

Please add dreamweaver support, like "zencoding" was before. This would be great. :+1:

liding commented 11 years ago

yes.Please add dreamweaver support!!!!

pafnuty commented 11 years ago

Ребята, неужели удобно верстать в dreamweaver? это же издевательство, а не программа, автокомплит такой, что лучше уж совсем не было. Чем DW лучше sublimetext или notepad++ в сочетании с браузером? Может я чего-то не понимаю?

ryrun commented 11 years ago

@pafnuty: in english?

pafnuty commented 11 years ago

@ryrun ~ Dreamweaver is not comfortable for a clean layout. using the sublimetext + browser got much faster and better

ryrun commented 11 years ago

@pafnuty: Maybe for you, but i'm using dreamweaver as raw code editor.

I tried to implement emmet in dw, but it fails with a "text has no properties" error in emmet code. I used the npp version of emmet plugin and the original zencoding dw plugin as base. Is there anywhere a good documentation how emmet should be implemented?

nitras commented 11 years ago

I also would love to see dreamweaver added, please! My company relies on adobe software

ryrun commented 11 years ago

I currently try to create a plugin for dreamweaver, but the javascript engine of dw seems not 100% compatible with emmet. Stuff like this dont work and need to changed in emmet:

//dont work
while( ch = stream.next() )
//need to change to
while( ( ch = stream.next() ) )

Without these extra brackets, dw will jump into the loop, when stream.next() return undefined. I'm not sure why this is needed, maybe too old javascript engine in dw?

sergeche commented 11 years ago

Yes, it might be outdated JS engine issue.

ryrun commented 11 years ago

@sergeche Is it ok, when i create some pull requests to make emmet compatible with older js engines? I would first try to get emmet working in dw and when it's done, i would report the needed code changes as pull requests.

sergeche commented 11 years ago

@ryrun yeah, sure.

Chris2011 commented 11 years ago

Would be nice if the new emmet will find his way to dreamweaver :)

Regards Chris

AliMD commented 11 years ago

:+1:

Khaleel commented 11 years ago

yes defo emmet for dreamweaver cs5 - I also use zencoding + dwcs5 for pure raw coding

keithwyland commented 11 years ago

Dreamweaver support would be fantastic! Thanks for all the work already put into Emmet and thanks to anyone who works on Dreamweaver support as well!

sergeche commented 11 years ago

Does anyone know a good resources/tutorials about how to create DW extensions? Can’t find any.

keithwyland commented 11 years ago

The zen coding dw extension actually inspired me to try making a simple character replacing DW extension recently. I ended up referencing a couple of the files in the google code repository for zen coding to get it all working. The tutorials I found we're all pretty basic, and the adobe documentation out there... Well that's when I stared referencing the zen coding files. I'll look for the links I have and hopefully post in the next day or so. (on mobile right now.) though, I guess we'll see how useful they are.

keithwyland commented 11 years ago

Here are the links I used to create a simple extension.

Adobe Extension Packaging Doco http://help.adobe.com/en_US/extensionmanager/cs/using/MXI_tech_note.pdf

Zen Coding MXI package for reference http://code.google.com/p/zen-coding/source/browse/trunk/plugins/Dreamweaver/?r=363

How to Create a Custom DreamWeaver Command http://www.hitreach.co.uk/blog/how-to-create-a-custom-dreamweaver-command/

Like I said, pretty basic stuff, so might not be to the level needed here.

Maybe if someone could get in touch with the author of the Zen Coding DW extension in the Google Code repository? (GreLImail)

ryrun commented 11 years ago

Already tried to port emmet to dw using the old zen coding plugin. Wont work, because dw using an old javascipt engine. Emmet need some code changes. Atleast for the old dream weaver 8. I've complety changed my ide to phpstorm and my developing for this plugin stopped.

keithwyland commented 11 years ago

Dreamweaver 8 is fairly old (2005). Were you able to test on CS6 or any later versions? Perhaps the latest version of DW uses a more up-to-date js engine. DW CS6 is what my employer has loaded on our machines.

Since you changed IDEs and have stopped developing for DW, do you have any files/code you could share with how far you got in attempting? Or describe the process you used with your attempts?

Thanks!

ryrun commented 11 years ago

I've uploaded my source here: https://github.com/ryrun/EmmetDW

keithwyland commented 11 years ago

Awesome! Thanks ryrun!

I packaged it up (needed to move a couple files into a new Commands dir as the MXI must have those paths defined differently) and then it installed fine.

Basic Abbreviation expanding works in CS6 but adds in ${NaN}{0} text inside the elements.

So

table.tbl>tr>td*3

produces

<table class="tbl">
    <tr>
        <td>${NaN}{0}</td>
        <td>${NaN}{0}</td>
        <td>${NaN}{0}</td>
    </tr>
</table>

Also, I tried the Grouping() example from the Emmet doco and received the error in the image below

div>(header>ul>li*2>a)+footer>p

grouping_err

My question is, were you able to even get it working to this point in DW8, or is this also where you began running into issues?

I'll be honest with anyone else watching this discussion, I am far from qualified to pick up development where ryrun left off. With much time I might be able to make some progress. :smiley: Hopefully ryrun's repo will help this along!

ryrun commented 11 years ago

Yep in dw8 you'll ge the same issues. I've changed several if statements in emmet.js, like i've mentioned before. Without these changes, nothing would happend when you hit tab. You tried CS6? Mhn, i thought a newer javascript engine would solve this, maybe CS6 is using still the same old engine ... It's bad there is no debugger in dw for extensions.

@sergeche: Maybe this is a good starting point for you. dw extensions are easy, only the js engine is bad :D

vipulism commented 11 years ago

Is this possible to make this for CS6 ?

sergeche commented 11 years ago

I made initial implementation of Dreamweaver extension: https://github.com/emmetio/dreamweaver#readme

I’ve tested it on DW CS7 (pre-release) and OSX, please let me know if it works for you.

keithwyland commented 11 years ago

Thanks for the update sergeche!! I tried it, and get the following alert box error when I first click on Commands menu, and also when trying to Expand abbreviation.

Unable to read "file:///C/Program Files/Adobe/Adobe Dreamweaver CS6/Configuration/Commands/Emmet/snippets.json" file

EDIT: I forgot to mention that basic HTML expansion appears to work after the error, though the HTML did not format itself. All on one line. Also I tested in CS6.

sergeche commented 11 years ago

I’ve updated the plugin, please try again

keithwyland commented 11 years ago

I tried every single HTML abbreviation on this page with success and no errors. http://docs.emmet.io/abbreviations/syntax/

Also tried many of the CSS abbreviations in the other doco and all have worked.

AWESOME!!! THANK YOU!

vipulism commented 11 years ago

Superb Thankyou so much :+1: :)

hiro288 commented 11 years ago

I tested it in DW CS6 on Win8, and I can expand abbreviations with command pallete, but tab trigger doesn't work. Ctrl+E opens the "tag chooser"

keithwyland commented 11 years ago

In dreamweaver the tab trigger does not work. You need to set up your own keyboard shortcuts using Edit > Keyboard shortcuts menu. The choose the emmet commands and set your own.

hiro288 commented 11 years ago

Aah thanks @keithwyland, i changed the trigger key to ctrl+tab, much better now

GreLI commented 11 years ago

Yeah, I've authored Zen Coding Dreamweaver extension based on the Zen Coding core. It had all possible features at the moment, plus some extensions like CSS completion in the HTML style attribute and multiple math expressions evaluation in the selection. But I've switched to the Sublime Text 2 in the last year and thus I'm not developing the extension. Emmet has changed greatly since then and I have no time and will to update the extension.

Ryrun is right Dreamweaver has an issue with evaluating expression to boolean. I suspect this is because it uses old Javascript 1.5 core. (from Netscape?)

There are a little free hotkeys in Dw for extensions, and installing extensions don't allow to overwrite then. However, you can remove any hotkey irrevocably with package installation, and probably set it then to your own action (never tried it really). But then you have to manage hotkey actions manually and there will be always a risk of spoiling editor default and user hotkeys.

The ‘Tab’ key worked well in the extension up to the Dw CS5. However, there are some issues with tab in CS6. Never looked into it since I have never installed Dw CS 6.

sergeche commented 11 years ago

Dreamweaver plugin is officially available: https://github.com/emmetio/dreamweaver Please post further issues into new repo