T4 WikiParser (T4-WP) 1.0.004 stable
Release date: 2009-12-20
Written by: Yaroslav Stavnichiy, 
Home page: http://t4-wiki-parser.googlecode.com/
Licensed under the Apache License, Version 2.0
Download binary + source zip-archive.
Online demo: http://www.mforum.ru/t4/WikiDemo
Please report errors to author. Comments and suggestions welcome.
Release Notes
WikiParser.jar contains Java source files as well as compiled classes.
ys.wikiparser.demo.WikiParserDemo class can be used as example of using
and integrating WikiParser into your code.
WikiParser implements Creole 1.0
wiki format with some minor deviations, which can be easily fixed if required.
Deviations from Creole 1.0
- Nowiki blocks and spans:
- Nowiki blocks and spans {{{...}}} can start and end anywhere
(within text, in lists, table cells). If }}} needs to be included
into nowiki-block it has to be escaped by ~}}}. If nowiki block
has to end with tilde (~), insert newline after tilde; for inline
nowiki just put tilde outside nowiki block: nowiki~.
- Nowiki is treated as a block if it has newline characters within it.
Block nowikis are rendered with <pre> tag, inline nowikis rendered
without any additional tags around (monospaced font can be turned on by ##).
- Mixed lists:
- Escaping:
- Tilde only escapes characters that otherwise would be treated as markup.
If tilde is found in front of other characters it is treated literally: ~example.
- Extensions:
- Underlined and monospaced font styles.
- Quotes (>), indents (:), and centered paragraphs (!). These can be intermixed with lists (*#).
- Unnumbered lists can be done with minus (-) character as well as with (*).
- Table cells can span multiple columns (by using multiple pipes in a row: |||).
- Double minus (--) surrounded by spaces produces – ( – ).
- Some HTML character entities are supported: © ® ™
— – “ ” € • · « » etc.
(and of course).
These are defined in ys.wikiparser.Utils class and can be extended.
- <<<TOC>>> macro to generate table of contents based on headings in text
- Headings are given unique generated id's to be referred from TOC, etc.
- Simplified Mediawiki-style multiline tables ({| ... | ... |- ... | ... |}) to allow structured wiki content within cells.
- new: centered paragraphs
- new: Mediawiki-style multiline tables
- new: table of contents generation
- fixed: paragraph breaks in blockquotes
- fixed: tilde escaping behavior
- other fixes
- fixed: bug in nested lists algorithm.
- fixed: unclosed bold/italic text will end at the end of table cells.
Demos
This file is written to illustrate WikiParser's syntax.
You can generate XHTML version of it by using the following command:
java -jar WikiParser.jar WikiParser.txt WikiParser.htm
Bold, Italic, Underlined, Monospaced
You can make things bold or italic or both + underline.
Monospaced text **no markup** or monospaced bold text **no markup**
Links
You can use internal links (eg. links to your own wikipedia's tags) or external links,
give the link a different display text.
Free links without braces are rendered as well, like http://www.wikicreole.org/ and http://www.wikicreole.org/users/~example.
Horizontal Rule
You can use ---- to draw a line to separate the page:
Lists, Quotes, Indents
Unnumbered lists:
- item a
- item b
- bold item c
Lists can be numbered or even mixed up:
- item a
- item b
- bold sub item of b
- underlined sub item of b
- sub-sub-item 1
- sub-sub-item 2
Quotes can be mixed with lists.
... so do indents.
... at multiple levels
Nowiki and Escape
You can use block nowiki syntax if you would like do stuff like this:
Guitar Chord C:
||---|---|---|
||-0-|---|---|
||---|-0-|---|
||---|---|-0-|
||---|---|---|
... or inline nowiki: ** not bold **.
Single character escape is done by a tilde: ~
Normal link: http://wikicreole.org/ - now same link, but escaped: http://wikicreole.org/
Normal asterisks: **not bold**
A tilde escapes itself: ~bold.
Tables
Tables are done like this:
| header1 | headerl2 |
| col1 | col2 | col3 |
| can have | in a cell | colspan=2 |
| colspan=3 |
- Can have lists within cells
|
Can have centered paragraphs
|
As well as
multiline
no-wiki blocks
|
| And even nested | mini-tables |
|
Images
Creole cheat sheet image:
