aboutsummaryrefslogtreecommitdiff
path: root/doc/dir/dir.skb
blob: 661bb936e3c295063028022323240a5a49b20fd3 (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
119
120
121
122
;;; dir.skb  --  The Skribe directory
;;;
;;; Copyright 2001, 2002, 2003, 2004  Manuel Serrano
;;;
;;;
;;; This file is part of Skribilo.
;;;
;;; Skribilo is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; Skribilo is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Skribilo.  If not, see <http://www.gnu.org/licenses/>.

;*---------------------------------------------------------------------*/
;*    The Skribe documentation style                                   */
;*---------------------------------------------------------------------*/
(skribe-load "web-book.skr")
(skribe-load "skr/env.skr")
(skribe-load "skr/manual.skr")
(skribe-load "skr/api.skr")

;*---------------------------------------------------------------------*/
;*    Html configuration                                               */
;*---------------------------------------------------------------------*/
(let ((he (find-engine 'html)))
   (engine-custom-set! he 'web-book-main-browsing-extra 
      (lambda (n e)
	 (table :width 100. :border 0 :cellspacing 0 :cellpadding 0
	    (tr (td :align 'left :valign 'top (bold "Skribe: "))
	       (td :align 'right :valign 'top
		  (ref :url *skribe-user-doc-url* 
		     :text "User Manual")))))))

;*---------------------------------------------------------------------*/
;*    The global index                                                 */
;*---------------------------------------------------------------------*/
(define *sui-index* (make-index "sui"))

;*---------------------------------------------------------------------*/
;*    index-sui ...                                                    */
;*---------------------------------------------------------------------*/
(define (index-sui sui dir)
   (sui-filter sui
	       (lambda (s) 
		  (and (pair? s) (eq? (car s) 'marks)))
	       (lambda (e) 
		  (let ((f (memq :file e))
			(k (memq :mark e))
			(c (memq :class e)))
		     (when (and (pair? f) 
				(pair? k)
				(pair? c)
				(string=? (cadr c) "public-definition"))
			(index :index *sui-index*
			   :url (format "~a/~a#~a" dir (cadr f) (cadr k))
			   (cadr k)))
		     #f))))
	     
;*---------------------------------------------------------------------*/
;*    Intern all the sui files                                         */
;*---------------------------------------------------------------------*/
(define extensions '())

(let loop ((files (directory->list "html")))
   (when (pair? files)
      (if (string=? (suffix (car files)) "sui")
	  (let* ((f (string-append "html/" (car files)))
		 (sui (load-sui f)))
	     (if (not (string=? (car files) "user.sui"))
		 (set! extensions (cons sui extensions)))
	     (index-sui sui (dirname (car files)))))
      (loop (cdr files))))
(let loop ((files (directory->list ".")))
   (when (pair? files)
      (if (string=? (suffix (car files)) "sui")
	  (let* ((f (car files))
		 (sui (load-sui f)))
	     (if (not (string=? (car files) "user.sui"))
		 (set! extensions (cons sui extensions)))
	     (index-sui sui (dirname f))))
      (loop (cdr files))))

;*---------------------------------------------------------------------*/
;*    The document                                                     */
;*---------------------------------------------------------------------*/
(document :title "Skribe directory"
   :author (list (author :name "Erick Gallesio"
		    :affiliation "Universit� de Nice - Sophia Antipolis"
		    :address '("930 route des Colles, BP 145"
			       "F-06903 Sophia Antipolis, Cedex"
			       "France")
		    :email (mailto "eg@essi.fr"))
		 (author :name "Manuel Serrano"
		    :affiliation "Inria Sophia-Antipolis"
		    :address `("2004 route des Lucioles - BP 93"
			       "F-06902 Sophia Antipolis, Cedex"
			       "France")
		    :url (ref :url *serrano-url*)
		    :email (mailto *serrano-mail*)))
   
   (linebreak 1)
   
;;; extensions
(if (pair? extensions)
    (section :title "Installed extensions" :number #f
       (itemize (map (lambda (e)
			(item :key (ref :url (sui-file e) :text (sui-title e))
			   (let ((d (sui-key e :description)))
			      (if d (list ": " d) #f))))
		     extensions))))
   
;;; global Index
(section :title "Global Markup Index" :number #f 
   (mark "global index")
   (the-index :column 3 *sui-index*)))