Scribble bug with solution
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- html
- Área
- documentation
Línea de trabajo
Lee racket/pkgs/scribble-lib/scribble/html-render.rkt alrededor de la línea 1428 y sigue cómo @image genera HTML para archivos SVG. Ejecuta scribble sobre un documento que contenga graph.svg y, después, inspecciona el doc.html generado en un navegador. La tarea estará completada cuando las imágenes SVG con referencias de iconos anidadas se muestren correctamente, mientras que las imágenes que no sean SVG conserven su salida actual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Racket
- Estrellas
- 5.2k
- Forks
- 708
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de racket/racket
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 3 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 3 días
-
`raco exe` loses match submoduleAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
racket/racket#5643 · 3 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de racket/racket
Issues similares
-
documentation good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
r-afael/better-yt-recommendations#16 ·
Los mantenedores suelen responder en 1 día
-
README translations: ja, ko, deAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area:docs documentation good first issue priority:medium
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
rtk-ai/rtk#4958 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/microsoft-ui-xaml#12515 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Documentation Enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JSPrismarine/JSPrismarine#2706 ·
Los mantenedores suelen responder en 1 día