Ticket #197: qwiki-titles.diff
File qwiki-titles.diff, 2.6 KB (added by , 14 years ago) |
---|
-
qwiki.scm
58 58 59 59 (import chicken scheme) 60 60 (use extras files posix ports data-structures srfi-1 srfi-13 srfi-14 61 intarweb uri-common spiffy sxml-transforms 61 intarweb uri-common spiffy sxml-transforms sxpath 62 62 wiki-parse qwiki-sxml doctype 63 63 ;; There should be a way to parameterize the versioning implementation 64 64 qwiki-svn) … … 297 297 (if (file-exists? source-file) 298 298 (if rev 299 299 (send-content ; Do not store if old rev 300 (qwiki-sxml-page-template 301 (call-with-input-revision 302 source-file rev wiki-parse))) 300 (let* ((sxml (call-with-input-revision source-file rev wiki-parse)) 301 (title ((sxpath '(// (Section 1) *text*)) (cons 'root sxml)))) 302 (qwiki-sxml-page-template 303 sxml `((title . ,(sprintf "~A (historical revision ~A)" 304 (if (null? title) 305 path 306 (car title)) 307 rev)))))) 303 308 (begin 304 309 (when (or (not (file-exists? html-path)) 305 310 (file-newer? source-file html-path)) … … 312 317 313 318 ;; Generate new cached HTML file 314 319 (define (regenerate-html-file! path page) 315 (let ((html-file (make-pathname (qwiki-web-path) (path->html-filename path)))) 320 (let* ((html-file (make-pathname (qwiki-web-path) (path->html-filename path))) 321 (title ((sxpath '(// (Section 1) *text*)) (cons 'root page)))) 316 322 (with-output-to-path html-file 317 323 (lambda () 318 (let ((content (qwiki-sxml-page-template page))) 324 (let ((content (qwiki-sxml-page-template 325 page `((title . ,(if (null? title) 326 path 327 (car title))))))) 319 328 (output-xml content (qwiki-transformation-steps content))))))) 320 329 321 330 (define (qwiki-update-file! path) -
qwiki.meta
1 1 ((synopsis "qwiki - the quick wiki") 2 2 (depends matchable wiki-parse intarweb uri-common spiffy (doctype "1.2") 3 (sxml-transforms "1.4") multidoc (svn-client "0.11") estraier-client) 3 (sxml-transforms "1.4") multidoc (svn-client "0.11") estraier-client 4 sxpath) 4 5 (author "Peter Bex") 5 6 (category www) 6 7 (license "BSD")