release
[closure-html.git] / src / defpack.lisp
blob7c698ecf7a441f25d2fba67eba58d0f744767e52
1 ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CL-USER; -*-
2 ;;; ---------------------------------------------------------------------------
3 ;;; Title: Package definitions for the html parser packages
4 ;;; Author: Gilbert Baumann <gilbert@base-engineering.com>
5 ;;; License: LGPL (See file COPYING for details).
6 ;;; ---------------------------------------------------------------------------
7 ;;; (c) copyright 2002 by Gilbert Baumann
9 ;;; Permission is hereby granted, free of charge, to any person obtaining
10 ;;; a copy of this software and associated documentation files (the
11 ;;; "Software"), to deal in the Software without restriction, including
12 ;;; without limitation the rights to use, copy, modify, merge, publish,
13 ;;; distribute, sublicense, and/or sell copies of the Software, and to
14 ;;; permit persons to whom the Software is furnished to do so, subject to
15 ;;; the following conditions:
16 ;;;
17 ;;; The above copyright notice and this permission notice shall be
18 ;;; included in all copies or substantial portions of the Software.
19 ;;;
20 ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 ;;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 ;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 ;;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 ;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 (in-package :cl-user)
30 (defpackage :html-glisp
31 (:use :cl)
32 (:export "ALWAYS"
33 "CL-BYTE-STREAM"
34 "CL-CHAR-STREAM"
35 "CL-STREAM"
36 "COMPOSE"
37 "CURRY"
38 "G/CLOSE"
39 "G/FINISH-OUTPUT"
40 "G/PEEK-CHAR"
41 "G/READ-BYTE"
42 "G/READ-BYTE-SEQUENCE"
43 "G/READ-CHAR"
44 "G/READ-CHAR-SEQUENCE"
45 "G/READ-LINE"
46 "G/READ-LINE*"
47 "G/UNREAD-BYTE"
48 "G/UNREAD-CHAR"
49 "G/WRITE-BYTE"
50 "G/WRITE-BYTE-SEQUENCE"
51 "G/WRITE-CHAR"
52 "G/WRITE-STRING"
53 "GSTREAM"
54 "MULTIPLE-VALUE-OR"
55 "RCURRY"
56 "UNTIL"
57 "USE-BYTE-FOR-CHAR-STREAM-FLAVOUR"
58 "USE-CHAR-FOR-BYTE-STREAM-FLAVOUR"
59 "WHILE"
60 "WHITE-SPACE-P"
62 "CL-BYTE-STREAM->GSTREAM"
63 "CL-CHAR-STREAM->GSTREAM"
65 "MAYBE-PARSE-INTEGER"))
67 (defpackage :closure-mime-types
68 (:use :cl :html-glisp ;; white-space-p
70 (:export #:parse-mime-content-type ;### yet to be defined
71 #:find-mime-type-from-extension
72 #:mime-type-name
73 #:find-mime-type
74 #:mime-type-equal
75 #:mime-type-extensions))
77 (defpackage :sgml
78 (:use :cl :html-glisp :runes)
79 (:export #:SGML-PARSE
80 #:PT
81 #:PPT
82 #:SGML-UNPARSE
83 #:PARSE-DTD
84 #:*OPTIONS/PARSER-SILENT-P*
85 #:PT-NAME
86 #:PT-CHILDREN
87 #:PT-PARENT
88 #:PT-ATTRS
89 #:SLURP-CATALOG
90 ;; in pt-utils:
91 #:map-pt
92 #:pt-cdata
93 #:pt-attr
94 #:pt-root
95 #:pt-root-property
96 #:gi
97 #:flat-find-element
98 #:flat-find-elements
99 #:pt-full-name-path
100 #:lhtml->pt
102 #:html-parse-file
105 (defpackage :closure-html
106 (:use :cl :runes)
107 (:nicknames :chtml)
108 (:use :sgml)
109 (:export #:*html-dtd*
110 #:parse
112 #:make-octet-vector-sink
113 #:make-octet-stream-sink
114 #:make-rod-sink
115 #+rune-is-character #:make-character-stream-sink
116 #-rune-is-character #:make-string-sink/utf8
117 #-rune-is-character #:make-character-stream-sink/utf8
118 #+rune-is-character #:make-string-sink
120 #:with-html-output
121 #:with-output-sink
122 #:with-element
123 #:attribute
124 #:text
125 #:comment
127 #:pt-builder
128 #:make-pt-builder
129 #:serialize-pt
131 #:pt
132 #:pt-name
133 #:pt-children
134 #:pt-parent
135 #:pt-attrs
137 #:lhtml-builder
138 #:make-lhtml-builder
139 #:serialize-lhtml)
140 (:documentation
141 "This package exports functions for HTML parsing and serialization.
143 In addition, two simple in-memory data structures are included: LHTML, a
144 lisp-list model. And PT, a simple structure instance model used by
145 Closure internally.
147 @begin[Parsing]{section}
148 @aboutfun{parse}
149 @end{section}
150 @begin[Serialization sinks]{section}
151 @aboutfun{make-octet-vector-sink}
152 @aboutfun{make-octet-stream-sink}
153 @aboutfun{make-rod-sink}
154 @aboutfun{make-character-stream-sink}
155 @aboutfun{make-string-sink}
156 @end{section}
157 @begin[Convenience serialization API]{section}
158 @aboutmacro{with-html-output}
159 @aboutmacro{with-element}
160 @aboutmacro{with-output-sink}
161 @aboutfun{attribute}
162 @aboutfun{text}
163 @aboutfun{comment}
164 @end{section}
165 @begin[LHTML model]{section}
166 @aboutfun{make-lhtml-builder}
167 @aboutfun{serialize-lhtml}
168 @end{section}
169 @begin[PT model]{section}
170 @aboutfun{make-pt-builder}
171 @aboutfun{serialize-pt}
172 @aboutfun{pt-name}
173 @aboutfun{pt-children}
174 @aboutfun{pt-parent}
175 @aboutfun{pt-attrs}
176 @end{section}"))