This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] admon graphics: GIF vs PNG


Hello Mike and all:

If you want to work with optional extensions for admonition graphics,
the $admon-graphic$  definition should be as it appears in the dbparam
file located in the "print" subdirectory. Here is it:

(define ($admon-graphic$ #!optional (nd (current-node)))
 ;; REFENTRY admon-graphic
 ;; PURP Admonition graphic file
 ;; DESC
 ;; Given an admonition node, returns the name of the graphic that should
 ;; be used for that admonition.
 ;; /DESC
 ;; AUTHOR N/A
 ;; /REFENTRY
 (cond ((equal? (gi nd) (normalize "tip"))
    (string-append %admon-graphics-path%
           (string-append "tip"
                      admon-graphic-default-extension)))
   ((equal? (gi nd) (normalize "note"))
    (string-append %admon-graphics-path%
           (string-append "note"
                      admon-graphic-default-extension)))

   ((equal? (gi nd) (normalize "important"))
    (string-append %admon-graphics-path%
           (string-append "important"
                      admon-graphic-default-extension)))

   ((equal? (gi nd) (normalize "caution"))
    (string-append %admon-graphics-path%
           (string-append "caution"
                      admon-graphic-default-extension)))
   ((equal? (gi nd) (normalize "warning"))
    (string-append %admon-graphics-path%
           (string-append "warning"
                      admon-graphic-default-extension)))
   (else (error (string-append (gi nd) " is not an admonition.")))))

I don't know why the definition in the "html" subdirectory is different (it
uses the "gif" extension only.

Puts that definition in you customizing parameters file.

Hope this helps.
Best regards,
Juan R. Migoya
Spain

Mike Mueller wrote:

On Thursday 21 August 2003 04:32, Juan R. Migoya wrote:


Mike Mueller wrote:





2. If I should use the .pngs, then is there a recipe for modifying the
DSSSL?


In dbparam.dsl:

(define admon-graphic-default-extension
".png")



I tried this and it did not work.


With your help I was able see that dbparam.dsl and the DSSSL in the Cogent reference both contain admon graphics path controls. Closer inspection of the Cogent file has a comment stating results similar to mine regarding the admon-graphic-default-extension control.

When I changed "warning.gif" to "warning.png" in dbparam.dsl, the warning.png icon was used.

I guess I'll substitute "png" for "gif" in dbparam.dsl unless I'm this is wrong. (I'm doing this in the html version.)

Here is the relevent section from the Cogent reference at
http://developers.cogentrts.com/cogent/prepdoc/pd-customizingthedssslstylesheets.html:

;; This overrides the default .gif extension for print admontions.
(define ($admon-graphic$ #!optional (nd (current-node)))
 (cond ((equal? (gi nd) (normalize "tip"))
(string-append %admon-graphics-path% "tip.png"))
((equal? (gi nd) (normalize "note"))
(string-append %admon-graphics-path% "note.png"))
((equal? (gi nd) (normalize "important"))
(string-append %admon-graphics-path% "important.png"))
((equal? (gi nd) (normalize "caution"))
(string-append %admon-graphics-path% "caution.png"))
((equal? (gi nd) (normalize "warning"))
(string-append %admon-graphics-path% "warning.png"))
(else (error (string-append (gi nd) " is not an admonition.")))))

;; Identify the default extension for admonition graphics. This allows
;; backends to select different images (e.g., EPS for print, PNG for
;; PDF, etc.)  It doesn' seem to be working, so we used the override above.
(define admon-graphic-default-extension ".png")



<snip>




--------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]