[Openstack-docs] Checking imagedata attributes?

David Cramer david.cramer at rackspace.com
Fri Sep 20 20:02:49 UTC 2013


On 09/20/2013 02:38 PM, Steve Gordon wrote:
...
>> I've done a quick implementation of this - and now need some help for
>> what exactly to check:
>> 1) existence of format attribute?
>> 2) existence of contentwidth attribute?
>> 3) existence of width attribute?
>> 4) existence and value (which?) of format attribute?
>> 5) existence and value (which?) of contentwidth attribute?
>> 6) existence and value (which?) of width attribute?
>>
>> Just a random example from our tree:
>> <imagedata fileref="figures/demo_multiple_dhcp_agents.png"
>> contentwidth="6in"/>
>> is the above fine - or not? Why?
>>
>> My current patch is at:
>> https://review.openstack.org/47619
> 
> I've actually been wondering if these shouldn't just be injected/enforced by the XSL rather than authors having to enter them each time they add an image.

So what we really should do is adjust our xslts to use scale-down-to-fit
[1] as the default value for content-width and content-hight in the
xslt-fo. That way, the image will be the size it is UNLESS it's too
large to fit, in which case it will be scaled down automatically.

The problem with adding contentwidth="6in" automatically is that if the
image is small to begin with, it would be scaled up until it's 6 inches
wide and with a corresponding, proportional height.

If we use scale-down-to-fit, then all that is handled automatically and
we can just omit the contentwidth attrs.

I don't think the format attribute has any effect.

Regards,
David

[1] http://www.w3.org/TR/2006/REC-xsl11-20061205/#content-height



More information about the Openstack-docs mailing list