As a kind of self-tutorial, I'm trying use Pollen to publish a test site that uses
Tufte CSS, which seems like a good candidate for Pollen since some of the markup it requires is a bit ridiculous.
The markup Tufte CSS uses for sidenotes in particular is fussy:
<label for="sn-demo" class="margin-toggle sidenote-number"></label>
<input type="checkbox" id="sn-demo" class="margin-toggle"/>
<span class="sidenote">This is a numbered sidenote. The whole thing gets types inline with the body text.</span>
I thought I might implement this with a much simpler tag, numbered-note that would be used like this:
Now is the time for all good office men to come to the aid of the republic. ◊numbered-note["n1"]{This will be in a sidenote.} In other news, Subway is infested with rodents.
However, I'm having trouble with it; I've tried several variations.
◊(define (numbered-note refid . text)
`(label [[for ,refid] [class "margin-toggle sidenote-number"]] )
`(input [[type "checkbox"] [id ,refid] [class "margin-toggle"]] )
`(span [(class "sidenote")] ,@text))
(At this early stage I'm defining everything right in the .pm file for simplicity)
Using this definition, only the <span> tag actually appears in the HTML result, and I believe I understand why; these are actually three separate X-expressions so the function simply evaluates to the last one.
However, If I try various ways of enclosing all three expressions I get errors — either “contract violation” errors or errors that expect the input and span constructs to somehow be arguments to a function named label.
I think my ultimate problem is not knowing how to generate X-expressions that represent sibling tags. For example, even if I simplify to the following:
◊(define (numbered-note refid . words) '((strong "BOOM ") (em " slide")))
—then I get a contract violation error.