val-town-docs
val-town-docs copied to clipboard
Code blocks that allow to open them in Val Town should specify the type of a Val
Let's say there's a code block that presents how to create an API using Hono:
```ts val
import ...
// Do other stuff
```
If user will click "Open in Val Town" the new Val won't be of type HTML introducing more friction and probably confusing some new users.
Solution proposal
If supported in val.town/new it could be achieved by appropriately marking code blocks with meta:
val- the existing marking would create regular script valsval-script- explicitly specifies a script valval-http- explicitly specifies http valval-cron- scheduled valval-email- email val
It would be really easy to extract that info in the current code block processor and pass to the URL.
Excellent idea!!!