<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
  <header>
    <title>Welcome to the org.apache.forrest.plugin.output.Anakia Plugin</title>
  </header>
  <body>
    <section id="overview">
      <title>Overview</title>
      <p>
        Produce output in Anakia-like "xdoc" format. Enables use of Forrest as
        a tool for gathering input from various sources, and output a
        consistent set of xml output documents.
        The output is similar to
        <a href="http://velocity.apache.org/engine/devel/anakia.html">Apache Velocity Anakia</a>
        "xdoc" format.
        See <a href="site:sample-1">example</a>.
      </p>
    </section>
    <section id="howto">
      <title>Howto</title>
      <p>
        In your project's <code>forrest.properties</code> file make the
        following changes ...
      </p>
      <ul>
        <li>
          Declare the <code>org.apache.forrest.plugin.output.Anakia</code>
          plugin at the <code>project.required.plugins</code> property
          (comma-separated list).
        </li>
        <li>
          Uncomment the <code>project.start-uri</code> property and set it to be
          <code>anakia-start.xml</code>
        </li>
      </ul>
      <p>
         Now do '<code>forrest</code>' to build your site as normal.
      </p>
      <p>
         Alongside each <code>*.html</code> file there will now be a matching
         <code>*.xdoc</code> file.
      </p>
    </section>
    <section id="explanation">
      <title>How it works</title>
      <p>
        Explanation of how this plugin works
        and how its output can be enhanced with additional processing.
      </p>
      <p>
        Without touching any of the site source content or navigation system,
        we need to additionally inject another set of links to be processed.
        Each html output document will then also have a matching URI with 
        <code>*.xdoc</code> extension.
      </p>
      <p>
        This is achieved with the <code>input.xmap</code> sitemap. For the
        requested pipeline <code>anakia-start.xml</code> Forrest will generate
        the "linkmap" of the site navigation, then apply a transformation
        to amend each link.
      </p>
      <p>
        This automatically enables the crawler to gather this set of links.
      </p>
      <p>
        The <code>output.xmap</code> sitemap then handles each xdoc URI to
        transform the internal content structure. This plugin provides one
        stylesheet <code>document-to-xdoc.xsl</code> then applies a core
        transformation to make the xml output a bit more pretty.
      </p>
      <p>
        To enhance the output, either amend the <code>document-to-xdoc.xsl</code>
        stylesheet (and please send changes) or insert another transformation
        of your own. In the <code>output.xmap</code> after the abovementioned
        transformation, add the line
        <code>&lt;map:transform src="{lm:anakia.transform.xdoc.mine}"/></code>
        and add your stylesheet (following the locationmap naming convention) at
        <code>resources/stylesheets/xdoc-to-mine.xsl</code>
      </p>
    </section>
  </body>
</document>
