php – 如何使用MediaWiki解析器从wikitext获取HTML

我正在尝试使用Wikipedia的Mediawiki解析器来解析维基百科标记文本到HTML.
在这里阅读了手册 – https://www.mediawiki.org/wiki/Manual:Parser.php
但是,因为我是PHP的新手,所以我无法编写测试脚本,

这是我想要解析并转换为HTML的示例输入:

Shakespeare's sonnets
==Characters==
When analysed as characters, the subjects of the sonnets are usually referred
to as the Fair Youth, the Rival Poet, and the Dark Lady. The speaker expresses
admiration for the Fair Youth's beauty, and later has an affair with the Dark
Lady. It is not kNown whether the poems and their characters are fiction or
autobiographical; scholars who find the sonnets to be autobiographical, notably
[[A. L. Rowse]], have attempted to identify the characters with historical
individuals.

解决方法:

你甚至不必使用PHP.您可以使用Wikipedia的API(或您自己的Mediawiki安装上的API).有关更多信息,请参见Parsing wikitext.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...