Page 1 of 1
Default extension for docbook graphic fileref attribute
Posted: Tue Feb 16, 2010 12:52 am
by burto
Hi,
My docbook processing software doesn't expect the graphic element's fileref attribute to have an extension because it will add one itself (.eps because my software is producing PS/PDF files) - I believe that (certainly used to be) quite a common thing to do.
It would be great if author mode could support an option to specify a default extension for graphics files that would be added if the filename doesn't have an extension. I could then set that option to, say, .png and provide some alternative graphics that could be viewed when using author mode.
Even better would be the capability to specify a list of extensions that could be tried in order, e.g: "svg png gif".
Cheers,
Mark
Re: Default extension for docbook graphic fileref attribute
Posted: Wed Feb 17, 2010 12:21 pm
by Radu
Hi Mark,
I don't know if the described scenario is such an usual one. This is the first report so far. We will discuss it.
Anyway, Oxygen does not support rendering "eps" images in the Author mode so even if there was an option for appending a certain extension the images would still not be displayed in your case.
Regards,
Radu
Re: Default extension for docbook graphic fileref attribute
Posted: Wed Feb 17, 2010 1:04 pm
by burto
Hi Radu,
Thanks for the reply.
Radu wrote:
I don't know if the described scenario is such an usual one. This is the first report so far. We will discuss it.
Well if you google for 'docbook fileref extension' you will see that I am not alone in using extension-less filerefs. It is quite normal for docbook processing software to add a default extension.
Anyway, Oxygen does not support rendering "eps" images in the Author mode so even if there was an option for appending a certain extension the images would still not be displayed in your case.
Regards,
Radu
Yes, that's the whole point - Oxygen doesn't support EPS but it does
support other image types so I would provide, say, PNG versions of my EPS graphics and they would be displayed by Oxygen while the document is being edited.
Like I said before, the ideal solution would be if Oxygen could be told a list of graphics file extensions to try when the fileref doesn't include an extension.
Mark
Re: Default extension for docbook graphic fileref attribute
Posted: Wed Feb 17, 2010 2:35 pm
by Radu
Hi Mark,
There seems to be a solution for your problem.
If you open the
OXYGEN_INSTALL_DIR/frameworks/docbook/css/docbook.css in Oxygen, there is a selector like:
Code: Select all
graphic,
inlinegraphic,
imagedata{
content: attr(fileref, url);
}
you can replace it with something like:
Code: Select all
graphic,
inlinegraphic,
imagedata{
content: url(base-uri(),concat(attr(fileref) ".png"));
}
to append an extension to the end of the file name specified in the
fileref attribute.
Regards,
Radu
Re: Default extension for docbook graphic fileref attribute
Posted: Wed Feb 17, 2010 3:59 pm
by burto
Hi Radu,
I just tried that suggestion and it works OK.
Thanks for the quick response.
Cheers,
Mark