Ticket #1288: section-permalink.patch
File section-permalink.patch, 1.2 KB (added by , 9 years ago) |
---|
-
qwiki-sxml.scm
a b 241 241 (section 242 242 *macro* 243 243 . ,(lambda (tag elems) 244 (let ((level (car elems)) 245 (head-word (cadr elems)) 246 (contents (cddr elems))) 244 (let* ((level (car elems)) 245 (head-word (cadr elems)) 246 (link (internal-link head-word)) 247 (contents (cddr elems))) 247 248 (cond ((and (integer? level) head-word) 248 `((,(string->symbol (string-append "h" (number->string level))) 249 (@ (id ,(internal-link head-word))) 250 ,head-word ) . ,contents)) 249 `((a (@ (href (,@(string-append "#" link)))) 250 (,(string->symbol (string-append "h" (number->string level))) 251 (@ (id ,link)) 252 ,head-word)) . ,contents)) 251 253 (else 252 254 (error 'html-transformation-rules 253 255 (conc "section elements must be of the form (section level head-word . contents), got " elems)))))))