cvs: phpdoc /dsssl common.dsl.in

From: Date: Thu, 17 Jan 2002 10:11:33 +0000
Subject: cvs: phpdoc /dsssl common.dsl.in
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969341342@lists.php.net to get a copy of this message
hholzgra Thu Jan 17 05:11:33 2002 EDT Modified files: /phpdoc/dsssl common.dsl.in Log: preparing for upgrade to docbook4 Index: phpdoc/dsssl/common.dsl.in diff -u phpdoc/dsssl/common.dsl.in:1.1 phpdoc/dsssl/common.dsl.in:1.2 --- phpdoc/dsssl/common.dsl.in:1.1 Sun Jan 6 10:42:27 2002 +++ phpdoc/dsssl/common.dsl.in Thu Jan 17 05:11:33 2002 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: common.dsl.in,v 1.1 2002/01/06 15:42:27 hholzgra Exp $ +;; $Id: common.dsl.in,v 1.2 2002/01/17 10:11:33 hholzgra Exp $ ;; ;; This file contains stylesheet customization common to the HTML ;; and print versions. @@ -114,4 +114,103 @@ (normalize "copyright") (normalize "abstract") (normalize "legalnotice"))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; +;;;; render function prototypes, esp. with optional arguments +;;;; for new docbook4 methodsynopsis tag and friends +;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; helper function generating closing optional brackets +(define (methodsynopsis-generate-closing-optionals nl) + (if (node-list-empty? nl) + (empty-sosofo) ;; empty list -> do nothing + (make sequence ;; process list node + (if (attribute-string (normalize "choice") (node-list-first nl)) + (if (string=? "opt" (attribute-string (normalize "choice") (node-list-first nl))) + (literal %arg-choice-opt-close-str%) ;; is optional parameter -> close a bracket + (empty-sosofo) + ) + (empty-sosofo) + ) + (methodsynopsis-generate-closing-optionals (node-list-rest nl)) ;; process rest of list + ) + ) + ) + +;; render methodsynopsis +(element methodsynopsis + (make sequence + (process-children) ;; render content + (methodsynopsis-generate-closing-optionals (children (current-node))) ;; close optional brackets + (literal ")") ;; close parameter list + ) +) + +;; render return type +(element (methodsynopsis type) + (make sequence + (process-children-trim) + (literal " ") + ) +) + +;; render function name +(element (methodsynopsis methodname) + (make sequence + ($bold-seq$ + (process-children-trim) + ) + (literal " ( ") ;; start parameter list + ) + ) + +;; render parameters +(element (methodsynopsis methodparam) + (make sequence + ;; special case -> first parameter is optional + (if (equal? (gi (ipreced (current-node))) (normalize "methodparam")) + (empty-sosofo) ;; have prev. parameters -> is not first + (if (equal? (attribute-string (normalize "choice")) "opt") + (literal %arg-choice-opt-open-str%) ;; generate opening bracket + (empty-sosofo) + ) + ) + + (process-children-trim) + + ;; have more parameters following me? + (if (equal? (gi (ifollow (current-node))) (normalize "methodparam")) + (make sequence + ;; is next parameter optional? + (if (equal? (attribute-string (normalize "choice") (ifollow (current-node))) "opt") + (make sequence + (literal " ") + (literal %arg-choice-opt-open-str%) + ) + (empty-sosofo) + ) + ;; parameter list separator + (literal ", ") + ) + (empty-sosofo) + ) + ) + ) + +;; render parameter type +(element (methodparam type) + (make sequence + (process-children-trim) + (literal " ") + ) + ) + +;; render parameter name +(element (methodparam parameter) + (make sequence + (process-children-trim) + ) + )

« previous php.doc (#969341342) next »