What version of Racket are you using?
9.1 [cs] on linux
What program did you run?
$ scribble
What should have happened?
Browser should display all images on page.
If you got an error message, please include it here.
No error message during the complete chain of production.
Please include any other relevant details
The problem is a little bit tricky to describe. The solution is easier:
For embeded .svg image files included by @image{<image.svg>} Scribble produces an html
tag. In simple cases the image displays correctly but not in complex ones. The complex case will be described later. The solution is to use an html tag instead of the
tag.
This could be achieved by replacing the following lines in file racket/pkgs/scribble-lib/scribble/html-render.rkt.
existing code (line 1428):
`((img
([src ,srcref]
[alt ,(content->string (element-content e))]
,@sz
,@(attribs))))))]
replacement code:
(if svg?
((object ([data ,srcref] [type "image/svg+xml"] [alt ,(content->string (element-content e))] ,@sz ,@(attribs)))) ((img
([src ,srcref]
[alt ,(content->string (element-content e))]
,@sz
,@(attribs)))))))]
Problem description (real case szenario):
An icon file icon.svg is used by graphviz within a .dot file (node->image attribute). Graphviz produces another file graph.svg including a link to icon.svg. The file graph.svg is then include in file doc.scrbl by a line @image{"graph.svg"}. Scribble then produces a file doc.html.
The chain of links to svg-images looks like this:
icon.svg <- graph.svg <- doc.html
When using a web browser to display doc.html then the image icon.svg will not display if an html tag <img src="graph.svg" ...> is produced by Scribble. Everything displays perfectly if a tag <object data="graph.svg" type="image/svg+xml" ...> is produced.
Hint: File icon.svg has to be copied manually by the user into the same directory where files doc.html and graph.svg reside.
What version of Racket are you using?
9.1 [cs] on linux
What program did you run?
$ scribble
What should have happened?
Browser should display all images on page.
If you got an error message, please include it here.
No error message during the complete chain of production.
Please include any other relevant details
The problem is a little bit tricky to describe. The solution is easier:
For embeded .svg image files included by @image{<image.svg>} Scribble produces an html
tag. In simple cases the image displays correctly but not in complex ones. The complex case will be described later. The solution is to use an html tag instead of the
tag.
This could be achieved by replacing the following lines in file racket/pkgs/scribble-lib/scribble/html-render.rkt.
existing code (line 1428):
`((img
([src ,srcref]
[alt ,(content->string (element-content e))]
,@sz
,@(attribs))))))]
replacement code:
(if svg?
((object ([data ,srcref] [type "image/svg+xml"] [alt ,(content->string (element-content e))] ,@sz ,@(attribs))))((img([src ,srcref]
[alt ,(content->string (element-content e))]
,@sz
,@(attribs)))))))]
Problem description (real case szenario):
An icon file icon.svg is used by graphviz within a .dot file (node->image attribute). Graphviz produces another file graph.svg including a link to icon.svg. The file graph.svg is then include in file doc.scrbl by a line @image{"graph.svg"}. Scribble then produces a file doc.html.
The chain of links to svg-images looks like this:
icon.svg <- graph.svg <- doc.html
When using a web browser to display doc.html then the image icon.svg will not display if an html tag <img src="graph.svg" ...> is produced by Scribble. Everything displays perfectly if a tag <object data="graph.svg" type="image/svg+xml" ...> is produced.
Hint: File icon.svg has to be copied manually by the user into the same directory where files doc.html and graph.svg reside.