mjmlio / atom-mjml-preview

MJML preview in Atom
https://atom.io/packages/mjml-preview
MIT License
20 stars 4 forks source link

Feature request - support other file extensions #25

Open drewbaker opened 4 years ago

drewbaker commented 4 years ago

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.

iRyusa commented 4 years ago

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

drewbaker commented 4 years ago

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?

iRyusa commented 4 years ago

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

drewbaker commented 4 years ago

OK will check that out thanks