@@ -187,26 +187,26 @@ ◊say["Tavi"]{You also write fiction, or you used to. Do you still?} ◊say["Lorde"]{The thing is, when I write now, it comes out as songs.} } }| -@defproc[(index [heading string?] [elements xexpr?] ...) txexpr?] +@defproc[(index [#:key key string? ""] [elements xexpr?] ...) txexpr?] -Creates an entry in the keyword index under @racket[_heading] that points back to this spot in the -document. If @racket[_elements] is not empty, the web edition of the document will use it as the -contents of an understated hyperlink to back to @racket[_heading] in the keyword index. +Creates a bidirectional link between this spot in the document and an entry in the keyword index +under @racket[_key]. If @racket[_key] is not supplied, the string contents of @racket[_elements] are +used as the key. The example below will create two index entries, one under the heading “compassion” and one under the heading “cats”: @codeblock|{ #lang pollen “I have a theory which I suspect is rather immoral,” Smiley went on, more lightly. “Each of us has only a quantum of - ◊index["compassion"]{compassion}. That if we lavish our concern - on every stray ◊index["cats"] cat we never get to the centre of + ◊index{compassion}. That if we lavish our concern on every + stray ◊index[#:key "cats"]{cat} we never get to the centre of things. What do you think of it?” }| @defproc[(note [#:date date-str non-empty-string?] [#:author author string? ""]