org.eclipse.mylyn.wikitext.core.util.anttask
Class MarkupToHtmlTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.eclipse.mylyn.wikitext.core.util.anttask.MarkupTask
              extended by org.eclipse.mylyn.wikitext.core.util.anttask.MarkupToHtmlTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MarkupToEclipseHelpTask

public class MarkupToHtmlTask
extends MarkupTask

An Ant task for converting lightweight markup to HTML format.

Since:
1.0
Author:
David Green

Nested Class Summary
static class MarkupToHtmlTask.Attribute
           
static class MarkupToHtmlTask.Stylesheet
           
 
Field Summary
protected  File file
           
protected  boolean formatOutput
           
protected  String htmlFilenameFormat
           
protected  String linkRel
           
protected  boolean multipleOutputFiles
           
protected  boolean navigationImages
           
protected  boolean overwrite
           
protected  String prependImagePrefix
           
protected  String title
           
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
MarkupToHtmlTask()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet set)
          Adds a set of files to process.
 void addStylesheet(MarkupToHtmlTask.Stylesheet stylesheet)
           
protected  File computeHtmlFile(File source, String name)
           
 void execute()
           
 String getDefaultAbsoluteLinkTarget()
          A default target attribute for links that have absolute (not relative) urls.
 boolean getEmitDoctype()
          Indicate if the builder should emit DOCTYPE declaration.
 File getFile()
          the file to process
 String getHtmlDoctype()
          The DTD to use in the output document.
 String getHtmlFilenameFormat()
           
 String getLinkRel()
          The 'rel' value for HTML links.
 String getPrependImagePrefix()
           
 String getTitle()
          The document title, as it appears in the head
 boolean isFormatOutput()
          indicate if the output should be formatted
 boolean isMultipleOutputFiles()
          indicate if output should be generated to multiple output files.
 boolean isNavigationImages()
          indicate if navigation links should be images
 boolean isOverwrite()
          indicate if target files should be overwritten even if their timestamps are newer than the source files.
 boolean isSuppressBuiltInCssStyles()
           
 boolean isUseInlineCssStyles()
           
 boolean isXhtmlStrict()
          Indicate if the builder should attempt to conform to strict XHTML rules.
protected  String processFile(MarkupLanguage markupLanguage, File baseDir, File source)
          process the file
 void setDefaultAbsoluteLinkTarget(String defaultAbsoluteLinkTarget)
          A default target attribute for links that have absolute (not relative) urls.
 void setEmitDoctype(boolean emitDtd)
          Indicate if the builder should emit DOCTYPE declaration.
 void setFile(File file)
          the file to process
 void setFormatOutput(boolean formatOutput)
          indicate if the output should be formatted
 void setHtmlDoctype(String htmlDoctype)
          The DTD to use in the output document.
 void setHtmlFilenameFormat(String htmlFilenameFormat)
          The format of the HTML output file.
 void setLinkRel(String linkRel)
          The 'rel' value for HTML links.
 void setMultipleOutputFiles(boolean multipleOutputFiles)
          indicate if output should be generated to multiple output files.
 void setNavigationImages(boolean navigationImages)
          indicate if navigation links should be images
 void setOverwrite(boolean overwrite)
          indicate if target files should be overwritten even if their timestamps are newer than the source files.
 void setPrependImagePrefix(String prependImagePrefix)
           
 void setSuppressBuiltInCssStyles(boolean suppressBuiltInCssStyles)
           
 void setTitle(String title)
          The document title, as it appears in the head
 void setUseInlineCssStyles(boolean useInlineCssStyles)
           
 void setXhtmlStrict(boolean xhtmlStrict)
          Indicate if the builder should attempt to conform to strict XHTML rules.
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.util.anttask.MarkupTask
addConfiguredMarkupLanguageConfiguration, createMarkupLanguage, getInternalLinkPattern, getMarkupLanguage, getMarkupLanguageConfiguration, getSourceEncoding, isFailOnValidationError, isFailOnValidationWarning, isValidate, performValidation, readFully, setFailOnValidationError, setFailOnValidationWarning, setInternalLinkPattern, setMarkupLanguage, setMarkupLanguageConfiguration, setSourceEncoding, setValidate
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

htmlFilenameFormat

protected String htmlFilenameFormat

overwrite

protected boolean overwrite

file

protected File file

title

protected String title

linkRel

protected String linkRel

multipleOutputFiles

protected boolean multipleOutputFiles

formatOutput

protected boolean formatOutput

navigationImages

protected boolean navigationImages

prependImagePrefix

protected String prependImagePrefix
Constructor Detail

MarkupToHtmlTask

public MarkupToHtmlTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

processFile

protected String processFile(MarkupLanguage markupLanguage,
                             File baseDir,
                             File source)
                      throws org.apache.tools.ant.BuildException
process the file

Parameters:
baseDir -
source -
Returns:
the lightweight markup, or null if the file was not written
Throws:
org.apache.tools.ant.BuildException

computeHtmlFile

protected File computeHtmlFile(File source,
                               String name)

getHtmlFilenameFormat

public String getHtmlFilenameFormat()
See Also:
setHtmlFilenameFormat(String)

