8.14
3.4 Conscript Cookbook
What follows are a bunch of “recipes” or how-tos that explain how to accomplish common tasks when writing Conscript studies.
These how-tos don’t directly explain everything, but they do give links to more information, including the links in the code samples themselves.
3.4.1 How to add links
To provide a link on a study page, use the anchor tag a:
(defstep (links) @md{# Links A link to the @a[#:href "https://example.com/"]{another site}. Sometimes you want a link to open in a new tab, so you provide the attribute `target` with the value `"_blank"`: @a[#:href "https://example.com" #:target "_blank"]{Open in new tab} })
3.4.2 How to display monetary amounts
To display monetary amounts, first require the module conscript/survey-tools which provides ~$ for dollars, ~euro for euros, or ~pound for pounds:
(require conscript/survey-tools) (define (payments) (define bonus 4.25) @md{# Bonus Your bonus is @(~$ bonus). })