Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Extending Emmet via third-party Atom packages #206

Open
patrick-steele-idem opened this issue Feb 9, 2015 · 4 comments
Open

Extending Emmet via third-party Atom packages #206

patrick-steele-idem opened this issue Feb 9, 2015 · 4 comments

Comments

@patrick-steele-idem
Copy link

patrick-steele-idem commented Feb 9, 2015

Marko is an HTML-based templating language that extends the HTML grammar and we have an Atom package to support the Marko templating language: https://atom.io/packages/language-marko

I would like to be able to provide automatic support for Emmet when using Marko (Marko just extends HTML), but currently that does not seem to be possible. Specifically, I would like to be able to enable the following:

To overcome this problems I had to manually update my local ~/emmet/snippets.json file to include additional Marko snippets. In addition, I had to manually update my keymap.cson to include the following:

'atom-text-editor[data-grammar~="marko"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

Having to ask every developer to do these steps is problematic and unreliable. Is there a better solution?

Thanks in advance.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Solido
Copy link

Solido commented Feb 21, 2015

Marko is now my de-facto JS template and I'll be glad to have emmet support it.
+1 on this request !

@philidem
Copy link

👍

@sergeche
Copy link
Member

I like the idea. You can extend Emmet in run-time, see https://github.com/emmetio/emmet/blob/master/lib/emmet.js#L171
The only thing you have to do is to expose emmet object in package: https://github.com/emmetio/emmet-atom/blob/master/lib/emmet.coffee#L124

About keyboard shortcuts: you can add 'tab': 'emmet:expand-abbreviation-with-tab' shortcut into your packages’ keymap file. But I don’t know how Atom will behave if there’s no Emmet plugin installed

@patrick-steele-idem
Copy link
Author

Thanks, @sergeche, for the pointers. So it looks like a good solution would be to update emmet-atom to export a reference to the internal emmet module. I could then update the language-marko package to get a reference to the instance of the emmet-atom package to register the additional Emmet snippets.

As for keyboard shortcuts, I will try out adding 'tab': 'emmet:expand-abbreviation-with-tab' and see how that goes.

Sound like a good plan? If so, I'll plan on sending a PR to export the emmet module.

Thanks again for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants