net.exegetic.markout
Class MarkdownProcessor

java.lang.Object
  extended by net.exegetic.markout.MarkdownProcessor

public class MarkdownProcessor
extends java.lang.Object

Converts Markdown to XHTML. This class is actually just a glorified wrapper around MarkdownJ.

Author:
Nathan Winant

Constructor Summary
MarkdownProcessor()
          Constructs a MarkdownProcessor.
 
Method Summary
 void loadProperties(java.lang.String filePath)
          Load properties from an XML properties file.
static void main(java.lang.String[] args)
          So's this puppy can be called from the CLI.
 java.lang.String process(java.lang.String text)
          Convert Markdown to XHTML.
 java.lang.String processWithTitle(java.lang.String text, java.lang.String title)
          Convert Markdown to XHTML.
 void wrapInCDATA(boolean value)
          Determines if the XHTML output is wrapped in a CDATA block.
 void wrapInDocument(boolean value)
          Determines if XHTML output is wrapped in a proper XHTML document.
 void wrapInParentElement(java.lang.String elementName)
          Will wrap the resulting XHTML in an element, if not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkdownProcessor

public MarkdownProcessor()
Constructs a MarkdownProcessor.

Method Detail

processWithTitle

public java.lang.String processWithTitle(java.lang.String text,
                                         java.lang.String title)
Convert Markdown to XHTML. Specifies the value for the title tag, if wrapInDocument is true.

Parameters:
text - Input markdown text
title - Title of XHTML document
Returns:
XHTML as String

process

public java.lang.String process(java.lang.String text)
Convert Markdown to XHTML.

Parameters:
text - Input markdown text
Returns:
XHTML as String

wrapInCDATA

public void wrapInCDATA(boolean value)
Determines if the XHTML output is wrapped in a CDATA block. Default is false.


wrapInParentElement

public void wrapInParentElement(java.lang.String elementName)
Will wrap the resulting XHTML in an element, if not null.

Parameters:
elementName - Name of the element that the XHTML should be wrapped in.

wrapInDocument

public void wrapInDocument(boolean value)
Determines if XHTML output is wrapped in a proper XHTML document. Default is false.


loadProperties

public void loadProperties(java.lang.String filePath)
                    throws java.util.InvalidPropertiesFormatException,
                           java.io.IOException,
                           java.io.FileNotFoundException
Load properties from an XML properties file.

Parameters:
filePath - The path to the properties file.
Throws:
java.util.InvalidPropertiesFormatException
java.io.IOException
java.io.FileNotFoundException

main

public static void main(java.lang.String[] args)
So's this puppy can be called from the CLI.

Parameters:
-propfile - The path to the properties file. This is a flag, ie, -propfile [filePath]


Copyright © 2007 das markout Projekt. All Rights Reserved.