Would love an "export to html" option

hi everyone, new to the forum, am excitedly optimistic about the sourcing out of extensions for the craft platform, which is my absolute favourite writing app, the one i keep coming back to. I compose so many things using craft, i can’t praise it enough.
I have a newsletter that i write using phplist, however, which goes out in html. i compose the newsletter in craft, and also upload a version to my discourse forum (it almost renders 1 to 1) but in order to get the newsletter into phplist, i need to pass it through Bear - it’s the only app that generates html that looks halfway presentable in phplist.
it would be awesome if this functionality could be made available for craft. it would make my day absolutely.

fingers crossed!

1 Like

@BillWhammers Are you able to share more about what makes the HTML output from Bear better than other apps?

Honestly, I wish I knew.
I came to Bear as a result of a trial and error process. online markdown to html converters and even drafts doesn’t export to html in an acceptable way. The main issue is the rendering of images, while there are some other aspects of formatting. Bear might be taking into account responsivenesss and/or mobile-friendly layout, and that’s why the exports render so much better. but i am racking my brains here. If I had better info, I would let you know…

Thinking aloud, (I don’t know phplist and no longer have Bear) I wonder if there might be some css going on under the surface? Html really ought to just be the content and minimal formatting (e.g. headings of various levels, paragraphs and maybe lists) If things like text size, line length, alignment etc. are going on that is happening in css, either embedded into the html file or in a file linked to it. I’d speculate that Bear is injecting styling into its html export.

It should be perfectly possible to write an extension to do an html export, initially based on the “Send to apps” example Craft have published, with whatever styling you’d want to include. Not entirely sure how easy it would be to save it as a file, but you could probably send it to Safari and save it there.

1 Like

thanks Christopher. You’re right. Bear introduces style elements and a script element into the file. i’ve never written an extension before but i will see how far away i am from being able to do this.
Much appreciated.

I’d love it.

Craft can export to a craft.do link, but this is hosted by craft.do. I think if Craft can export a HTML file, so that I can host this page by myself.

1 Like

You can use the Craft extension and Github Markdown API to do this, got the craft’s markdown and send it to github, then you will got the HTML as result. checkout Github Markdown API to see the detail.

How do you get/export to Markdown? Right now, I have a similar issue to OP; I need to export to Markdown, but do not see an option to do so. Right now it seems like iterating over each of the blocks, and manually re-creating the Markdown manually.

Edit: Ok, found the markdown API :slight_smile: