Commit 58cd4dd6 authored by Marco Antoniotti's avatar Marco Antoniotti 💬
Browse files

Fixed a few documentation strings.

parent a7dfc179
...@@ -25,10 +25,14 @@ ...@@ -25,10 +25,14 @@
(defstruct (element (defstruct (element
(:constructor %element) (:constructor %element)
) )
"The ELEMENT Structure." "The ELEMENT Structure.
(tag nil :type symbol)
(attributes () :type list) This structure represents a minimal 'XML' element with a TAG, a (LIST)
content) of ATTRIBUTES and relative CONTENT."
(tag nil :type symbol :read-only t)
(attributes () :type list :read-only t)
(content () :read-only t)
)
;;;; element -- ;;;; element --
...@@ -67,6 +71,11 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.") ...@@ -67,6 +71,11 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.")
;;; are kept empty and for future use. ;;; are kept empty and for future use.
(defstruct (tag (:conc-name t_)) (defstruct (tag (:conc-name t_))
"The Tag Structure.
The tag structure contains (meta) information about a specific tag.
Cfr. the HTML5 spec for the details on each field. Most of them
are kept empty and for future use."
(name nil :type (or symbol string) :read-only t) (name nil :type (or symbol string) :read-only t)
(categories () :read-only t) (categories () :read-only t)
(context () :read-only t) (context () :read-only t)
...@@ -328,17 +337,27 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.") ...@@ -328,17 +337,27 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.")
;;; (tag attributes . body) ;;; (tag attributes . body)
(deftype html-sexp-syntax () (deftype html-sexp-syntax ()
"The (enumerated) type of 'syntaxes' for the HTML Sexp-based representation."
'(member :compact '(member :compact
:standard)) :standard))
;;;; *default-html-sexp-syntax* -- ;;;; *default-html-sexp-syntax* --
(defparameter *default-html-sexp-syntax* :compact) (defparameter *default-html-sexp-syntax* :compact
"The default HTML syntax used in the SEXP-based coding of HTML.
The variable can take on the values of the type HTML-SEXP-SYNTAX,
i.e., :COMPACT or :STANDARD.
See Also:
Type html-sexp-syntax")
;;;; rewrite -- ;;;; rewrite --
(defgeneric rewrite (op spec syntax) (defgeneric rewrite (op spec syntax)
(:documentation "Rewrites a Sexp representing a (X)HTML element.")
) )
#| #|
...@@ -480,6 +499,31 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.") ...@@ -480,6 +499,31 @@ Serves as a 'factory' for ELEMENT objects and as a hook for peri-call methods.")
(rewrite-form xhtml-form syntax)) (rewrite-form xhtml-form syntax))
(defmacro htmlise ((&key (syntax *default-html-sexp-syntax*)) xhtml-form) (defmacro htmlise ((&key (syntax *default-html-sexp-syntax*)) xhtml-form)
"The HTMLISE macro.
The macro 'rewrites' a form according to the SYNTAX switch. If it is
:COMPACT then all the forms are read as if they where written in the
abbreviated syntax, which is more useful for many forms without too
many attributes. Otherwise, the 'standard' syntax is used, where the
attribute list must always be specified, even if (). The default for
the SYNTAX switch, which is held in the variable
*DEFAULT-HTML-SEXP-SYNTAX* is :COMPACT.
Examples:
cl-prompt> (htmlise (:syntax :compact) (<:p (<:b \"Compact syntax.\")))
<p><b>Compact Syntax</b></p>
cl-prompt> (htmlise (:syntax :standard) (<:p () (<:b () \"Standard syntax.\")))
<p><b>Standard syntax</b></p>
cl-prompt> (htmlise () ((<:p :style \"color: red\") (<:b \"Compact syntax.\")))
<p style=\"color: red\"><b>Compact Syntax</b></p>
See Also:
*default-html-sexp-syntax*
"
(declare (type html-sexp-syntax syntax)) (declare (type html-sexp-syntax syntax))
(rewrite-form xhtml-form syntax)) (rewrite-form xhtml-form syntax))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment