mjmlio / atom-mjml-preview

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

Is it possible to view the compiled HTML instead of just preview? #6

Closed cytsunny closed 6 years ago

cytsunny commented 7 years ago

I am wondering if it is already possible to generate preview, is it also possible to view the compiled HTML as well? Something like the "View HTML" option in the online editor?

Laslo89 commented 7 years ago

you can use storybook for that reason. https://github.com/storybooks/react-storybook and load the html file with dangerouslySetInnerHTML inside your story

If you still interesseted in such a solution, i can provide you some boilerplate code

cytsunny commented 7 years ago

Seems like it is for viewing react code? What is that do with MJML?

Laslo89 commented 7 years ago

As i mentioned you can also view plain html by using dangerouslySetInnerHTML. I am using it together with the boilerplate. It is reactive, that means you don't have to reload while coding your newsletter. The compiled HTML is shown, immediately.

barboni commented 7 years ago

@Laslo89 i'd be interested in your boilerplate. i just tried the same but mjml throws an error because it can't find my component, though it's imported.

cytsunny commented 6 years ago

In Visual Studio Code, there is already an export function.

https://github.com/attilabuti/vscode-mjml#available-commands

ngarnier commented 6 years ago

This is indeed not possible, this package only renders the file, maybe it could be an interesting separate package.

As you said, the VSCode package does that well.

drewbaker commented 4 years ago

Would love to be able to "inspect" the code, or better yet just have the preview happen in the web browser.

julesdehenin commented 3 years ago

Is there any possibility that an export of the underlying html code would be possible in Atom? The conversion of mjml to html is clearly already performed in Atom since Ctrl+Alt+P renders the html code in a side pane of Atom. Possible solutions could be: allow a "view source" in the already present browser pane that opens after Ctrl+Alt+P in Atom opening the already created html code inside Atom in the default browser, whereafter we could use the "view source" functionality if the browser