9

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

Thanks in advance...

1
  • 4
    Stop putting [meta] as the only tag on your questions. It's not useful.
    – skaffman
    Commented May 3, 2011 at 11:34

2 Answers 2

7

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.

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.