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,
- cd $FORREST_HOME/plugin/
- $FORREST_HOME/tools/ant/bin/ant local-deploy
- 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.
- This is an ordered list, meaning that the each list item is numbered.
-
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.
- 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 | ||||
---|---|---|---|---|---|
|
|
||||
|
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 | ||||
---|---|---|---|---|---|
|
|
||||
|
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 | ||||
|
You can see how the first column is gibbled | That is simply due to the minimum column width requirement. |