Return to Snippet

Revision: 27965
at June 28, 2010 18:06 by tprimke


Updated Code
;; applies all the changes needed to properly display (or not) TOC
(define (finalize-toc)
  (if TOC:found
    (begin
      (push SETUP:toc-end TOC:toc)
      (reverse TOC:toc)
      (let ( str-toc  (join TOC:toc "") )
        (replace {\[toc\]} page str-toc 512)
        (replace {\[TOC\]</a>\[TOC\]} page "</a>" 512)
        (replace {\[TOC\]<a name(.*)\[TOC\]} page (append "<a name" $1) 512)))
    (begin
      (replace {\[TOC\]</a>\[TOC\]} page "" 512)
      (replace {\[TOC\]<a name.*\[TOC\]} page "" 512))))

Revision: 27964
at June 28, 2010 17:57 by tprimke


Initial Code
;; applies all the changes needed to properly display (or not) TOC
(define (finalize-toc)
  (if TOC:found
    (begin
      (push SETUP:toc-end TOC:toc)
      (reverse TOC:toc)
      (let ( str-toc  (join TOC:toc "") )
        (replace {\[toc\]} page str-toc 512)
        (replace {\[TOC\]&lt;/a&gt;\[TOC\]} page "&lt;/a&gt;" 512)
        (replace {\[TOC\]&lt;a name(.*)\[TOC\]} page (append "&lt;a name" $1) 512)))
    (begin
      (replace {\[TOC\]&lt;/a&gt;\[TOC\]} page "" 512)
      (replace {\[TOC\]&lt;a name.*\[TOC\]} page "" 512))))

Initial URL


Initial Description


Initial Title
Applies all the TOC-related changes to content

Initial Tags


Initial Language
Lisp