<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed 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 howto PUBLIC "-//APACHE//DTD How-to V1.2//EN" "http://forrest.apache.org/dtd/howto-v12.dtd">

<howto>
 <header>
  <title>How to create a PDF document for each tab</title>
  <abstract>This How-To describes the generation of a PDF document for each
    group of documents that is defined by a tab. 
  </abstract>
  <last-modified-content-date date="2004-07-19"/>
 </header>

  <audience title="Intended Audience">
    <p>
      Users who need to generate one printable document aggregated from a
      group of documents.
    </p>
  </audience>
  
  <purpose title="Purpose">
    <p>
      By default Forrest generates a pdf file for each separate document of
      your project.
      As well you can create a pdf of the whole site. But sometimes it may
      be necessary to generate a pdf file out of selected tab, i.e. only for
      certain parts of the site.
    </p>
  </purpose>

  <prerequisites title="Prerequisites">
    <ul>
      <li>Understand how to create project-specific sitemaps by following the
      <link href="site:your-project">Using Forrest</link> document.</li>
    </ul>
  </prerequisites>

  <steps title="Steps">
    <p>The procedure outlined below will define a project
      <code>sitemap.xmap</code> and create a new
      <code>pdf-tab.xmap</code>.
    </p>
  <section id="sitemap">
    <title>Create your project's main sitemap.xmap</title>
    <p>
      If you do not have already a sitemap then create a new empty one in your
      <code>src/documentation</code> directory (or wherever
      ${project.sitemap-dir} points to).
    </p>
  </section>

  <section id="aggregator">
    <title>Create another sitemap: pdf-tab.xmap</title>
    <p>
    Like before create an empty sitemap and name it pdf-tab.xmap.
    </p>
  </section>

    <section id="mount">
    <title>Edit project sitemap.xmap to mount pdf-tab.xmap</title>
    <p>
      Your sitemap should look something like this.
    </p>
    <source><![CDATA[
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline internal-only="false">
      <map:match pattern="**.xml">
        <!-- pdf-tab definitions -->
        <map:match pattern="pdf-tab.xml">
          <map:mount uri-prefix="" src="pdf-tab.xmap"
            check-reload="yes" />
        </map:match>
        <!-- end of pdf-tab definitions -->
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>]]>
    </source>
  </section>

  <section id="edit-aggregator">
    <title>Edit the file <code>pdf-tab.xmap</code></title>
    <p>
      The <code><![CDATA[<map:match pattern="*.xml">]]></code> element
      should look like the following:
    </p>
    <source><![CDATA[
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline internal-only="false">
     <map:match pattern="*.xml">
	<map:generate src="cocoon://abs-linkmap"/>
	  <map:transform type="xpath">
	  	<map:parameter name="include" value="//*[@wholesite='true']"/>
		<map:parameter name="exclude" value="//*[@wholesite='false']"/>
	  </map:transform>
	  <map:transform src="resources/stylesheets/site2book.xsl" />
	  <map:transform src="resources/stylesheets/aggregates/book2cinclude.xsl">
	     <map:parameter name="title"
		value="{conf:project-name}: Still My Foo Site"/>
	     </map:transform>
	  <map:transform type="cinclude"/>
	  <map:transform src="resources/stylesheets/aggregates/doc2doc-uniqueids.xsl"/>
	  <map:transform src="resources/stylesheets/aggregates/docs2document.xsl"/>
	  <map:serialize type="xml"/>
    </map:match>    
   </map:pipeline>
  </map:pipelines>
</map:sitemap>]]>
    </source>
  </section>
  <section id="edit-site">
    <title>Edit your site.xml</title>
    <p>Add the following entry to your site.xml in the
      <code><![CDATA[<about>]]></code> element
    </p>
    <source><![CDATA[... <commit_msg>added note about directories with points<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed 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 howto PUBLIC "-//APACHE//DTD How-to V1.2//EN" "http://forrest.apache.org/dtd/howto-v12.dtd">

<howto>
 <header>
  <title>How to create a PDF document for each tab</title>
  <abstract>This How-To describes the generation of a PDF document for each
    group of documents that is defined by a tab. 
  </abstract>
  <last-modified-content-date date="2004-07-19"/>
 </header>

  <audience title="Intended Audience">
    <p>
      Users who need to generate one printable document aggregated from a
      group of documents.
    </p>
  </audience>
  
  <purpose title="Purpose">
    <p>
      By default Forrest generates a pdf file for each separate document of
      your project.
      As well you can create a pdf of the whole site. But sometimes it may
      be necessary to generate a pdf file out of selected tab, i.e. only for
      certain parts of the site.
    </p>
  </purpose>

  <prerequisites title="Prerequisites">
    <ul>
      <li>Understand how to create project-specific sitemaps by following the
      <link href="site:your-project">Using Forrest</link> document.</li>
    </ul>
  </prerequisites>

  <steps title="Steps">
    <p>The procedure outlined below will define a project
      <code>sitemap.xmap</code> and create a new
      <code>pdf-tab.xmap</code>.
    </p>
  <section id="sitemap">
    <title>Create your project's main sitemap.xmap</title>
    <p>
      If you do not have already a sitemap then create a new empty one in your
      <code>src/documentation</code> directory (or wherever
      ${project.sitemap-dir} points to).
    </p>
  </section>

  <section id="aggregator">
    <title>Create another sitemap: pdf-tab.xmap</title>
    <p>
    Like before create an empty sitemap and name it pdf-tab.xmap.
    </p>
  </section>

    <section id="mount">
    <title>Edit project sitemap.xmap to mount pdf-tab.xmap</title>
    <p>
      Your sitemap should look something like this.
    </p>
    <source><![CDATA[
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline internal-only="false">
      <map:match pattern="**.xml">
        <!-- pdf-tab definitions -->
        <map:match pattern="pdf-tab.xml">
          <map:mount uri-prefix="" src="pdf-tab.xmap"
            check-reload="yes" />
        </map:match>
        <!-- end of pdf-tab definitions -->
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>]]>
    </source>
  </section>

  <section id="edit-aggregator">
    <title>Edit the file <code>pdf-tab.xmap</code></title>
    <p>
      The <code><![CDATA[<map:match pattern="*.xml">]]></code> element
      should look like the following:
    </p>
    <source><![CDATA[
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline internal-only="false">
     <map:match pattern="*.xml">
	<map:generate src="cocoon://abs-linkmap"/>
	  <map:transform type="xpath">
	  	<map:parameter name="include" value="//*[@wholesite='true']"/>
		<map:parameter name="exclude" value="//*[@wholesite='false']"/>
	  </map:transform>
	  <map:transform src="resources/stylesheets/site2book.xsl" />
	  <map:transform src="resources/stylesheets/aggregates/book2cinclude.xsl">
	     <map:parameter name="title"
		value="{conf:project-name}: Still My Foo Site"/>
	     </map:transform>
	  <map:transform type="cinclude"/>
	  <map:transform src="resources/stylesheets/aggregates/doc2doc-uniqueids.xsl"/>
	  <map:transform src="resources/stylesheets/aggregates/docs2document.xsl"/>
	  <map:serialize type="xml"/>
    </map:match>    
   </map:pipeline>
  </map:pipelines>
</map:sitemap>]]>
    </source>
  </section>
  <section id="edit-site">
    <title>Edit your site.xml</title>
    <p>
      <note>
        Do not use directories with "."ś in it. Replace them by "_"!
        e.g 1.2/ will not work in the aggregation. e.g. 1_2/ just works fine.
      </note>
      Add the following entry to your site.xml in the
      <code><![CDATA[<about>]]></code> element
    </p>
    <source><![CDATA[... 
{'fraction_non_alphanumeric': 0.14480224767668035, 'fraction_numerical': 0.007996542035876377, 'mean_word_length': 3.163292847503374, 'pattern_counts': {'":': 0, '<': 239, '<?xml version=': 2, '>': 237, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3307427', 'n_tokens_mistral': 3070, 'n_tokens_neox': 2906, 'n_words': 858}