You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by admin <ad...@javable.com> on 2003/02/14 18:18:23 UTC

Specifying src

I apology if this was asked a couple of hundred times already, but
when specifying src= in img, figure and the like what I suppose to
use -- a "normal" linking or a semantic linking? A big site like ours can
get images from tens of different resources, and setting them all in
site.xml seems like a lot of pain.

So, how can I use a "normal" URI to specify an image as a figure in
the article, for example? I tried simple src="blha.gif", which didn't
work :(. What to do when image is in the different directory? On a
different site?

many thanks in advance,
-- Sergey



Re: Specifying src

Posted by Jeff Turner <je...@apache.org>.
On Fri, Feb 14, 2003 at 11:19:18PM -0400, admin wrote:
> Jeff,
> 
> thanks for the prompt response
> 
> JT> Alternatively (I've never understood why images are 'resources') you can
> JT> drop images directly in src/documentation/content/, and refer to them
> JT> without the prefix: <figure src="whatever.png">
> 
> Yes, but this means that all images are dumped in the same directory
> (yuck!). I'd rather have images pertinent to the article, howto, etc.,
> located in the same dir with xml source for the article (it's still
> far from being ideal -- any real world application almost requires the
> ability to fetch images from different places _with ease_). I'm
> probably asking for too much too early :), but this is now the only
> real showstopper for me.

Yes, allowing a more flexible source directory layout is a major goal.
Currently it is *possible* to have a unified content/ directory with
xdocs, images etc, but it requires some tweaking of the Cocoon sitemap
(the process is described at
http://xml.apache.org/forrest/your-project.html#sitemap.xmap).
Specifically, all references to 'content/xdocs' need to be replaced with
'content' (assuming xdocs in content/).  Also, you'll need to define some
variables in forrest.properties:

project.xdocs-dir=${project.content-dir}/content

And some tweaking of the XML validation patterns might be required:

forrest.validate.xdocs.includes=**/*.xml
forrest.validate.xdocs.excludes=site.xml,images/*

> JT> It looks like site: linking does not work with 'src' attributes in 0.4.
> JT> It could be made to with a small sitemap tweak.
> Well, even if it would it wont be too helpful -- or is it? I mean,
> what I really need is the ability to say src="blah.gif", and then
> Forrest will take it from the local dir. May be something like
> "local:blah.gif" is feasible to implement?

'site:' linking wasn't really designed to solve this problem.  The
real solution is to parametrize the sitemap so we don't need to hardcode
'content/xdocs' (or anything else).


--Jeff

> -- Sergey
> 
> 

Re[2]: Specifying src

Posted by admin <ad...@javable.com>.
Jeff,

thanks for the prompt response

JT> Alternatively (I've never understood why images are 'resources') you can
JT> drop images directly in src/documentation/content/, and refer to them
JT> without the prefix: <figure src="whatever.png">

Yes, but this means that all images are dumped in the same directory
(yuck!). I'd rather have images pertinent to the article, howto, etc.,
located in the same dir with xml source for the article (it's still
far from being ideal -- any real world application almost requires the
ability to fetch images from different places _with ease_). I'm
probably asking for too much too early :), but this is now the only
real showstopper for me.

JT> It looks like site: linking does not work with 'src' attributes in 0.4.
JT> It could be made to with a small sitemap tweak.
Well, even if it would it wont be too helpful -- or is it? I mean,
what I really need is the ability to say src="blah.gif", and then
Forrest will take it from the local dir. May be something like
"local:blah.gif" is feasible to implement?

-- Sergey



Re: Specifying src

Posted by Jeff Turner <je...@apache.org>.
On Fri, Feb 14, 2003 at 01:18:23PM -0400, admin wrote:
> I apology if this was asked a couple of hundred times already, but
> when specifying src= in img, figure and the like what I suppose to
> use -- a "normal" linking or a semantic linking? A big site like ours can
> get images from tens of different resources, and setting them all in
> site.xml seems like a lot of pain.
> 
> So, how can I use a "normal" URI to specify an image as a figure in
> the article, for example? I tried simple src="blha.gif", which didn't
> work :(. What to do when image is in the different directory? On a
> different site?

Usually, images should go in src/documentation/resources/images/, and
can then be referred to with <figure src='images/whatever.png'/>

Alternatively (I've never understood why images are 'resources') you can
drop images directly in src/documentation/content/, and refer to them
without the prefix: <figure src="whatever.png">

It looks like site: linking does not work with 'src' attributes in 0.4.
It could be made to with a small sitemap tweak.

--Jeff

> many thanks in advance,
> -- Sergey
> 
>