* 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
This commit is contained in:
Eli Barzilay 2008-07-06 05:00:26 +00:00
parent 84c53e5ada
commit 2a4c8209b2

View File

@ -605,7 +605,8 @@
(let ([d (last subs)]) (let ([d (last subs)])
(and (part-style? d 'index) (and (part-style? d 'index)
d)))))))) 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 (titled-url label x #:title-from [tfrom #f] . more)
(define-values (url title) (define-values (url title)
(cond [(part? x) (cond [(part? x)
@ -640,17 +641,20 @@
`(span ([class "navleft"]) `(span ([class "navleft"])
,search-box ,search-box
,@(render ,@(render
sep-element (and up-path sep-element)
(make-element (if up-path top-link "nonavigation") top-content) (and up-path (make-element top-link top-content))
sep-element ;; sep-element
(make-element ;; (make-element
(if parent (make-target-url "index.html" #f) "nonavigation") ;; (if parent (make-target-url "index.html" #f) "nonavigation")
contents-content) ;; contents-content)
sep-element ;; sep-element
(if (or (not index) (eq? d index)) ;; (if (or (not index) (eq? d index))
(make-element "nonavigation" index-content) ;; (make-element "nonavigation" index-content)
(make-link-element #f index-content (car (part-tags index))))))) ;; (make-link-element #f index-content (car (part-tags index))))
)))
(define navright (define navright
(if (not (or parent up-path next))
""
`(span ([class "navright"]) `(span ([class "navright"])
,@(render ,@(render
(make-element (make-element
@ -663,7 +667,8 @@
sep-element sep-element
(make-element (make-element
(cond (cond
[(and (part? parent) (toc-part? parent) (part-parent parent ri)) [(and (part? parent) (toc-part? parent)
(part-parent parent ri))
(titled-url "up" parent)] (titled-url "up" parent)]
[parent (titled-url "up" "index.html" #:title-from parent)] [parent (titled-url "up" "index.html" #:title-from parent)]
;; up-path = #t => go up to the start page, using ;; up-path = #t => go up to the start page, using
@ -677,7 +682,7 @@
sep-element sep-element
(make-element (make-element
(if next (titled-url "forward" next) "nonavigation") (if next (titled-url "forward" next) "nonavigation")
next-content)))) next-content)))))
(define navbar (define navbar
`(div ([class "navset"] `(div ([class "navset"]
[style ,(let ([v (if top? 'bottom 'top)]) [style ,(let ([v (if top? 'bottom 'top)])