Scribbled games docs
svn: r9246 original commit: 18f408767332d345e194a8ba78a9199ee7a2887a
This commit is contained in:
parent
a0ad4dfa64
commit
8343c07795
|
@ -758,7 +758,7 @@
|
|||
`((a ((name ,(url-anchor-name style)))
|
||||
,@(super render-element e part ri)))]
|
||||
[(image-file? style)
|
||||
(let* ([src (image-file-path style)]
|
||||
(let* ([src (main-collects-relative->path (image-file-path style))]
|
||||
[scale (image-file-scale style)]
|
||||
[sz (if (= 1.0 scale)
|
||||
null
|
||||
|
@ -776,7 +776,7 @@
|
|||
`((width ,(to-num w))
|
||||
(height ,(to-num h))))
|
||||
null))))])
|
||||
`((img ((src ,(install-file src)) ,@sz))))]
|
||||
`((img ((src ,(install-file src))) ,@sz)))]
|
||||
[else (super render-element e part ri)])))
|
||||
|
||||
(define/override (render-table t part ri need-inline?)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
mzlib/class
|
||||
scheme/runtime-path
|
||||
scheme/port
|
||||
setup/main-collects
|
||||
(for-syntax scheme/base))
|
||||
(provide render-mixin)
|
||||
|
||||
|
@ -162,7 +163,9 @@
|
|||
(/ (cadddr style) 255.0))))
|
||||
#f)]
|
||||
[(image-file? style)
|
||||
(let ([fn (install-file (image-file-path style))])
|
||||
(let ([fn (install-file
|
||||
(main-collects-relative->path
|
||||
(image-file-path style)))])
|
||||
(printf "\\includegraphics[scale=~a]{~a}" (image-file-scale style) fn))]
|
||||
[else (super render-element e part ri)])))
|
||||
(when part-label?
|
||||
|
|
|
@ -174,7 +174,9 @@
|
|||
|
||||
[target-url ([addr (or/c string? path?)][style any/c])]
|
||||
[url-anchor ([name string?])]
|
||||
[image-file ([path path-string?]
|
||||
[image-file ([path (or/c path-string?
|
||||
(cons/c (one-of/c 'collects)
|
||||
(listof bytes?)))]
|
||||
[scale real?])])
|
||||
|
||||
;; ----------------------------------------
|
||||
|
|
|
@ -64,16 +64,19 @@
|
|||
;; resulting html
|
||||
(define (xref-render xrefs doc dest-file
|
||||
#:render% [render% (html:render-mixin render%)])
|
||||
(let* ([dest-file (if (string? dest-file) (string->path dest-file) dest-file)]
|
||||
[renderer (new render% [dest-dir (and dest-file (path-only dest-file))]
|
||||
[css-path 'inline])]
|
||||
[ci (send renderer collect (list doc) (list dest-file))]
|
||||
[_ (send renderer transfer-info ci (resolve-info-ci (xrefs-ri xrefs)))]
|
||||
[ri (send renderer resolve (list doc) (list dest-file) ci)]
|
||||
[xs (send renderer render (list doc) (list dest-file) ri)])
|
||||
(if dest-file
|
||||
(void)
|
||||
(car xs))))
|
||||
;; In case rendering writes a file (like an image file), which to the
|
||||
;; temp directory:
|
||||
(parameterize ([current-directory (find-system-path 'temp-dir)])
|
||||
(let* ([dest-file (if (string? dest-file) (string->path dest-file) dest-file)]
|
||||
[renderer (new render% [dest-dir (and dest-file (path-only dest-file))]
|
||||
[css-path 'inline])]
|
||||
[ci (send renderer collect (list doc) (list dest-file))]
|
||||
[_ (send renderer transfer-info ci (resolve-info-ci (xrefs-ri xrefs)))]
|
||||
[ri (send renderer resolve (list doc) (list dest-file) ci)]
|
||||
[xs (send renderer render (list doc) (list dest-file) ri)])
|
||||
(if dest-file
|
||||
(void)
|
||||
(car xs)))))
|
||||
|
||||
;; Returns (values <tag-or-#f> <form?>)
|
||||
(define xref-binding-tag
|
||||
|
|
Loading…
Reference in New Issue
Block a user