The HTML preview action step provides a way to display HTML in a local in-app web browser. The primary use of this step is to preview content intended for the web, and is typically used along with content created in Markdown to preview the HTML output.
HTML Previews are not limited to this purpose. The content displayed can be dynamically generated, use all the tools of the browser (HTML/CSS/JavaScript), load remote content (images, scripts, stylesheets, run scripts, and even send data back to Drafts from HTML forms or other dynamic content in the page – allowing the HTML Preview step to be used to generate custom user interfaces for Drafts actions.
If you have basic skills in HTML and related technologies, this article is designed to help you utilize some of these advanced features in your actions. Possible use cases:
- Creating more complicated user input forms than can be created with Drafts Prompt scripting, which have validation or other advanced features.
- Use JavaScript library which depend on running in a browser because they utilize functions not available in Drafts JavaScript runtime (DOM, Ajax).