diff options
author | hrs <hrs@FreeBSD.org> | 2008-04-20 17:58:05 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2008-04-20 17:58:05 +0000 |
commit | 7cdd2e068a5919f5e5649780984e673a5560c848 (patch) | |
tree | 26587a7ea36e3909f1e2fd830ba9da8cf0a7ff7c /release/doc/share | |
parent | 24c28f2576c965815722f35795655a5199016a4e (diff) | |
download | FreeBSD-src-7cdd2e068a5919f5e5649780984e673a5560c848.zip FreeBSD-src-7cdd2e068a5919f5e5649780984e673a5560c848.tar.gz |
Use role="merged" and arch="amd64,i386,..." attributes to mark a
paragraph as MFC'd or one for specific platforms. This should
make no content change with the rendered output.
Diffstat (limited to 'release/doc/share')
-rw-r--r-- | release/doc/share/sgml/release.dsl | 143 | ||||
-rw-r--r-- | release/doc/share/sgml/release.ent | 2 |
2 files changed, 70 insertions, 75 deletions
diff --git a/release/doc/share/sgml/release.dsl b/release/doc/share/sgml/release.dsl index 1d41fc8..bc7bb99 100644 --- a/release/doc/share/sgml/release.dsl +++ b/release/doc/share/sgml/release.dsl @@ -56,89 +56,82 @@ ; Deal with conditional inclusion of text via entities. (default - (let* ((arch (attribute-string (normalize "arch"))) - (role (attribute-string (normalize "role"))) + (let* ((role (attribute-string (normalize "role"))) (for-arch (entity-text "arch"))) (cond - ; If role=historic, and we're not printing historic things, then - ; don't output this element. + ;; If role=historic, and we're not printing historic things, then + ;; don't output this element. ((and (equal? role "historic") - (not %include-historic%)) + (not %include-historic%)) (empty-sosofo)) - - - ; If arch= not specified, then print unconditionally. This clause - ; handles the majority of cases. - ((or (equal? arch #f) (equal? arch "")) - (next-match)) - - ; arch= specified, see if it's equal to "all". If so, then - ; print unconditionally. Note that this clause could be - ; combined with the check to see if arch= wasn't specified - ; or was empty; they have the same outcome. - ((equal? arch "all") - (next-match)) - - ; arch= specified. If we're building for all architectures, - ; then print it prepended with the set of architectures to which - ; this element applies. - ; - ; XXX This doesn't work. -; ((equal? for-arch "all") -; (sosofo-append (literal "[") (literal arch) (literal "] ") -; (process-children))) - - ; arch= specified, so we need to check to see if the specified - ; parameter includes the architecture we're building for. - ((string-list-match? for-arch (split-string-to-list arch)) - (next-match)) - - ; None of the above - (else (empty-sosofo))))) + + ;; None of the above + (else (next-match))))) (mode qandatoc (default - (let* ((arch (attribute-string (normalize "arch"))) - (role (attribute-string (normalize "role"))) - (for-arch (entity-text "arch"))) - (cond - - ; If role=historic, and we're not printing historic things, then - ; don't output this element. - ((and (equal? role "historic") - (not %include-historic%)) - (empty-sosofo)) - - - ; If arch= not specified, then print unconditionally. This clause - ; handles the majority of cases. - ((or (equal? arch #f) (equal? arch "")) - (next-match)) - - ; arch= specified, see if it's equal to "all". If so, then - ; print unconditionally. Note that this clause could be - ; combined with the check to see if arch= wasn't specified - ; or was empty; they have the same outcome. - ((equal? arch "all") - (next-match)) - - ; arch= specified. If we're building for all architectures, - ; then print it prepended with the set of architectures to which - ; this element applies. - ; - ; XXX This doesn't work. -; ((equal? for-arch "all") -; (sosofo-append (literal "[") (literal arch) (literal "] ") -; (process-children))) - - ; arch= specified, so we need to check to see if the specified - ; parameter includes the architecture we're building for. - ((string-list-match? for-arch (split-string-to-list arch)) - (next-match)) - - ; None of the above - (else (empty-sosofo)))))) + (let* ((role (attribute-string (normalize "role"))) + (for-arch (entity-text "arch"))) + (cond + + ;; If role=historic, and we're not printing historic things, then + ;; don't output this element. + ((and (equal? role "historic") + (not %include-historic%)) + (empty-sosofo)) + + ;; None of the above + (else (next-match)))))) + +;; $paragraph$ function with arch attribute support. +(define ($paragraph$ #!optional (para-wrapper "P")) + (let ((footnotes (select-elements (descendants (current-node)) + (normalize "footnote"))) + (tgroup (have-ancestor? (normalize "tgroup"))) + (arch (attribute-string (normalize "arch"))) + (role (attribute-string (normalize "role"))) + (arch-string (entity-text "arch")) + (merged-string (entity-text "merged"))) + (make sequence + (make element gi: para-wrapper + attributes: (append + (if %default-quadding% + (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) + (if (and (not (null? role)) (equal? role "merged")) + (literal " [" merged-string "]") + (empty-sosofo)))))) + (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes)) + (empty-sosofo) + (make element gi: "BLOCKQUOTE" + attributes: (list + (list "CLASS" "FOOTNOTES")) + (with-mode footnote-mode + (process-node-list footnotes))))))))) ; We might have some sect1 level elements where the modification times ; are significant. An example of this is the "What's New" section in diff --git a/release/doc/share/sgml/release.ent b/release/doc/share/sgml/release.ent index fd96e21..a60eb5f 100644 --- a/release/doc/share/sgml/release.ent +++ b/release/doc/share/sgml/release.ent @@ -59,3 +59,5 @@ <!ENTITY arch.sparc64 "sparc64"> <!ENTITY arch.sun4v "sun4v"> +<!-- The marker for MFCs. --> +<!ENTITY merged "MERGED"> |