Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there is any library to convert wikitext to html format using php?

How can i convert the wikitext to html format using php ? If anyone knows the libraries please help me..

Thanks in advance...

like image 564
Royal Avatar asked May 02 '11 04:05

Royal


2 Answers

MediaWiki.org has a list of alternative parsers. A few of them use PHP.

As cbuckley indicated, MediaWiki's own parser is also written in php, but it is surely too tightly woven into MediaWiki to be of use to you.

You can also run your wikitext through the MediaWiki API's parse function or if you are exporting content from a running MediaWiki installation, fetch parsed content from the API directly: see this example on the Stack Overflow article.

Finally, you can get the non-API part of MediaWiki to output raw article HTML using "action=render". See this example on the Stack Overflow article.

like image 53
Jobjörn Folkesson Avatar answered Oct 22 '22 09:10

Jobjörn Folkesson


If you're talking about MediaWiki, the manual page for their parser may help you; there is a link to their source from there. It's not insubstantial, but you might be able to pull from it the bits relevant to you.

like image 37
cmbuckley Avatar answered Oct 22 '22 09:10

cmbuckley