Revision: 27961
Updated Code
at June 28, 2010 18:01 by tprimke
Updated Code
;; checks the given line and updates TOC data (define (update-toc line) (define (append-toc content level) (unless (> level SETUP:toc-level) (while (> level TOC:lvl) (push "<ul>" TOC:toc) (++ TOC:lvl)) (while (< level TOC:lvl) (push "</ul>" TOC:toc) (-- TOC:lvl)) (push (append SETUP:toc-elm-start {<a href="#a} (string TOC:anchor) {">} content {</a>} SETUP:toc-elm-end) TOC:toc))) (cond ((find "======(.*)======" line 512) (append-toc $1 5)) ((find "=====(.*)=====" line 512) (append-toc $1 4)) ((find "====(.*)====" line 512) (append-toc $1 3)) ((find "===(.*)===" line 512) (append-toc $1 2)) ((find "==(.*)==" line 512) (append-toc $1 1)) ((find {\[toc\]} line 512) (set 'TOC:found true)) ))
Revision: 27960
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 28, 2010 17:50 by tprimke
Initial Code
;; checks the given line and updates TOC data (define (update-toc line) (define (append-toc content level) (unless (> level SETUP:toc-level) (while (> level TOC:lvl) (push "<ul>" TOC:toc) (++ TOC:lvl)) (while (< level TOC:lvl) (push "</ul>" TOC:toc) (-- TOC:lvl)) (push (append SETUP:toc-elm-start {<a href="#a} (string TOC:anchor) {">} content {</a>} SETUP:toc-elm-end) TOC:toc))) (cond ((find "======(.*)======" line 512) (append-toc $1 5)) ((find "=====(.*)=====" line 512) (append-toc $1 4)) ((find "====(.*)====" line 512) (append-toc $1 3)) ((find "===(.*)===" line 512) (append-toc $1 2)) ((find "==(.*)==" line 512) (append-toc $1 1)) ((find {\[toc\]} line 512) (set 'TOC:found true)) ))
Initial URL
Initial Description
Initial Title
Update the TOC context
Initial Tags
Initial Language
Lisp