atom-mjml-preview icon indicating copy to clipboard operation
atom-mjml-preview copied to clipboard

Feature request - support other file extensions

Open drewbaker opened this issue 4 years ago • 4 comments

Currently I have to store the templates as .hbs so that I can inject variables into them. To render the preview, I need to rename the file to .mjml, then I rename it again once I'm finished. Is there a way to have the preview open on other file extensions?

I tried selecting the file, then using Packages > mjm-preview > MJML Preview but it still doesn't work.

drewbaker avatar Jul 11 '20 18:07 drewbaker

Did you tried to keep both extension .hbs.mjml ?

iRyusa avatar Jul 11 '20 19:07 iRyusa

Yes that works. But it's not ideal. Would be great if there was a setting in the package that allowed us to edit the file extensions that the preview panel monitored, or at least a way to tell the preview panel to attempt to render a selected file?

drewbaker avatar Jul 12 '20 02:07 drewbaker

The extension is a bit old so IDK how easy that would be to do so. I think if you change the grammar as MJML even if the file doesn't have MJML extension that would work https://github.com/mjmlio/atom-mjml-preview/blob/master/lib/mjml-preview.js#L52

iRyusa avatar Aug 04 '20 14:08 iRyusa

OK will check that out thanks

drewbaker avatar Aug 04 '20 19:08 drewbaker