Index: phpdoc/html-common.dsl diff -u phpdoc/html-common.dsl:1.11 phpdoc/html-common.dsl:1.12 --- phpdoc/html-common.dsl:1.11 Wed May 16 20:36:27 2001 +++ phpdoc/html-common.dsl Wed Jul 11 18:11:12 2001 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: html-common.dsl,v 1.11 2001/05/17 00:36:27 hholzgra Exp $ +;; $Id: html-common.dsl,v 1.12 2001/07/11 22:11:12 jeroen Exp $ ;; ;; Returns the depth of the auto-generated TOC (table of contents) that @@ -52,9 +52,9 @@ (if(node-list-empty? nl) result (if(is-true-optional(node-list-first nl)) - (loop (+ result 1) (node-list-rest nl)) - (loop result (node-list-rest nl)) - ) + (loop (+ result 1) (node-list-rest nl)) + (loop result (node-list-rest nl)) + ) ) ) ) @@ -72,12 +72,12 @@ (process-children-trim) ;; no - do '[...]' output (make sequence - (literal %arg-choice-opt-open-str%) - (process-children-trim) - (literal %arg-choice-opt-close-str%) - ) + (literal %arg-choice-opt-open-str%) + (process-children-trim) + (literal %arg-choice-opt-close-str%) + ) ) - ) + ) (element (paramdef parameter) (make sequence @@ -91,52 +91,52 @@ (make sequence ;; special treatment for first parameter in funcsynopsis (if (equal? (child-number (current-node)) 1) - ;; is first ? - (make sequence - ;; start parameter list - (literal " (") - ;; is optional ? - ( if (has-true-optional (current-node)) - (literal %arg-choice-opt-open-str%) - (empty-sosofo) - ) - ) - ;; not first - (empty-sosofo) - ) + ;; is first ? + (make sequence + ;; start parameter list + (literal " (") + ;; is optional ? + ( if (has-true-optional (current-node)) + (literal %arg-choice-opt-open-str%) + (empty-sosofo) + ) + ) + ;; not first + (empty-sosofo) + ) ;; (process-children-trim) ;; special treatment for last parameter - (if (equal? (gi (ifollow (current-node))) (normalize "paramdef")) - ;; more parameters will follow - (make sequence - ;; next is optional ? - ( if (has-true-optional (ifollow (current-node))) - ;; optional - (make sequence - (literal " ") - (literal %arg-choice-opt-open-str%) - ) - ;; not optional - (empty-sosofo) - ) - (literal ", " ) - ) - ;; last parameter - (make sequence - (literal - (let loop ((result "")(count (count-true-optionals (parent (current-node))))) - (if (<= count 0) - result - (loop (string-append result %arg-choice-opt-close-str%)(- count 1)) - ) - ) - ) - ( literal ")" ) - ) - ) + (if (equal? (gi (ifollow (current-node))) (normalize "paramdef")) + ;; more parameters will follow + (make sequence + ;; next is optional ? + ( if (has-true-optional (ifollow (current-node))) + ;; optional + (make sequence + (literal " ") + (literal %arg-choice-opt-open-str%) + ) + ;; not optional + (empty-sosofo) + ) + (literal ", " ) + ) + ;; last parameter + (make sequence + (literal + (let loop ((result "")(count (count-true-optionals (parent (current-node))))) + (if (<= count 0) + result + (loop (string-append result %arg-choice-opt-close-str%)(- count 1)) + ) + ) + ) + ( literal ")" ) + ) + ) ) ) @@ -149,38 +149,40 @@ (element type - (let* ((orig-name (data (current-node))) - (type-name (cond - ((equal-ci? orig-name "float") "double") - ((equal-ci? orig-name "int") "integer") - (else orig-name))) - (linkend (string-append "language.types." type-name)) - (target (element-with-id linkend)) - ) - (cond ((node-list-empty? target) - (make sequence (process-children) ) - ) - (else - (make element gi: "A" - attributes: (list (list "HREF" (href-to target))) - ($bold-seq$ (make sequence (process-children) ) ) - ) - ) - ) - ) + (let* + ((orig-name (data (current-node))) + (type-name (cond + ((equal-ci? orig-name "float") "double") + ((equal-ci? orig-name "int") "integer") + (else orig-name)) + ) + (linkend (string-append "language.types." type-name)) + (target (element-with-id linkend)) + ) + (cond ((node-list-empty? target) + (make sequence (process-children) ) + ) + (else + (make element gi: "A" + attributes: (list (list "HREF" (href-to target))) + ( $bold-seq$(make sequence (process-children) ) ) + ) + ) + ) + ) ) (element function (let* ((function-name (data (current-node))) - (linkend - (string-append - "function." - (string-replace - (string-replace function-name "_" "-") - "::" "."))) - (target (element-with-id linkend)) - (parent-gi (gi (parent)))) + (linkend + (string-append + "function." + (string-replace + (string-replace function-name "_" "-") + "::" "."))) + (target (element-with-id linkend)) + (parent-gi (gi (parent)))) (cond ;; function names should be plain in FUNCDEF ((equal? parent-gi "funcdef") @@ -190,44 +192,44 @@ ;; FUNCTION tag is within the definition of the same function, ;; make it bold, add (), but don't make a link ((or (node-list-empty? target) - (equal? (case-fold-down - (data (node-list-first - (select-elements - (node-list-first - (children - (select-elements - (children - (ancestor-member (parent) (list "refentry"))) - "refnamediv"))) - "refname")))) - function-name)) + (equal? (case-fold-down + (data (node-list-first + (select-elements + (node-list-first + (children + (select-elements + (children + (ancestor-member (parent) (list "refentry"))) + "refnamediv"))) + "refname")))) + function-name)) ($bold-seq$ (make sequence - (process-children) - (literal "()")))) + (process-children) + (literal "()")))) ;; else make a link to the function and add () (else (make element gi: "A" - attributes: (list - (list "HREF" (href-to target))) - ($bold-seq$ - (make sequence - (process-children) - (literal - ) - (literal "()")))))))) + attributes: (list + (list "HREF" (href-to target))) + ($bold-seq$ + (make sequence + (process-children) + (literal + ) + (literal "()")))))))) (element classname (let* ((class-name (data (current-node))) - (linkend - (string-append - "class." - (string-replace - (case-fold-down class-name) "_" "-"))) - (target (element-with-id linkend)) - (parent-gi (gi (parent)))) + (linkend + (string-append + "class." + (string-replace + (case-fold-down class-name) "_" "-"))) + (target (element-with-id linkend)) + (parent-gi (gi (parent)))) (cond ;; function names should be plain in SYNOPSIS ((equal? parent-gi "synopsis") @@ -237,37 +239,37 @@ ;; CLASSNAME tag is within the definition of the same class, ;; make it bold, but don't make a link ((or (node-list-empty? target) - (equal? (case-fold-down - (data (node-list-first - (select-elements - (node-list-first - (children - (select-elements - (children - (ancestor-member (parent) (list "refentry"))) - "refnamediv"))) - "refname")))) - class-name)) + (equal? (case-fold-down + (data (node-list-first + (select-elements + (node-list-first + (children + (select-elements + (children + (ancestor-member (parent) (list "refentry"))) + "refnamediv"))) + "refname")))) + class-name)) ($bold-seq$ (process-children))) ;; else make a link to the function and add () (else (make element gi: "A" - attributes: (list - (list "HREF" (href-to target))) - ($bold-seq$ - (process-children))))))) + attributes: (list + (list "HREF" (href-to target))) + ($bold-seq$ + (process-children))))))) (element constant (let* ((constant-name (data (current-node))) - (linkend - (string-append "constant." - (case-fold-down - (string-replace constant-name "_" "-")))) - (target (element-with-id linkend)) - (parent-gi (gi (parent)))) + (linkend + (string-append "constant." + (case-fold-down + (string-replace constant-name "_" "-")))) + (target (element-with-id linkend)) + (parent-gi (gi (parent)))) (cond ; ;; constant names should be plain in FUNCDEF ; ((equal? parent-gi "funcdef") @@ -277,47 +279,47 @@ ;; CONSTANT tag is within the definition of the same constant, ;; make it bold, add (), but don't make a link ((or (node-list-empty? target) - (equal? (case-fold-down - (data (node-list-first - (select-elements - (node-list-first - (children - (select-elements - (children - (ancestor-member (parent) (list "refentry"))) - "refnamediv"))) - "refname")))) - constant-name)) + (equal? (case-fold-down + (data (node-list-first + (select-elements + (node-list-first + (children + (select-elements + (children + (ancestor-member (parent) (list "refentry"))) + "refnamediv"))) + "refname")))) + constant-name)) ($bold-mono-seq$ (process-children))) ;; else make a link to the function and add () (else (make element gi: "A" - attributes: (list - (list "HREF" (href-to target))) - ($bold-mono-seq$ - (process-children))))))) + attributes: (list + (list "HREF" (href-to target))) + ($bold-mono-seq$ + (process-children))))))) (element example (make sequence (make element gi: "TABLE" - attributes: (list - (list "WIDTH" "100%") - (list "BORDER" "0") - (list "CELLPADDING" "0") - (list "CELLSPACING" "0") - (list "CLASS" "EXAMPLE")) - (make element gi: "TR" - (make element gi: "TD" - ($formal-object$)))))) + attributes: (list + (list "WIDTH" "100%") + (list "BORDER" "0") + (list "CELLPADDING" "0") + (list "CELLSPACING" "0") + (list "CLASS" "EXAMPLE")) + (make element gi: "TR" + (make element gi: "TD" + ($formal-object$)))))) (mode book-titlepage-recto-mode (element authorgroup (process-children)) - + (element author (let ((author-name (author-string)) (author-affil (select-elements (children (current-node)) @@ -327,18 +329,19 @@ attributes: (list (list "CLASS" (gi))) (literal author-name)) (process-node-list author-affil)))) - ) + ) (element (refnamediv refname) (make sequence (make element gi: "P" - (literal " (") - (version-info (current-node)) - (literal ")") - ) + (literal " (") + (version-info (current-node)) + (literal ")") + ) (process-children) ) ) +;; vim: ts=2 sw=2 et