templ icon indicating copy to clipboard operation
templ copied to clipboard

Proposal: templ website and playground

Open a-h opened this issue 2 years ago • 0 comments

It might be useful to have a templ playground so that people can share snippets of code and try out using templ without having to install it first.

It would need to have the following features:

  • A place to write Go code for the input struct definition, input data, and any helper functions, e.g. date formatting.
  • A place to write a templ file, which will take the input, e.g.:
{% templ Display(in Input) %}
{% endtempl %}
  • Output areas to display the generated HTML code, and the HTML as displayed in the browser.
  • A "Run" button to click to format the code and execute it.
    • Since it's basically going to execute arbitrary code, it would need to run in a Lambda or similar to prevent abuse.
    • Running in a Lambda would require the templ executable to be installed in the Lambda.
  • A "Share" button that creates a shareable web link.
    • This supposes the idea of a backing database, e.g. DynamoDB.

a-h avatar Mar 20 '22 16:03 a-h