diff --git a/clog-element-common.lisp b/clog-element-common.lisp index 3b2e1a9..c0c22fa 100644 --- a/clog-element-common.lisp +++ b/clog-element-common.lisp @@ -457,3 +457,54 @@ CLOG-OBJ")) (create-child obj (format nil "~A" (escape-string content)) :clog-type 'clog-span :auto-place auto-place)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Implementation - clog-section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defclass clog-section (clog-element)() + (:documentation "CLOG Section Objects.")) + +;;;;;;;;;;;;;;;;;;;; +;; create-section ;; +;;;;;;;;;;;;;;;;;;;; + +(deftype section-type () '(member :address :article :aside :header :main :nav + :p :pre :section :blockquote :h1 :h2 :h3 :h4 :h5 :h6 + :hgroup)) + +(defgeneric create-section (clog-obj section &key content auto-place) + (:documentation "Create a new CLOG-Section of section type as child of +CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of +CLOG-OBJ")) + +(defmethod create-section ((obj clog-obj) section + &key (content "") (auto-place t)) + (create-child obj (format nil "<~A>~A" + section (escape-string content) section) + :clog-type 'clog-section :auto-place auto-place)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Implementation - clog-phrase +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defclass clog-phrase (clog-element)() + (:documentation "CLOG Phrase Objects.")) + +;;;;;;;;;;;;;;;;;;; +;; create-phrase ;; +;;;;;;;;;;;;;;;;;;; + +(deftype phrase-type () '(member :abbr :code :strong :em :dfn :samp :kbd :var + :marked :del :ins :s :q :big :small :time :tt :cite + :i :b :u :sub :su)) + +(defgeneric create-phrase (clog-obj phrase &key content auto-place) + (:documentation "Create a new CLOG-Phrase of phrase type as child of +CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of +CLOG-OBJ")) + +(defmethod create-phrase ((obj clog-obj) phrase + &key (content "") (auto-place t)) + (create-child obj (format nil "<~A>~A" + phrase (escape-string content) phrase) + :clog-type 'clog-phrase :auto-place auto-place)) diff --git a/clog.lisp b/clog.lisp index cd56e75..28d05ba 100644 --- a/clog.lisp +++ b/clog.lisp @@ -336,7 +336,17 @@ embedded in a native template application.)" "CLOG-Span - Class for CLOG Inline Spans" (clog-span class) - (create-span generic-function)) + (create-span generic-function) + + "CLOG-Section - Class for CLOG Inline Sections" + (section-type type) + (clog-section class) + (create-section generic-function) + + "CLOG-Phrase - Class for CLOG Inline Phrases" + (phrase-type type) + (clog-phrase class) + (create-phrase generic-function)) (defsection @clog-form (:title "CLOG Form Objects") "CLOG-Form - Class for organizing Form Elements in to a From"