ariba.ui.widgets
Class Markdown
java.lang.Object
ariba.ui.aribaweb.util.AWBaseObject
ariba.ui.aribaweb.core.AWBaseElement
ariba.ui.aribaweb.core.AWBindableElement
ariba.ui.aribaweb.core.AWContainerElement
ariba.ui.widgets.Markdown
- All Implemented Interfaces:
- AWBindable, AWCycleable, AWCycleableReference, AWElement, AWElementContaining, AWHtmlTemplateParser.FilterBody, AWHtmlTemplateParser.SupressesEmbeddedKeyPaths, AWVisitable, AWObject, java.lang.Cloneable
public class Markdown
- extends AWContainerElement
- implements AWHtmlTemplateParser.FilterBody, AWHtmlTemplateParser.SupressesEmbeddedKeyPaths
Support for the Markdown text->html format.
See http://daringfireball.net/projects/markdown/ for info on the format, and
http://sourceforge.net/projects/markdownj/ for info on the java library we're
wrapping here.
This provides an AW tag that can be use as either:
<w:Markdown>
some text
</w:Markdown>
Or:
<w:Markdown value="$someText"/>
Our filtering of markdown is enhanced in the following ways:
- leading indentation is stripped
(i.e. the indentation level of the first non-whitespace line is used
to determine the indentation level, and all lines are de-indented by
that amount).
- Code blocks are prettified
(i.e. wrapped with <div class='quoteCode'><pre class='prettyprint'>
)
- Convenient inner-document linking to headers
- All headers are given an id matching their contents (with ws converted to _)
- The format [Heading Text]# creates a hyperlink linking to that heading
(i.e. it is converted to [Heading Text](#Heading_Text], which is then
converted to <a href="#Heading_Text">Heading Text</a>
Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject |
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ariba.ui.aribaweb.core.AWElement |
clone |
Markdown
public Markdown()
translateMarkdown
public static java.lang.String translateMarkdown(java.lang.String text)
init
public void init(java.lang.String tagName,
java.util.Map bindingsHashtable)
- Specified by:
init
in interface AWBindable
- Overrides:
init
in class AWBindableElement
filterBody
public java.lang.String filterBody(java.lang.String body)
- Specified by:
filterBody
in interface AWHtmlTemplateParser.FilterBody
renderResponse
public void renderResponse(AWRequestContext requestContext,
AWComponent component)
- Description copied from interface:
AWCycleable
- The receiver should render its content to the
AWRequestContext.response()
- Specified by:
renderResponse
in interface AWCycleable
- Overrides:
renderResponse
in class AWContainerElement
- Parameters:
requestContext
- the context for the current request.component
- the current parent component
AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.