3 ms·
It looks like it could be made leaner. This: name* = TextInput( | question = What is your name? | description = Let's get start
by mg 2y ago
It looks like it could be made leaner.
This:
name* = TextInput(
| question = What is your name?
| description =
Let's get started with the survey. First, please tell
us your full legal name according to your passport.
)
Could be just this:
name* = TextInput
# What is your name?
Let's get started with the survey. First, please tell
us your full legal name according to your passport.
- steve_adams_86 2y agoBut then how would you support choices or conditions for example?
- notpushkin 2y agoMaybe something like this for choices? fruits = MultiChoiceInput # What are your favourite fruits? - [ ] Apples - [ ] Oranges - [ ] Bananas Personally I'd prefer good old MDX though: <MultiChoiceInput name="fruits" hideIf={name.value !== "FruitLover"} options={["Apples", "Oranges", "Bananas]} />
- mg 2y agoWell, you can define the syntax however you like in a new DSL, right? I like the syntax notpushkin proposed and would extend it a bit like this: fruits* = MultiChoiceInput # Pick two out of three fruits Fruits are healthy, so let's pick two fruits you will eat every morning for the coming week - [ ] Apple - [ ] Orange - [ ] Banana
- Terretta 2y agoAll such text markup DSLs were invented at least once on usenet.