|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.WikiRenderer
public class WikiRenderer
This class contains a set of utility static methods to process wiki text.
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
WikiRenderer()
|
Method Summary | |
---|---|
static Set<Publication> |
extractPubSetFromUrl(String text)
Returns the set of publication referenced through URL in the given text. |
static Set<Publication> |
extractPubSetFromWiki(String text)
Returns the set of publication referenced through wiki link in the given text. |
static String |
wiki2html(String text)
Deprecated. use wiki2html(String, Locale, WikiRenderingHints) |
static String |
wiki2html(String text,
Locale userLocale,
WikiRenderingHints hints)
Transform a given string formatted according the wiki text formatting rules in an HTML string. |
static String |
wiki2html(String text,
String css,
boolean isSpan,
Locale userLocale)
Deprecated. use wiki2html(String, Locale, WikiRenderingHints) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public WikiRenderer()
Method Detail |
---|
public static String wiki2html(String text)
wiki2html(String, Locale, WikiRenderingHints)
text
- the wiki text to format
public static String wiki2html(String text, String css, boolean isSpan, Locale userLocale)
wiki2html(String, Locale, WikiRenderingHints)
text
- the wiki text to formatcss
- the name of the CSS class to useisSpan
- if true generate a span instead of divuserLocale
- an optionnal (though highly recommended)
Locale
of the user for which the text will be generated
public static String wiki2html(String text, Locale userLocale, WikiRenderingHints hints)
Wiki format | HTML output |
---|---|
*bold* | <b>italic</b> |
_italic_ | <i>bold</i> |
__bold italic__ | <b><i>bold italic</i></b> |
=fixed font= | <code>fixed font</code> |
==bold fixed font== | <code><b>bold fixed font</b></code> |
Paragraphe A blank line | <p> |
Heading At least three dashes at the beginning of a line, followed by plus sign and the heading text. One plus creates a level 1 heading (most important), two pluses a level 2 heading ; the maximum is 6. ---++ 1. A title | <h1>A title</h1> <h2>A subtitle</h2> |
Separator At least 3 dashes at the beginning of a line --------- | <hr> |
List item A multiple of three spaces and an asterisk * A list item | <ul> <li>A list item <ul> <li>A nested list item </ul> </ul> |
Oredered list A multiple of three spaces and a number 1 A first item | <ol> <li>A first item <li>A second item </ol> |
Definition list Three spaces, the term, a colon, followed by the definition Note: Terms with spaces are not supported. In case you do have a term with more than one word, separate the words with dashes or with the non-breaking-space entity. USB: Universal Serial Bus | <dl> <dt>USB</dt><dd>Universal Serial Bus</dd> <dt>Firewire (IEEE 1394)</dt><dd>High Performance Serial Bus</dd> </dl> |
Publication Links A publication's title or id enclosed in double square brackets. [[The title of a publication]] | <a href="link to the publication">Title of the publication</a> |
Images insertion A valid image file name (ending with .jpg, .gif or .png) upload/gallery/image.jpg | <img src="upload/gallery/image.jpg"> |
File Links A valid image file name enclosed in double square brackets. [[upload/pdf/overview.pdf]] | <a href="upload/pdf/overview.pdf">overview.pdf</a> |
text
- the wiki text to format.
if null or empty, an empty string is immediately returned.userLocale
- an optionnal (though highly recommended)
Locale
of the user for which the text will be generated.
if null, the channel default locale will be used.hints
- the rendering options to use, if null, the default options will be used.
public static Set<Publication> extractPubSetFromWiki(String text)
text
- the text
public static Set<Publication> extractPubSetFromUrl(String text)
text
- the text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |