User:Jesankar ncsu/sandbox

The Bliki engine (also known as the Java Wikipedia API) is a Java library used for converting between MediaWiki (Wikipedia) syntax and HTML. It also supports converting MediaWiki syntax to plain text and contains helper classes for working with MediaWiki dump files. An example of the syntax equivalence between MediaWiki code and HTML can be found here.

History
The Bliki engine was initially released as an Eclipse plugin (Eclipse Wikipedia Editor plugin, version 2.0.5) in October, 2006. The first version of the Bliki engine as a Java library (Java Wikipedia API) was 3.0.1, and was released on January 20th, 2008. The most up-to-date version of the library is 3.0.19. The first commit to the project was made in December, 2006 and the most recent commit was made in January, 2016.

Installation
If you are using Maven, add the following repository to your pom.xml:



along with the following dependency for the bliki-core jar file:



and if you also want the Bliki addons jar, include the below dependency as well:



If you are not using Maven, then grab the jars directly from the project page. In this case, you may also want to download the Bliki's dependency jars available as bliki.core.libs.001.zip.

Features
The Bliki engine supports the following list of features:

Wikipedia/MediaWiki Syntax to HTML
The Bliki engine can render MediaWiki syntax to HTML. It can render wiki tags for bold, italic, headers, source, image etc. Wiki tables, lists, categories, footnotes and some of the template parser functions are also supported.

HTML syntax to Wiki syntax
The classes used for converting from HTML to Wiki syntax are contained under the  package hierarchy. The following packages can be used for converting to wiki formats:


 * - converts HTML source code to the Wikipedia syntax.
 * - converts HTML to the Google code project hosting wiki syntax.
 * - converts HTML to the JSPWiki wiki syntax.

Convert MediaWiki syntax to plain text
Bliki has  class which can be used to convert MediaWiki syntax to plain text.

APIs for working with MediaWiki XML dump files
Bliki has helper classes (example: ) which can be used to parse MediaWiki XML dump files. These can be used to convert the XML dump to plain text or to HTML.

Converter Tool
A Java GUI converter tool is provided which allows the user to experiment with the Bliki conversion methods for Wiki2HTML, Plain2Wiki and HTML2Wiki.

MediaWiki syntax to HTML
The following code snippet shows a basic example of converting MediaWiki syntax to HTML. The  class needs to be imported. Then, the  method is called with the MediaWiki code to be converted.

now contains HTML markup.

HTML to MediaWiki syntax
To convert HTML code to Mediawiki syntax,  and   classes have to be imported. The HTML code is set by calling  method on a   object. Then, the converter's  method is called with a   instance to perform the conversion.

now contains equivalent MediaWiki syntax.

If the html conversion string above was  we would have got back the wiki input in the first example

MediaWiki syntax to plain text
To convert MediaWiki text to plain text you will have to import and use the   class.

The program above will remove the MediaWiki syntax (Hyperlink of 'Hello World' to wiki page and bold formatting of the word 'example') and output simple plain text.

Parsing MediaWiki XML dump files
In this example, we will make use of the  class which iterates through the MediaWiki XML dump file and parses each article in the dump. The dump of Wikipedia articles is available from the Database dump progress page.

is an interface for a filter which processes all articles from a given Wikipedia XML dump file. The  class here implements the   interface. The method  gets called on each article parsed by the   and its title gets printed if it implements the category namespace. A sample of the titles printed when the above code is executed is shown below:

Alternative tools
The Bliki engine is just one of many tools that can convert MediaWiki syntax into other formats. Some notable alternatives include:
 * WikiModel, another Java library which can convert wiki pages to well-formed XHTML and XML
 * XWiki, which converts syntax from additional types of wiki software into XHTML/HTML
 * Sweble Wikitext Parser, which generates machine-readable abstract syntax trees to show the structure of a wiki article

Related Links
Online Wikipedia Markup Converter.