Return-Path:
Forrest has many powerful techniques for linking between documents
+ and for managing the site navigation. This document demonstrates those
+ techniques.
+ The document "Menus and Linking"
+ has the full details.
+
+ When Forrest builds your site, it starts from the front page. Like
+ a robot, it traverses all of the links that it finds in the documents
+ and builds the corresponding pages. Any new links are further traversed.
+
+ Sometimes those links lead to documents that are generated directly
+ from xml source files, sometimes they are generated from other source
+ via an intermediate xml format. Other times the links lead to raw
+ un-processed content.
+
+ The site navigation configuration file "
+ For both generated and raw (un-processed) files, the top-level of the
+ URI space corresponds to the "
+ A diagram will help.
+ By using Forrest Input Plugins
+ you can process some file formats, such as
+ OpenOffice.org documents and produce processed content from them. For example,
+ the file However, this does not affect the handling of raw content. That is, you
+ can still retrieve the raw un-processed version with, for example,
+
+ When this type of link is encountered, Forrest will look for a
+ corresponding xml file, relative to this document (i.e. in
+ A generated document in the current directory, which corresponds to
+ In a sub-directory, which corresponds to
+
+ Raw content files are not intended for any processing, they are just
+ linked to (e.g. pre-prepared PDFs, zip archives).
+ These files are placed alongside your normal content in the
+ " A raw document in the current directory, which corresponds to
+ A raw document in a sub-directory, which corresponds to
+ A raw document at the next level up, which corresponds to
+ Prior to version 0.7, the raw un-processed content was stored in
+ the " If you
+ you wish to emulate the behaviour of 0.6 and earlier then you
+ must add the following to your project sitemap. The above allows us to create links to un-processed skinned files stored
+ in the Note that you can change the matchers above to selectively serve some
+ content as raw un-processed content, whilst still serving other content
+ as skinned documents. For example, the following snippet would allow
+ you to serve the content of an old, deprecated site without processing
+ from Forrest, whilst still allowing all other content to be processed
+ by Forrest in the normal way: For example, HTML content. A full URL ... A full URL with a fragment identifier ...
+ Note that Forrest does not traverse external links to look for
+ other links.
+ As you will have discovered, using pathnames with ../../ etc. will
+ get very nasty. Real problems occur when you use a smart text editor
+ that tries to manage the links for you. For example, it will have
+ trouble linking to the raw content files which are not yet in their
+ final location.
+
+ Links and filenames are bound to change and re-arrange. It is
+ essential to only change those links in one central place, not in every
+ document.
+
+ The " This single entry ...
+ enables a simple link to a generated document, which corresponds to
+ This compound entry ...
+ enables a link to a generated document, which corresponds to
+
+ and a link to a generated document, which corresponds to
+ This compound entry ...
+ enables a link to a fragment identifier within the
+ This entry ...
+ enables a link to a raw document, which corresponds to
+ This compound entry ...
+ enables a link to an external URL ...
+
+ and a link to another external URL ...
+
+ and a link to another external URL with a fragment identifier ...
+
+ Images (and other resources) are handled by the main/webapp/resource.xmap sitemap.
+ It uses the main/webapp/locationmap.xml to look in various locations for images.
+ As usual, the first match wins.
+ Here is the locationmap snippet ... Which means look first in a project-defined images directory, then in the
+ default location (which is usually src/documentation/resources/images/),
+ then in the old default location (src/documentation/content/xdocs/images/),
+ then relative to the root of your xdocs.
+ The document author specifies the final image locations with these various
+ " This sample has the following image locations: Here is the effect of the various image links ... The image links shown above are handled by the resources.xmap using
+ special matches for the "images" directory in the URI.
+ The main/webapp/resources.xmap has another section to deal specifically with PNG images. It looks first for an SVG source file which will be used to generate the PNG image. If that is not found then it looks for an ASCII art source file. Then looks for a pre-prepared PNG image. Hint: See the xml source to see how the various
+ elements are used and see the
+
+ DTD reference documentation.
+ This is a simple paragraph. Most documents contain a fair amount of
+ paragraphs. Paragraphs are called With the
+ This next paragraph has a class attribute of 'quote'. CSS can
+ be used to present this
+ Anyway, like I was sayin', shrimp is the fruit of the sea. You can
+ barbecue it, boil it, broil it, bake it, sautee it. Dey's uh,
+ shrimp-kabobs, shrimp creole, shrimp gumbo. Pan fried, deep fried,
+ stir-fried. There's pineapple shrimp, lemon shrimp, coconut shrimp,
+ pepper shrimp, shrimp soup, shrimp stew, shrimp salad, shrimp and
+ potatoes, shrimp burger, shrimp sandwich. That- that's about it.
+ A number of in-line elements are available in the DTD, we will show them
+ inside an unordered list ( So far for the in-line elements, let's look at some paragraph-level
+ elements. Apart from unordered lists, we have ordered lists too, of course. This sample document, written in document-v20 XML can be presented
+ via Forrest in a number of different formats. The links in the
+ following list show this document in each of the currently available
+ formats. Each of the formats can be made available as a link near the top of
+ the page. Actual placement of those links depends on the skin
+ currently in use. Those links are enabled in the skinconf.xml via the
+ <disable-XXX-link> elements in the skinconf.xml This document as straight text. For additional information see the Forrest text-output
+ plugin. This document as Perl POD (Plain Old Documentation). Text
+ with minimal formatting directives. If on a *nix system with perl
+ installed, see "man perlpod". For additional information see the Forrest pod-output
+ plugin. You can use sections to put some structure in your document. For some
+ strange historical reason, the section title is an attribute of the
+ Just some second section. Which contains a subsection (2.1). Enough about these sections. Let's have a look at more interesting
+ elements, CDATA sections are used within
+ Please take care to still use a sensible line-length within your
+ source elements. And now for a table: And a The document-v13 had elements <fork> and <jump>. In
+ document-v20, those elements no longer exist but the functionality can
+ be duplicated by using the @class attribute.
+ Even though the opening of separate windows should be under the
+ control of the user, these techniques can still be employed. Document V1.3 Document V2.0 <fork href="faq.html"> <jump href="faq.html"> See the generated
+
+ DTD reference documentation.
+
+ All v1.2 docs will work fine as v1.3 DTD. The main change is the
+ addition of a @class attribute to every element, which enables the
+ "extra-css" section in the skinconf to be put to good use.
+
+ doc-v12 enhances doc-v11 by relaxing various restrictions that were
+ found to be unnecessary.
+
+ You can place some types of raw content into the xdocs directory. For example,
+ you can place a PDF file in
+ It is also worth noting that files in the xdocs directory will only be copied
+ into your final site if there is a link to them somewhere in the site. See the next
+ section for details of how to include content that is not linked.
+ For more information see the
+ Linking demonstration.
+ You can include raw HTML, PDFs, plain-text, and other files. In your final site by
+ placing them in the
+ You can also have sub-directories such as
+ This was generated from a sub-directory. When creating new subdirectories, remember that these must
+ be declared in site.xml or each directory must have a book.xml file.
+
+ Forrest can deliver raw SVG files for capable browsers, e.g. Firefox.
+ See example.
+
+ Forrest can convert SVG files into Portable Network Graphic (PNG).
+ See example. Note that Forrest will first
+ look for a pre-prepared PNG file, and if not found then it will
+ generate the PNG from the SVG.
+
+ Be careful. We only provide a local copy of the SVG 1.0 DTD
+ so if you use SVG 1.1 then there will be network trips
+ for the DTDs.
+ Configure
+ your local catalog entity resolver for your local DTD copies.
+
+
+
+
+ site.xml
" provides
+ a way to manage this URI space. In the future, when documents are
+ re-arranged and renamed, the site.xml configuration will enable this
+ smoothly.
+ content/xdocs/
" directory,
+ i.e. the location of the "site.xml
" configuration file.
+ content/
" directory. In 0.7 onwards, raw
+ un-processed data is stored alongside the xdocs. In addition,
+ in 0.6 and earlier, HTML documents could be stored in the xdocs
+ directory and served without processing. If you
+ you wish to emulate the behaviour of 0.6 and earlier see the
+ next section.
+ content/xdocs/hello.sxw
can be used to produce a
+ skinned version of the document at with the name hello.html
.
+ Similarly, you can use Forrest Output
+ Plugins to create different output formats such as PDF, in this
+ case content/xdocs/hello.sxw
can produce
+ hello.pdf
.hello.sxw
. If you want to prevent the user retrieving the
+ un-processed version you will have to create matchers that intercept
+ these requests within your project sitemap.content/xdocs/samples/
).
+ content/xdocs/samples/sample.html
...
+ content/xdocs/samples/subdir/index.html
...
+ content/xdocs
" directory.
+ content/xdocs/samples/helloAgain.pdf
...
+ content/xdocs/samples/subdir/hello.zip
...
+ content/hello.pdf
...
+ content/
" directory. In 0.7 onwards, raw
+ un-processed data is stored alongside the xdocs. In addition
+ in 0.6 and earlier, HTML files could be stored in the xdocs
+ directory and they would be served without further processing.
+ As described above, this is not the case in 0.7 where HTML files
+ are, by default, skinned by Forrest.{project:content}
or {project:content.xdocs}
+ directory. For example:
+ <a href="/test1.html">HTML content</a>. However, it will
+ break the 0.7 behaviour of skinning HTML content. For this reason the old
+ ".ehtml" extension can be used to embed HTML content in a Forrest skinned
+ site site.xml
" configuration file to the rescue. It maps
+ symbolic names to actual resources.
+ content/xdocs/index.xml
...
+ content/xdocs/samples/index.xml
...
+ content/xdocs/samples/faq.xml
...
+ samples/sample.html
document ...
+ content/hello.pdf
...
+ src=
" links. Behind-the-scenes Cocoon handles the requests
+ using the sitemap and locationmap.
+
+
+ <img src="/images/icon-a.png"
+ ... The source file is found in src/documentation/resources/images/ directory.
+ <img src="/images/sub-dir/icon-c.png"
+ ... The source file is found in src/documentation/resources/images/sub-dir/ directory.
+ <img src="/images/icon-e.png"
+ ... The source file is not found in the normal src/documentation/resources/images/
+ so Cocoon looks in the next location and finds the source in
+ src/documentation/content/xdocs/images/ directory.
+ This supports backward-compatibility for this old default location.
+ <img src="images/icon-a.png"
+ ... same as example 1 above. Except this time the generated image is relative to the document.
+ <img src="../images/icon-a.png"
+ ... Relative reference. Forrest "absolutizes" the URLs to be like the URLs
+ in examples 1 and 2 and 3. Then Cocoon looks in the normal locations as described above.
+ The source file is found in src/documentation/resources/images/ directory.
+ <img src="../../images/icon-b.png"
+ ... Broken relative reference (it points up beyond the document root).
+ Never mind, Forrest "absolutizes" the URLs to be like the URLs in examples 1 and 2 and 3.
+ The source file is found in src/documentation/resources/images/ directory.
+ However there is a problem here. When using Forrest in command-line mode,
+ the image will be generated outside the document directory.
+ It is better to use absolute /image/ URLs or be very careful about using
+ such relative links (Forrest will not repart an error).
+
+ <img src="/images/ellipse-2.png"
+ ... Cocoon tried the various locations for a PNG image called
+ ellipse-2.png but did not find one anywhere. So the next sitemap match
+ looks for a corresponding
+ ellipse-2.svg and generates the PNG image on-the-fly.
+ The source file is found in src/documentation/resources/images/ directory.
+
+
+
+ <img src="ellipse.png"
+ ... Cocoon tried the various locations for a PNG image called
+ ellipse-2.png but did not find one anywhere. So the next sitemap match
+ looks for a corresponding
+ ellipse-2.svg and generates the PNG image on-the-fly.
+ The source file is found in the current directory src/documentation/content/xdocs/samples/
+
+ <img src="cocoon-pryamid.png"
+ ... ASCII Art. Cocoon did not find a PNG image, nor an SVG file.
+ So the next sitemap match looks for a corresponding
+ cocoon-pryamid.aart and generates the PNG image on-the-fly.
+ The source file is found in the current directory src/documentation/content/xdocs/samples/
+ <img src="icon-d.png"
+ ... Relative to this document.
+ The source file is found in the current directory src/documentation/content/xdocs/samples/
+ document-v20.dtd
+ document-v20.dtd
+ (See the DTD changes section at the bottom.)
+ <p>
.<p xml:space="preserve">
attribute, you can declare
+ that whitespace should be preserved, without implying it is in any other
+ way special.<p class='quote'>
in
+ a different style than the other paragraphs. The handling of
+ this quoted paragraph is defined in the <extra-css>
+ element in the skinconf.xml.
+ <ul>
):
+
+ <li>
).<code>
element in the
+ previous item?<sub>
and <sup>
+ elements to show content above or below the text
+ baseline.<em>
<strong>
+ elements.<icon>
s too.<img>
element:
+ ,
+ which offers the ability to refer to an image map.
+
<a href="faq.html">
<a href="#section">
<a href="faq.html#forrest">
<dl>
was used inside
+ the previous list item. We could put another
+
+
+
+
+
+ Or even tables..
+
+ inside tables..
+ or inside lists, but I believe this liberty gets quickly quite
+ hairy as you see. <fixme>
element is used for stuff
+ which still needs work. Mind the author
attribute!<note>
element to draw attention to something, e.g. ...The <code>
element is used when the author can't
+ express himself clearly using normal sentences ;-)<warning>
element).
+ label
attribute.
+
+
+
+
+
+
+
+ Presentation Format
+
+ Description
+
+ skinconf.xml Element
+
+
+
+ HTML
+
+ This document in HTML format.
+
+ Always generated by default. Cannot be turned off.
+
+
+
+ XML
+
+ This document in its raw XML format.
+
+ <disable-xml-link>. By default, set to true, meaning
+ that this link will not be shown.
+
+
+
+ PDF
+
+ This document as Adobe PDF
+
+ <disable-pdf-link>. By default, set to false, meaning
+ that this link will be shown.
+
+
+
+ Text
+
+
+
+ <disable-txt-link>. By default, set to true, meaning
+ that this link will not be shown.
+
+
+ POD
+
+
+
+ <disable-pod-link>. By default, set to true, meaning
+ that this link will not be shown.
+ <section>
element.<source>
for instance:<source>
elements so that you can write pointy
+ brackets without needing to escape them with messy
+ <
entities ...
+
+
+
+
+ heading cell 1
+ heading cell 2
+ heading cell 3
+
+
+ data cell
+ this data cell spans two columns
+
+
+
+ Tables can be nested:
+
+
+
+
+
+
+
+ column 1
+ column 2
+
+
+ cell A
+ cell B
+
+
+
+ <figure>
to end all of this.
+ Note that this can also be implemented with an
+ <img>
element.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <a class="fork"
+ href="faq.html">
+
+
+
+
+
+
+
+
+
+ src/documentation/content/xdocs
and link
+ to it normally,
+ <a href="../hello.pdf">hello.pdf</a>
+ However, note that if the file is one that Forrest is able to process, for example
+ an HTML file, these files will be processed accordingly.src/documentation/content
directory. Files in this
+ directory will be copied over automatically but will not be processed in any way by
+ Forrest, that is they will be linked to as raw files.src/documentation/content/samples/subdir/
which
+ reflects your main
+ xdocs/
tree. The raw files will then end up
+ beside your documents.
+
+ +
+]]> + + + Propchange: forrest/trunk/whiteboard/forrest2/core/src/examples/forrest1SeedSite/src/xdocs/samples/usemap.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: forrest/trunk/whiteboard/forrest2/core/src/examples/forrest1SeedSite/src/xdocs/samples/xml-entities.xml URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/examples/forrest1SeedSite/src/xdocs/samples/xml-entities.xml?view=auto&rev=482028 ============================================================================== --- forrest/trunk/whiteboard/forrest2/core/src/examples/forrest1SeedSite/src/xdocs/samples/xml-entities.xml (added) +++ forrest/trunk/whiteboard/forrest2/core/src/examples/forrest1SeedSite/src/xdocs/samples/xml-entities.xml Sun Dec 3 19:23:29 2006 @@ -0,0 +1,82 @@ + + + + %symbols-project; +]> +
+ All of the normal xml character entities are available for use
+ in your source documents.
+ So you can use "™
"
+ for the trademark symbol (™)
+ and use "ö
"
+ for special accents (ö).
+
+ Forrest also has some default sets of symbols. There is one set + for the core of Forrest. These are automatically available + for use in the "document-v*" series of document types. + (If you want to use them in another document type, then you + need to specify them in the document type declaration of your + xml instance documents or in your custom DTD. See below.) +
+
+ For example,
+ use "&for-s;
" to represent the strong
+ text string "&for-s;". See the list of available symbols at
+ main/webapp/resources/schema/entity/symbols-core-v10.ent
+ which shows that that example entity was declared as
+ Apache Forrest]]>
.
+
+ You can supply lists of symbols for your own project too.
+ Create a fresh site with 'forrest seed' and see the set
+ src/documentation/resources/schema/symbols-project-v10.ent
+
+ For example,
+ use "&myp-t;
" to represent the project name
+ together with trademark symbol "&myp-t;".
+
+ The set of project symbols is already configured. To use the symbols
+ in your documents, add to the document type declaration. For example,
+ see the source for this document
+ (src/documentation/content/xdocs/samples/xml-entites.xml
)
+ which declares the project symbol set ...
+