bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2a4c8209b26f7df07c6e89a4187b04f5f7cd1105
parent 84c53e5ada85aa64a9a64ae7ad5e43a80cb6dca3
Author: Eli Barzilay <eli@racket-lang.org>
Date:   Sun,  6 Jul 2008 05:00:26 +0000

* Removed `contents' and `index' links
* Don't show `top' link when there is none (fine now since the above
  are gone)
* Don't show right side of navbar when there are no links in it (which
  is only at the start page)

svn: r10628

original commit: 45b2141fa25ebdc8f48b932cf5e4d09e9eca1879

Diffstat:
Mcollects/scribble/html-render.ss | 81++++++++++++++++++++++++++++++++++++++++++-------------------------------------
1 file changed, 43 insertions(+), 38 deletions(-)

diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss @@ -605,7 +605,8 @@ (let ([d (last subs)]) (and (part-style? d 'index) d)))))))) - (define (render . content) (render-content content d ri)) + (define (render . content) + (render-content (filter values content) d ri)) (define (titled-url label x #:title-from [tfrom #f] . more) (define-values (url title) (cond [(part? x) @@ -640,44 +641,48 @@ `(span ([class "navleft"]) ,search-box ,@(render - sep-element - (make-element (if up-path top-link "nonavigation") top-content) - sep-element - (make-element - (if parent (make-target-url "index.html" #f) "nonavigation") - contents-content) - sep-element - (if (or (not index) (eq? d index)) - (make-element "nonavigation" index-content) - (make-link-element #f index-content (car (part-tags index))))))) + (and up-path sep-element) + (and up-path (make-element top-link top-content)) + ;; sep-element + ;; (make-element + ;; (if parent (make-target-url "index.html" #f) "nonavigation") + ;; contents-content) + ;; sep-element + ;; (if (or (not index) (eq? d index)) + ;; (make-element "nonavigation" index-content) + ;; (make-link-element #f index-content (car (part-tags index)))) + ))) (define navright - `(span ([class "navright"]) - ,@(render - (make-element - (cond [(not parent) "nonavigation"] - [prev (titled-url "backward" prev)] - [else (titled-url "backward" "index.html" - #:title-from - (and (part? parent) parent))]) - prev-content) - sep-element - (make-element - (cond - [(and (part? parent) (toc-part? parent) (part-parent parent ri)) - (titled-url "up" parent)] - [parent (titled-url "up" "index.html" #:title-from parent)] - ;; up-path = #t => go up to the start page, using - ;; cookies to get to the user's version of it (see - ;; scribblings/main/private/utils for the code that - ;; creates these cookies.) - [(eq? #t up-path) top-link] - [up-path (titled-url "up" up-path)] - [else "nonavigation"]) - up-content) - sep-element - (make-element - (if next (titled-url "forward" next) "nonavigation") - next-content)))) + (if (not (or parent up-path next)) + "" + `(span ([class "navright"]) + ,@(render + (make-element + (cond [(not parent) "nonavigation"] + [prev (titled-url "backward" prev)] + [else (titled-url "backward" "index.html" + #:title-from + (and (part? parent) parent))]) + prev-content) + sep-element + (make-element + (cond + [(and (part? parent) (toc-part? parent) + (part-parent parent ri)) + (titled-url "up" parent)] + [parent (titled-url "up" "index.html" #:title-from parent)] + ;; up-path = #t => go up to the start page, using + ;; cookies to get to the user's version of it (see + ;; scribblings/main/private/utils for the code that + ;; creates these cookies.) + [(eq? #t up-path) top-link] + [up-path (titled-url "up" up-path)] + [else "nonavigation"]) + up-content) + sep-element + (make-element + (if next (titled-url "forward" next) "nonavigation") + next-content))))) (define navbar `(div ([class "navset"] [style ,(let ([v (if top? 'bottom 'top)])