You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing templates to render instructions for our students. Right now it's done using naive string replacement, and so I'm using elm-markup to make something a little more robust. A sample template might start like Good job, {{NAME}}!, which I've translated to Good job, []{studentName}!.
One reason I'm doing this is because we want to give our curriculum department the ability to insert links to more detailed lessons in the middle of the instruction text. I've got that working ([See an example]{lesson|id=2}.)
While I was doing this, I wanted to add a way to optionally set an icon in the button link. That doesn't look like it's possible right now! It seems like there are no optional fields in records. I'd like to be able to do that for some other things I have planned, so I thought I'd open an issue and ask.
Problem
I am writing templates to render instructions for our students. Right now it's done using naive string replacement, and so I'm using elm-markup to make something a little more robust. A sample template might start like
Good job, {{NAME}}!
, which I've translated toGood job, []{studentName}!
.One reason I'm doing this is because we want to give our curriculum department the ability to insert links to more detailed lessons in the middle of the instruction text. I've got that working (
[See an example]{lesson|id=2}
.)While I was doing this, I wanted to add a way to optionally set an icon in the button link. That doesn't look like it's possible right now! It seems like there are no optional fields in records. I'd like to be able to do that for some other things I have planned, so I thought I'd open an issue and ask.
Suggestion
I would like something like:
which, for
annotation "x" identity |> optionalField "field" int
, would mean:[]{x|field=1}
Success (Just 1)
[]{x}
Success Nothing
[]{x|field=foo}
Failure …
verify
would only run if the value is present, and would cause failure normally.The text was updated successfully, but these errors were encountered: