Something I've been running on- and off again in my career, especially during freelance stints is that it's been annoying to describe forms in a portable format.
If you use markup, HTML alone is not very expressive and is missing some fairly common use-cases, and the JSX snippets of existing UI frameworks aren't very portable. JSON-Schema is more expressive in terms of describing the shape of the result, but json-schema alone is usually not enough information to build a user-friendly form.
I've created a few versions of this DSL over the years but finally decided to try and take it a bit further.
My hope is that people like this and build implementations of this spec for a variety of frontend and traditional frameworks.
I know this will not cover every application's use case and it's not meant to supplant general application forms, but I especially think this will be useful for cases where you want your users to be able to create forms.
Feedback very welcome, especially if you have ideas on how to make the markup itself be more readable!
I like it. Brief and concentrates on defining the form without any verbosity.
Do you have any plans for describing some basic constraints like a number range or a field should only accept dates after X. Im asking because as a markup for a form builder its very nice but its missing the next level of validation constraints.
No, there not really an extension system. I kind of consider the html renderer more of an example implementation, and assume people would want to build implementations in their framework of choice, but I can totally see it would be nice for people to define their own question types and hook into the renderer / validator.
Something I've been running on- and off again in my career, especially during freelance stints is that it's been annoying to describe forms in a portable format.
If you use markup, HTML alone is not very expressive and is missing some fairly common use-cases, and the JSX snippets of existing UI frameworks aren't very portable. JSON-Schema is more expressive in terms of describing the shape of the result, but json-schema alone is usually not enough information to build a user-friendly form.
I've created a few versions of this DSL over the years but finally decided to try and take it a bit further.
My hope is that people like this and build implementations of this spec for a variety of frontend and traditional frameworks.
I know this will not cover every application's use case and it's not meant to supplant general application forms, but I especially think this will be useful for cases where you want your users to be able to create forms.
Feedback very welcome, especially if you have ideas on how to make the markup itself be more readable!
I like it. Brief and concentrates on defining the form without any verbosity.
Do you have any plans for describing some basic constraints like a number range or a field should only accept dates after X. Im asking because as a markup for a form builder its very nice but its missing the next level of validation constraints.
Yeah! this is mostly already supported:
I didn't want to pack everything on the homepage example, but there's more examples in the form builder.Also see:
https://askdown.dev/spec#4-question-types
Is it possible to plugin custom types or validator functions ?
No, there not really an extension system. I kind of consider the html renderer more of an example implementation, and assume people would want to build implementations in their framework of choice, but I can totally see it would be nice for people to define their own question types and hook into the renderer / validator.
Is there a github ?
future star & follow.
Yep! https://github.com/askdown