From 512e1c1c1fe7832ea8ccbba8e1ef2e8a67947795 Mon Sep 17 00:00:00 2001 From: hrs Date: Sat, 12 Feb 2011 08:29:16 +0000 Subject: [PATCH] Add revision attribute handling. Links are now generated at the end of the paragraph from revision="NNN". Approved by: re (implicit) git-svn-id: svn://svn.freebsd.org/base/releng/8.2@218597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- release/doc/share/sgml/release.dsl | 63 +++++++++++++++++++----------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/release/doc/share/sgml/release.dsl b/release/doc/share/sgml/release.dsl index 7a728ef7..83ae97ac 100644 --- a/release/doc/share/sgml/release.dsl +++ b/release/doc/share/sgml/release.dsl @@ -209,6 +209,7 @@ (normalize "footnote"))) (tgroup (have-ancestor? (normalize "tgroup"))) (arch (attribute-string (normalize "arch"))) + (rev (attribute-string (normalize "revision"))) (role (attribute-string (normalize "role"))) (arch-string (entity-text "arch")) (merged-string (entity-text "merged"))) @@ -219,28 +220,46 @@ (list (list "ALIGN" %default-quadding%)) '())) (make sequence - (cond - ;; If arch= not specified, then print unconditionally. This clause - ;; handles the majority of cases. - ((or (equal? arch #f) - (equal? arch "") - (equal? arch "all")) - (process-children)) - (else - (sosofo-append - (make sequence - (literal "[") - (let loop ((prev (car (split-string-to-list arch))) - (rest (cdr (split-string-to-list arch)))) - (make sequence - (literal prev) - (if (not (null? rest)) - (make sequence - (literal ", ") - (loop (car rest) (cdr rest))) - (empty-sosofo)))) - (literal "] ") - (process-children))))) + (sosofo-append + (if (and (not (equal? arch #f)) + (not (equal? arch "")) + (not (equal? arch "all"))) + (make sequence + (literal "[") + (let loop ((prev (car (split-string-to-list arch))) + (rest (cdr (split-string-to-list arch)))) + (make sequence + (literal prev) + (if (not (null? rest)) + (make sequence + (literal ", ") + (loop (car rest) (cdr rest))) + (empty-sosofo)))) + (literal "] ")) + (empty-sosofo)) + (process-children) + (if (and (not (equal? rev #f)) + (not (equal? rev ""))) + (make sequence + (literal "[") + (let loop ((prev (car (split-string-to-list rev))) + (rest (cdr (split-string-to-list rev)))) + (make sequence + (make element gi: "A" + attributes: (list + (list "HREF" (string-append + "http://svn.freebsd.org/viewvc/base?view=revision&revision=" + prev)) + (list "TARGET" "_top")) + (literal "r") + (literal prev)) + (if (not (null? rest)) + (make sequence + (literal ", ") + (loop (car rest) (cdr rest))) + (empty-sosofo)))) + (literal "] ")) + (empty-sosofo))) (if (and (not (null? role)) (equal? role "merged")) (literal " [" merged-string "]") (empty-sosofo)) -- 2.42.0