Changeset 33347 in project


Ignore:
Timestamp:
05/24/16 19:45:54 (4 years ago)
Author:
sjamaan
Message:

qwiki: Make titles links themselves so they can be used as permalink. Fixes #1288 (thanks to Wasamasa)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki-sxml.scm

    r32679 r33347  
    22;; qwiki-sxml - SXML rules and tools for qwiki
    33;;
    4 ;; Copyright (c) 2009-2015 Peter Bex and Ivan Raikov
     4;; Copyright (c) 2009-2016 Peter Bex and Ivan Raikov
    55;;
    66;;  Redistribution and use in source and binary forms, with or without
     
    242242      *macro*
    243243      . ,(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)))
    247248             (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))
    251253                   (else
    252254                    (error 'html-transformation-rules
Note: See TracChangeset for help on using the changeset viewer.