hholzgra Sun Jan 15 13:55:26 2006 UTC
Modified files: /phpdoc/dsssl common.dsl.in html-common.dsl Log: cleaned up my previous zend-api function linking hack by making the <function> handler "role=..." aware supported roles so far: "php" - the default "zend-api" - a ZendEngine or TRSM C API function "zend-macro" - a ZendEngine or TRSM preprocessor macro "libc" - a libc function, this links to external man page URLs http://cvs.php.net/viewcvs.cgi/phpdoc/dsssl/common.dsl.in?r1=1.12&r2=1.13&diff_format=u Index: phpdoc/dsssl/common.dsl.in diff -u phpdoc/dsssl/common.dsl.in:1.12 phpdoc/dsssl/common.dsl.in:1.13 --- phpdoc/dsssl/common.dsl.in:1.12 Sat Jan 8 18:31:26 2005 +++ phpdoc/dsssl/common.dsl.in Sun Jan 15 13:55:26 2006 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: common.dsl.in,v 1.12 2005/01/08 18:31:26 hsc Exp $ +;; $Id: common.dsl.in,v 1.13 2006/01/15 13:55:26 hholzgra Exp $ ;; ;; This file contains stylesheet customization common to the HTML ;; and print versions. @@ -27,6 +27,10 @@ (define %prefers-ordinal-label-name-format% @NUMBER_FIRST@) (define ($generate-book-lot-list$) (list)) +;; these are used for unix manpage linking in html-common.dsl +(define %manpage-url-base% "http://www.opengroup.org/onlinepubs/007908799/xsh/") +(define %manpage-url-ext% ".html") + (define (php-code code) (make processing-instruction data: (string-append "php " code "?"))) http://cvs.php.net/viewcvs.cgi/phpdoc/dsssl/html-common.dsl?r1=1.23&r2=1.24&diff_format=u Index: phpdoc/dsssl/html-common.dsl diff -u phpdoc/dsssl/html-common.dsl:1.23 phpdoc/dsssl/html-common.dsl:1.24 --- phpdoc/dsssl/html-common.dsl:1.23 Mon Aug 29 00:42:19 2005 +++ phpdoc/dsssl/html-common.dsl Sun Jan 15 13:55:26 2006 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: html-common.dsl,v 1.23 2005/08/29 00:42:19 hholzgra Exp $ +;; $Id: html-common.dsl,v 1.24 2006/01/15 13:55:26 hholzgra Exp $ ;; ;; Returns the depth of the auto-generated TOC (table of @@ -157,15 +157,23 @@ (element function (let* ( (function-name (data (current-node))) - (id-base (string-replace - (string-replace function-name "_" "-") - "::" ".")) - (linkend (string-append "function." (case-fold-down id-base ))) - (target (element-with-id linkend)) - (linkend2 (string-append "zend-api." (case-fold-down id-base ))) - (target2 (element-with-id linkend2)) - (linkend3 (string-append "zend-api-macro." id-base )) - (target3 (element-with-id linkend3)) + (role-name (if (attribute-string (normalize "role")) + (attribute-string (normalize "role")) + (normalize "php")) + ) + (id-base (case-fold-down (string-replace (string-replace function-name "_" "-") "::" "."))) + (target (cond + ((equal-ci? role-name "php") + (href-to (element-with-id (string-append "function." id-base )))) + ((equal-ci? role-name "zend-api") + (href-to (element-with-id (string-append "zend-api." id-base )))) + ((equal-ci? role-name "zend-macro") + (href-to (element-with-id (string-append "zend-macro." id-base )))) + ((equal-ci? role-name "libc") + (string-append %manpage-url-base% function-name %manpage-url-ext%)) + (else "") + ) + ) (parent-gi (gi (parent))) ) @@ -177,7 +185,7 @@ ;; If a valid ID for the target function is not found, or if the ;; FUNCTION tag is within the definition of the same function, ;; make it bold, add (), but don't make a link - ((or (and (node-list-empty? target) (node-list-empty? target2) (node-list-empty? target3)) + ((or (equal? target "") (equal? (case-fold-updown (data (node-list-first (select-elements @@ -198,12 +206,7 @@ (else (make element gi: "A" attributes: (list - (list "HREF" (href-to (cond ((not (node-list-empty? target3)) (case-fold-down target3)) - ((not (node-list-empty? target2)) target2) - ((not (node-list-empty? target)) target) - )) - ) - ) + (list "HREF" target)) ($bold-seq$ (make sequence (process-children)