I am actively developing some scripts and actions in Drafts that use the HTML Preview Action.
The underling topic - how to set it up and a good HTML document should be created and a great reply by @chrillek - brought me to the following article:
I had to read with some astonishment that the practice of many tutorials to put Java Script inside the body of the HTML document is really bad practice and might even be the reason for some of the things I hate so much in web-apps or on webpages.
As noted in my article
I am looking for a good and compact way to facilitate HTML Preview with my different ideas. The goal would be two fold:
- Generate good and nice HTML documents (with much Java Script)
- Have simple and compact templates in the Draft action (with template tags)
As I read the article about the
EventListener the practice of Java Script in the body could be completely abandoned by using the
During generation the HTML Preview is not very talkative if a parse/specific error occurs. The
error event might be a nice way to give the developer more details on the reason of the script.