3 ;;;; "Lisp as scripting language -- discuss"
5 ;;;; Generate contrib-docs.texi-temp from any texinfo files found in
6 ;;;; the contrib/ sub-tree.
8 (defun nodename (texi-file)
9 (with-open-file (f texi-file
)
10 (loop for line
= (read-line f
)
12 do
(let ((index (search "@node" line
)))
15 (subseq line
(+ index
1 (length "@node"))))))))
16 (error "No `@node' line found in file ~A" texi-file
))
18 (let ((texi-files (directory "../../contrib/**/*.texinfo")))
19 (with-open-file (out "contrib-doc-list.texi-temp" :direction
:output
20 :if-does-not-exist
:create
:if-exists
:supersede
)
21 (write-string "@c -*- texinfo -*-
23 @c Include documentation for contrib modules.
24 @c This is a generated file - do not edit!
27 (write-line "@menu" out
)
28 (dolist (texi-file texi-files
)
29 (let ((nodename (nodename texi-file
)))
30 (format out
"* ~A::~%" nodename
)))
31 (write-line "@end menu" out
)
33 (dolist (texi-file texi-files
)
34 (format out
"@page~%@include ~A~%"
35 (namestring (make-pathname
36 :directory
(list* :relative
:up
:up
38 (pathname-directory texi-file
) 2))
39 :name
(pathname-name texi-file
)
40 :type
(pathname-type texi-file
)))))))