This project has retired. For details please refer to its Attic page.
Welcome to the Text Plugin
Apache Forrest > Plugins
Plugin: Text output
 
Font size:      

Welcome to the Text Plugin

Apache Forrest - Text Plugin

This plugin allows Forrest files to be output as simple text.

How to Use the Text Plugin

The plugin needs to be incorporated into your existing build of Forrest. To do this,

  1. cd $FORREST_HOME/plugin/
  2. $FORREST_HOME/tools/ant/bin/ant local-deploy
  3. At this point, you'll be asked the name of the plugin to deploy. The name of this plugin is org.apache.forrest.plugin.output.Text

Once you have the text plugin installed, it is simply a case of requesting a file with an txt extension. For example, this page as text.

Features

Overall, each section and subsection are indented by two spaces. First level sections are underlined with equal signs, '='. Second level sections with dashes, '-'. Third level sections are underlined with '-.' and fourth level sections with dots, '.'.

Second Level Section

Third Level Section

Fourth Level Section

Lists

  • This is an unordered list. Notice that each list item is text wrapped and hangining indents are also implmented.
  • This is the second item in this unordered list. Notice also how the indents of the current section are also applied to the lists themselves.
  1. This is an ordered list, meaning that the each list item is numbered.
  2. Again, the indentation of the current section is applied as well as a hanging indent for text that wraps around.

    Also notice that each list item can have multiple paragraphs by making sure that the text is enclosed in paragraph, <p>, elements.

  3. The final element in this ordered list.
Definition Lists
Lists that have a definition term followed by text that defines the term. Again, notice the hanging indents.

Tables

First Column Second Column
Just some text to show that text within tables cells is also wrapped.

In order to use multiple paragraphs in a table cell, wrap each paragraph in <p> elements.

Just like in this cell.

Nesting Lists, Tables

Lists Tables
  1. We can even have lists within tables.

  2. Again, these are handled pretty well.

Nested Tables With Lists
There is a limit tho.
  • First item

  • Second Item

  • Bulletted items work in here as well.
  • This is the second item.
This cell intentionally left blank.

Limitations

Use the <p> element

Generally, text wrapping in list items and in table cells will work better if the text in those item is enclosed in <p> elements. For example, we'll take the table above and remove the <p> elements from the list items, the <li> elements.

Lists Tables
  1. We can even have lists within tables.
  2. Again, these are handled pretty well.
Nested Tables With Lists
There is a limit tho.
  • First item
  • Second Item
  • Bulletted items work in here as well.
  • This is the second item.
This cell intentionally left blank.

You can see that some of the text wrapping gets messed up.

Table Cell Minimum Width

Table cells, even when nested, have a minimum width of 10 defined. This means that when nesting tables, that minimum width will be quickly hit and the formatting will get, for lack of a better word, gibbled. An example will help illustrate the point.

First of Three Columns Second of Three Columns Third of Three Columns
Nested Four Column Table
You can see how the first column is gibbled That is simply due to the minimum column width requirement.