You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Charles Ames <ch...@oakgrovesystems.com> on 2004/11/05 07:34:49 UTC

Howto: "macros" in xdocs?

Forgive me if this is in the FAQ, but we didn't see it...

We're building a product documentation site with Forrest.  We want to define
site-wide "macros", like ${product-version} and ${release-date}, that can be
inserted in individual content\xdocs\* files and replaced by corresponding
literal values, like "6.0.1", at render time.

What's the easiest way to do this with Forrest?

Thanks in advance!

-Chuck



Re: Howto: "macros" in xdocs?

Posted by David Crossley <cr...@apache.org>.
Clay Leeds wrote:
> David Crossley wrote:
> <snip>
> >> We're building a product documentation site with Forrest.  We want to 
> >> define
> >> site-wide "macros", like ${product-version} and ${release-date}, that 
> >> can be
> >> inserted in individual content\xdocs\* files and replaced by 
> >> corresponding
> >> literal values, like "6.0.1", at render time.
> >>
> >> What's the easiest way to do this with Forrest?
> >
> > We have been discussing such a need on the development list.
> > http://marc.theaimsgroup.com/?l=forrest-dev&r=4&b=200410
> > http://marc.theaimsgroup.com/?l=forrest-dev&m=109895958631116
> >
> > I don't want to get into too much tech discussion
> > on this "user" list.
> >
> > One potential solution would be to use xml entities.
> > Each project could define a text file with entity
> > definitions ...
> >
> > ------
> > <!ENTITY project-name 'Some Name'>
> > <!ENTITY project-url 'http://www.somename.com/'>
> > ...
> > ------
> >
> > Then you use then in your XML instances like
> > this ... &project-name;
> > and maybe even use them in stylesheets too. Not sure yet.
> >
> > There would be a project-based set and a Forrest main set.
> 
> For completeness-sake, where would such ENTITY definitions be placed? 
> Could they go in forrest.properties or skinconf.xml? The 
> forrest.properties file already has many of these, so that makes sense 
> to me.

(As i said, i would rather not get into development issues
on the user list.)

Not forrest.properties because it is not an xml file.

It would probably be a separate file that can be handled
by the catalog entity resolver. Anyway i am still
experimenting.

-- 
David Crossley


Re: Howto: "macros" in xdocs?

Posted by Clay Leeds <cl...@medata.com>.
On Nov 5, 2004, at 12:36 AM, David Crossley wrote:
<snip>
>> We're building a product documentation site with Forrest.  We want to 
>> define
>> site-wide "macros", like ${product-version} and ${release-date}, that 
>> can be
>> inserted in individual content\xdocs\* files and replaced by 
>> corresponding
>> literal values, like "6.0.1", at render time.
>>
>> What's the easiest way to do this with Forrest?
>
> We have been discussing such a need on the development list.
> http://marc.theaimsgroup.com/?l=forrest-dev&r=4&b=200410
> http://marc.theaimsgroup.com/?l=forrest-dev&m=109895958631116
>
> I don't want to get into too much tech discussion
> on this "user" list.
>
> One potential solution would be to use xml entities.
> Each project could define a text file with entity
> definitions ...
>
> ------
> <!ENTITY project-name 'Some Name'>
> <!ENTITY project-url 'http://www.somename.com/'>
> ...
> ------
>
> Then you use then in your XML instances like
> this ... &project-name;
> and maybe even use them in stylesheets too. Not sure yet.
>
> There would be a project-based set and a Forrest main set.

For completeness-sake, where would such ENTITY definitions be placed? 
Could they go in forrest.properties or skinconf.xml? The 
forrest.properties file already has many of these, so that makes sense 
to me.

Web Maestro Clay
-- 
Clay Leeds - <cl...@medata.com>
Webmaster/Developer - Medata, Inc. - <http://www.medata.com/>
PGP Public Key: <https://mail.medata.com/pgp/cleeds.asc>


Re: Howto: "macros" in xdocs?

Posted by David Crossley <cr...@apache.org>.
Charles Ames wrote:
> Forgive me if this is in the FAQ, but we didn't see it...

Because the capability is not available
in a neat solution at this stage.

> We're building a product documentation site with Forrest.  We want to define
> site-wide "macros", like ${product-version} and ${release-date}, that can be
> inserted in individual content\xdocs\* files and replaced by corresponding
> literal values, like "6.0.1", at render time.
> 
> What's the easiest way to do this with Forrest?

We have been discussing such a need on the development list.
http://marc.theaimsgroup.com/?l=forrest-dev&r=4&b=200410
http://marc.theaimsgroup.com/?l=forrest-dev&m=109895958631116

I don't want to get into too much tech discussion
on this "user" list.

One potential solution would be to use xml entities.
Each project could define a text file with entity
definitions ...

------
<!ENTITY project-name 'Some Name'>
<!ENTITY project-url 'http://www.somename.com/'>
...
------

Then you use then in your XML instances like
this ... &project-name;
and maybe even use them in stylesheets too. Not sure yet.

There would be a project-based set and a Forrest main set.

-- 
David Crossley


Re: Howto: "macros" in xdocs?

Posted by Thorsten Scherler <th...@apache.org>.
Charles Ames escribió:
> Forgive me if this is in the FAQ, but we didn't see it...
> 
> We're building a product documentation site with Forrest.  We want to define
> site-wide "macros", like ${product-version} and ${release-date}, that can be
> inserted in individual content\xdocs\* files and replaced by corresponding
> literal values, like "6.0.1", at render time.
> 
> What's the easiest way to do this with Forrest?
> 

There are some ways how you can do that.

I reckon one way would be to implemend it in the skin and skinconf. Have 
a look in the document2site.xsl and site2xhtml.xsl.

HTH

-- 
thorsten

"Together we stand, divided we fall"
Hey you (Pink Floyd)