org.howardism.ant
Class Text2HTML

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.MatchingTask
              extended byorg.howardism.ant.Text2HTML
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class Text2HTML
extends org.apache.tools.ant.taskdefs.MatchingTask

This Ant task will create very simple HTML page from text files by using various Text-to-HTML formatting engines.

While rendering text files in HTML markup has its own use, it is probably most useful in sequence with the WebTemplate ant task which combines simply-formatted HTML files into complex HTML files using a template. This would allow on to create a rich web site with nothing more than text files holding the content.

See my web site for a better description of this.


Constructor Summary
Text2HTML()
           
 
Method Summary
 org.apache.tools.ant.types.Mapper createMapper()
          Defines the FileNameMapper to use (nested mapper element).
 void execute()
          Execute the task
 void setDest(java.io.File destDir)
          Set the destination directory to place converted files into.
 void setEngine(java.lang.String engine)
          Set the "engine" parameter.
 void setExt(java.lang.String ext)
          Set the extension which converted files should have.
 void setScript(java.lang.String script)
           
 void setSrc(java.io.File srcDir)
          Set the source directory in which to find files to convert.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Text2HTML

public Text2HTML()
Method Detail

setSrc

public void setSrc(java.io.File srcDir)
Set the source directory in which to find files to convert.

Parameters:
srcDir - directory to find input file in.

setDest

public void setDest(java.io.File destDir)
Set the destination directory to place converted files into.

Parameters:
destDir - directory to place output file into.

setExt

public void setExt(java.lang.String ext)
Set the extension which converted files should have. If unset, files will not be renamed.

Parameters:
ext - File extension to use for converted files.

setEngine

public void setEngine(java.lang.String engine)
Set the "engine" parameter. This defaults to "stringtemplate" to use the org.antlr.stringtemplate engine.

Parameters:
engine - The engine to set.

setScript

public void setScript(java.lang.String script)

createMapper

public org.apache.tools.ant.types.Mapper createMapper()
                                               throws org.apache.tools.ant.BuildException
Defines the FileNameMapper to use (nested mapper element).

Returns:
the mapper to use for file name translations.
Throws:
org.apache.tools.ant.BuildException - if more than one mapper is defined.

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute the task

Throws:
org.apache.tools.ant.BuildException - is there is a problem in the task execution.