Evolution #21

Add parameter support for image directive (width, height, ...)

Added by Florian DESBOIS almost 4 years ago. Updated about 2 years ago.

Status:RésoluStart date:07/16/2009
Priority:NormalDue date:
Assignee:Florian DESBOIS% Done:

100%

Category:generation docutilsEstimated time:4.00 hours
Target version:1.3Spent time:1.00 hour

Description

Le seul paramètre implémenté pour une image est le alt.
Il manque le width, height ou même le align qui serait intéressant. (http://docutils.sourceforge.net/docs/ref/rst/directives.html#image)
Un attribut existe en plus de la doc, l'attribut target permettant de rajouter un lien sur l'image. Il serait intéressant de pouvoir également mettre une légende sous l'image (parametre legend ?).

History

#1 Updated by Florian DESBOIS almost 4 years ago

  • % Done changed from 0 to 50

Le align, width et height sont OK

Pour la légende, il s'agirait d'implémenter la directive figure (http://docutils.sourceforge.net/docs/ref/rst/directives.html#figure)... complexe et non indispensable pour le moment...

#2 Updated by Jean Couteau over 3 years ago

Cas erait bien de gérer l'attribut scale aussi genre :scale: 50% pour avoir à éviter de calculer les width et height à la mano.

#3 Updated by Benjamin Poussin over 2 years ago

  • Target version set to 1.3
  • Subject changed from Paramètres sur une image to Add parameter support for image directive (width, height, ...)
  • Category set to generation docutils
  • Estimated time set to 4.00

Quelle librairie utiliser pour redimensionner les images ? Pour le HTML, on peut faire simple et seulement forcé la taille d'affichage dans le code HTML, mais pour les autres rendus, il faut passer par un redimensionnement de l'image.

#4 Updated by Jean Couteau over 2 years ago

For PDF or docbook generation, you got no problem, you got the attributes in docbook or XSL-FO.

#5 Updated by Arnaud LIAGRE about 2 years ago

A little problem is that you need at least 2 spaces or tab for the parameters to get read. Why this approach ? Maybe not a good idea when people uses tab, they use probably only one.

It's easy to change in the peekDirectiveOrReference() method (String[] lines = readBlock(2);) to replace with String[] lines = readBlock(1);

#6 Updated by Éric Chatellier about 2 years ago

  • Status changed from Nouveau to Résolu
  • % Done changed from 50 to 100

Also available in: Atom PDF