summaryrefslogtreecommitdiff
path: root/doc/user/src/html-navtabs.skb
blob: 27701d41a977cb127439822811db782c54007d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
;*---------------------------------------------------------------------*/
;*    Skribilo's `html-navtabs' package                                */
;*---------------------------------------------------------------------*/
(use-modules (skribilo package html-navtabs)
	     (srfi srfi-1))

;*---------------------------------------------------------------------*/
;*    HTML customization                                               */
;*---------------------------------------------------------------------*/
(let* ((he     (find-engine 'html))
       (oldh   (markup-writer-get '&html-chapter-header he))
       (colors (circular-list "#ffb643" "#de8bff")))
   ;; re-bindings
   (markup-writer '&html-chapter-header he
      :options 'all
      :predicate (lambda (n e)
		    (is-markup? (ast-parent n) 'chapter))
      :action (lambda (n e)
		 (engine-custom-set! e 'left-margin-background (car colors))
		 (set! colors (cdr colors))
		 (output n e oldh))))

;*---------------------------------------------------------------------*/
;*    menu ...                                                         */
;*---------------------------------------------------------------------*/
(define-markup (menu e #!rest opt #!key title)
   (table :width 95. :border 1 :cellpadding 0 :cellspacing 0
      :class "menu"
      (tr :bg (engine-custom e 'title-background) 
	 (th (color :fg (engine-custom e 'background) (bold title))))
      (tr :bg (engine-custom e 'background) 
	 (td (the-body opt)))))

;*---------------------------------------------------------------------*/
;*    linux                                                            */
;*---------------------------------------------------------------------*/
(define (linux n e)
   (menu e
	 :title "Linux"
	 (apply table :width 100. :border 0 :class "linux"
		(tr (td :align 'left :valign 'top (bold "Linux")))
		(map (lambda (l)
			(tr (td :align 'left :valign 'top  l)))
		     (list (ref :url "http://www.kernel.org/" 
			      :text "Linux kernel")
			   (ref :url "http://www.gentoo.org/"
			      :text "Gentoo")
			   (ref :url "http://www.debian.org/"
			      :text "Debian")
			   (ref :url "http://www.redhat.org/"
			      :text "Red Hat")
			   (ref :url "http://www.mandrake.org/"
			      :text "Mandrake"))))))

;*---------------------------------------------------------------------*/
;*    HTML customizations                                              */
;*---------------------------------------------------------------------*/
(let ((he (find-engine 'html)))
   (engine-custom-set! he 'favicon "icons/serrano.gif")
   (engine-custom-set! he 'left-margin-size 25.)
   (engine-custom-set! he 'left-margin
		       (lambda (n e)
			  (list (center (linux n e)))))
   (engine-custom-set! he 'javascript #t)
   (engine-custom-set! he 'head "div.skribetitle {
    padding-top: 40;
  }
  div.skribetitle td {
    font-size: xx-large;
    font-weight: bold;
    font-style: oblique;
  }
  body {
    border: 1px;
    border-color: black;
    border-style: inset;
    margin: 0;
    padding: 0;
  }
  div.navtabs-bar form {
    border: 0 0 0 0;
    padding: 2px 2px 2px 2px;
    margin: 2px 2px 2px 2px;
    clear: none;
    display: inline;
  }
  div.navtabs-bar select {
    margin: 2px 2px 2px 2px;
    font-family: Arial,Helvetica,sans-serif; 
    font-size: small;
  }
"))

;*---------------------------------------------------------------------*/
;*    The title                                                        */
;*---------------------------------------------------------------------*/
(define title
   (table :width 100. :cellpadding 10. 
      (tr (td :align 'center (image :file "linux.png"))
	 (td :align 'left [Skribilo ,(tt [html-navtabs]) Sample]))))

;*---------------------------------------------------------------------*/
;*    The document                                                     */
;*---------------------------------------------------------------------*/
(document :title title :html-title "html-navtabs"
   :html-tabs-bar 
   (table (tr (td :align 'right "a two-lines table"))
      (tr (td :align 'right "yep")))
   
   (section :title "Foo" :number #f (p [The in-line foo section]))
   
   (chapter :title "Bar" :file #t
      :html-tabs-bar [This is the bar chapter]
      (p [Yehhh.]))
   (chapter :title "Gee" :file #t
      :html-tabs-bar [This is the gee chapter]
      (p ":-)")))