setHtmlFilenameFormat

public void setHtmlFilenameFormat(String htmlFilenameFormat)
The format of the HTML output file. Consists of a pattern where the '$1' is replaced with the filename of the input file. Default value is $1.html

Parameters:
htmlFilenameFormat -

getTitle

public String getTitle()
The document title, as it appears in the head


setTitle

public void setTitle(String title)
The document title, as it appears in the head


getFile

public File getFile()
the file to process


setFile

public void setFile(File file)
the file to process


addFileset

public void addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files to process.


addStylesheet

public void addStylesheet(MarkupToHtmlTask.Stylesheet stylesheet)

isMultipleOutputFiles

public boolean isMultipleOutputFiles()
indicate if output should be generated to multiple output files.


setMultipleOutputFiles

public void setMultipleOutputFiles(boolean multipleOutputFiles)
indicate if output should be generated to multiple output files.


isFormatOutput

public boolean isFormatOutput()
indicate if the output should be formatted


setFormatOutput

public void setFormatOutput(boolean formatOutput)
indicate if the output should be formatted


isNavigationImages

public boolean isNavigationImages()
indicate if navigation links should be images


setNavigationImages

public void setNavigationImages(boolean navigationImages)
indicate if navigation links should be images


isUseInlineCssStyles

public boolean isUseInlineCssStyles()
See Also:
HtmlDocumentBuilder.isUseInlineStyles()

setUseInlineCssStyles

public void setUseInlineCssStyles(boolean useInlineCssStyles)
See Also:
HtmlDocumentBuilder.isUseInlineStyles()

isSuppressBuiltInCssStyles

public boolean isSuppressBuiltInCssStyles()
See Also:
HtmlDocumentBuilder.isSuppressBuiltInStyles()

setSuppressBuiltInCssStyles

public void setSuppressBuiltInCssStyles(boolean suppressBuiltInCssStyles)
See Also:
HtmlDocumentBuilder.isSuppressBuiltInStyles()

getLinkRel

public String getLinkRel()
The 'rel' value for HTML links. If specified the value is applied to all links generated by the builder. The default value is null. Setting this value to "nofollow" is recommended for rendering HTML in areas where users may add links, for example in a blog comment. See http://en.wikipedia.org/wiki/Nofollow for more information.


setLinkRel

public void setLinkRel(String linkRel)
The 'rel' value for HTML links. If specified the value is applied to all links generated by the builder. The default value is null. Setting this value to "nofollow" is recommended for rendering HTML in areas where users may add links, for example in a blog comment. See http://en.wikipedia.org/wiki/Nofollow for more information.


getPrependImagePrefix

public String getPrependImagePrefix()

setPrependImagePrefix

public void setPrependImagePrefix(String prependImagePrefix)

isOverwrite

public boolean isOverwrite()
indicate if target files should be overwritten even if their timestamps are newer than the source files.


setOverwrite

public void setOverwrite(boolean overwrite)
indicate if target files should be overwritten even if their timestamps are newer than the source files.


getDefaultAbsoluteLinkTarget

public String getDefaultAbsoluteLinkTarget()
A default target attribute for links that have absolute (not relative) urls. By default this value is null. Setting this value will cause all HTML anchors to have their target attribute set if it's not explicitly specified.

Since:
1.1

setDefaultAbsoluteLinkTarget

public void setDefaultAbsoluteLinkTarget(String defaultAbsoluteLinkTarget)
A default target attribute for links that have absolute (not relative) urls. By default this value is null. Setting this value will cause all HTML anchors to have their target attribute set if it's not explicitly specified.

Since:
1.1

isXhtmlStrict

public boolean isXhtmlStrict()
Indicate if the builder should attempt to conform to strict XHTML rules. The default is false.

Since:
1.3
See Also:
HtmlDocumentBuilder.isXhtmlStrict()

setXhtmlStrict

public void setXhtmlStrict(boolean xhtmlStrict)
Indicate if the builder should attempt to conform to strict XHTML rules. The default is false.

Since:
1.3
See Also:
HtmlDocumentBuilder.isXhtmlStrict()

getEmitDoctype

public boolean getEmitDoctype()
Indicate if the builder should emit DOCTYPE declaration. Default is true.

Since:
1.3
See Also:
HtmlDocumentBuilder.isEmitDtd()

setEmitDoctype

public void setEmitDoctype(boolean emitDtd)
Indicate if the builder should emit DOCTYPE declaration. Default is true.

Since:
1.3
See Also:
HtmlDocumentBuilder.isEmitDtd()

getHtmlDoctype

public String getHtmlDoctype()
The DTD to use in the output document. Ignored if emitDoctype is false.

Returns:
the DTD to use, or null if the default DTD should be used
Since:
1.3
See Also:
HtmlDocumentBuilder.isEmitDtd()

setHtmlDoctype

public void setHtmlDoctype(String htmlDoctype)
The DTD to use in the output document. Ignored if emitDoctype is false. The doctype should take the form: <!DOCTYPE html ...>

Parameters:
htmlDoctype - the DTD to use, or null if the default DTD should be used
Since:
1.3


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.