generate-documentation.lisp 3.89 KB
Newer Older
1 2 3 4 5 6 7
;;;; -*- mode:lisp;coding:utf-8 -*-
;;;;**************************************************************************
;;;;FILE:               generate-documentation.lisp
;;;;LANGUAGE:           Common-Lisp
;;;;SYSTEM:             Common-Lisp
;;;;USER-INTERFACE:     NONE
;;;;DESCRIPTION
8
;;;;
9
;;;;    This scripts generates the on-line user documentation as HTML.
10
;;;;
11 12 13 14 15 16 17
;;;;AUTHORS
;;;;    <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
;;;;MODIFICATIONS
;;;;    2012-03-14 <PJB> Created.
;;;;BUGS
;;;;LEGAL
;;;;    AGPL3
18
;;;;
19
;;;;    Copyright Pascal J. Bourguignon 2012 - 2014
20
;;;;
21 22 23 24
;;;;    This program is free software: you can redistribute it and/or modify
;;;;    it under the terms of the GNU Affero General Public License as published by
;;;;    the Free Software Foundation, either version 3 of the License, or
;;;;    (at your option) any later version.
25
;;;;
26 27 28 29
;;;;    This program 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 Affero General Public License for more details.
30
;;;;
31
;;;;    You should have received a copy of the GNU Affero General Public License
32
;;;;    along with this program.  If not, see http://www.gnu.org/licenses/
33
;;;;**************************************************************************
34 35
(eval-when (:compile-toplevel :load-toplevel :execute)
  (setf *readtable* (copy-readtable nil)))
36
(in-package "COMMON-LISP-USER")
37 38 39 40 41 42 43 44

#+ccl (setf ccl:*default-external-format*           :unix
            ccl:*default-file-character-encoding*   :utf-8
            ccl:*default-line-termination*          :unix
            ccl:*default-socket-character-encoding* :utf-8)

(load #P"~/quicklisp/setup.lisp")

45 46 47
(setf *print-right-margin* 80
      *print-pretty* t
      *print-case* :downcase)
48

49 50 51 52 53 54 55
(defun dirpath  (path) (make-pathname :name nil   :type nil   :version nil :defaults path))
(defun wildpath (path) (make-pathname :name :wild :type :wild :version nil :defaults path))
(defun fasldir  (system component)
  (first (asdf:output-files
          (make-instance 'asdf:compile-op)
          (asdf:find-component (asdf:find-system system) component))))

56 57
(setf *default-pathname-defaults* (dirpath (or *load-truename*
                                               *compile-file-truename*)))
58
(pushnew *default-pathname-defaults* asdf:*central-registry* :test 'equal)
59 60 61 62
(push (truename (merge-pathnames "../dependencies/"
                                 *default-pathname-defaults*))
      ql:*local-project-directories*)

63 64

(defparameter *program-name* "lse")
65
(defparameter *program-system*  :com.informatimago.lse.cli)
66

67
(pushnew :debugging            *features*)
68 69 70 71 72 73 74
(pushnew :lse-case-insensitive *features*)
(pushnew :lse-unix             *features*)
(pushnew :lse-extensions       *features*)
#-(and) (pushnew :lse-mitra-15             *features*)
#-(and) (pushnew :lse-t1600                *features*)


75 76 77 78 79 80 81
(let ((dir (funcall (function #+windows wildpath #-windows dirpath)
                    (fasldir :com.informatimago.manifest "manifest"))))
  (format t "~%~A~%" dir) (finish-output)
  #+windows (mapc 'delete-file (directory dir))
  #-windows (asdf:run-shell-command "rm -rf ~S" (namestring dir)))


82 83 84
(ql:quickload *program-system*)
(ql:quickload :com.informatimago.manifest)
(ql:quickload :com.informatimago.lse.html-doc)
85
(shadow 'date)
86 87 88 89 90
(use-package "COM.INFORMATIMAGO.MANIFEST")

;;;---------------------------------------------------------------------
;;; Let's generate the target.

91

92 93
(defvar *doc-dir* *default-pathname-defaults*)
(defparameter *documentation-directory* (merge-pathnames "doc-cli/" *doc-dir*))
94

95
(format t "~%Generating ~A~%" *documentation-directory*)
96 97
(finish-output)

98
(com.informatimago.lse::generate-html-documentation *documentation-directory*)
99

100
(com.informatimago.lse.os:quit)
101
#|
102
    (cd "/home/pjb/src/pjb/nasium-lse/src/")
103 104 105
    (load "generate-documentation.lisp")
|#
;;;; THE END ;;;;