MediaWiki API 帮助

这是自动生成的MediaWiki API文档页面。

文档和例子:https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=compare

main | compare

获取两页面之间的差异。

必须传递“from”和“to”之间的修订版本号、页面标题、页面ID、文本或相关参考资料。

参数:
fromtitle

要比较的第一个标题。

fromid

要比较的第一个页面 ID。

类型:整数
fromrev

要比较的第一个修订版本。

类型:整数
fromslots

Override content of the revision specified by fromtitle, fromid or fromrev.

This parameter specifies the slots that are to be modified. Use fromtext-{slot}, fromcontentmodel-{slot}, and fromcontentformat-{slot} to specify content for each slot.

值(以|替代物分隔):main
fromtext-{slot}

指定间隔的文本。若忽略,该间隔将从修订中移除。

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为fromslots的值。
fromsection-{slot}

When fromtext-{slot} is the content of a single section, this is the section number. It will be merged into the revision specified by fromtitle, fromid or fromrev as if for a section edit.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为fromslots的值。
fromcontentformat-{slot}

fromtext-{slot}的内容序列化格式

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为fromslots的值。
以下值中的一个:application/json、application/octet-stream、application/unknown、application/x-binary、text/css、text/javascript、text/plain、text/unknown、text/x-wiki、unknown/unknown
fromcontentmodel-{slot}

Content model of fromtext-{slot}. If not supplied, it will be guessed based on the other parameters.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为fromslots的值。
以下值中的一个:Scribunto、css、javascript、json、text、unknown、wikitext
frompst

fromtext-{slot}执行预保存转变。

Type: boolean (details)
fromtext
已弃用。

指定fromslots=main并改用fromtext-main

fromcontentformat
已弃用。

指定fromslots=main并改用fromcontentformat-main

以下值中的一个:application/json、application/octet-stream、application/unknown、application/x-binary、text/css、text/javascript、text/plain、text/unknown、text/x-wiki、unknown/unknown
fromcontentmodel
已弃用。

指定fromslots=main并改用fromcontentmodel-main

以下值中的一个:Scribunto、css、javascript、json、text、unknown、wikitext
fromsection
已弃用。

只使用指定“from”内容的指定章节。

totitle

要比较的第二个标题。

toid

要比较的第二个页面 ID。

类型:整数
torev

要比较的第二个修订版本。

类型:整数
torelative

使用与定义自fromtitlefromidfromrev的修订版本相关的修订版本。所有其他“to”的选项将被忽略。

以下值中的一个:cur、next、prev
toslots

Override content of the revision specified by totitle, toid or torev.

This parameter specifies the slots that are to be modified. Use totext-{slot}, tocontentmodel-{slot}, and tocontentformat-{slot} to specify content for each slot.

值(以|替代物分隔):main
totext-{slot}

Text of the specified slot. If omitted, the slot is removed from the revision.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为toslots的值。
tosection-{slot}

When totext-{slot} is the content of a single section, this is the section number. It will be merged into the revision specified by totitle, toid or torev as if for a section edit.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为toslots的值。
tocontentformat-{slot}

Content serialization format of totext-{slot}.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为toslots的值。
以下值中的一个:application/json、application/octet-stream、application/unknown、application/x-binary、text/css、text/javascript、text/plain、text/unknown、text/x-wiki、unknown/unknown
tocontentmodel-{slot}

Content model of totext-{slot}. If not supplied, it will be guessed based on the other parameters.

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为toslots的值。
以下值中的一个:Scribunto、css、javascript、json、text、unknown、wikitext
topst

totext执行预保存转换。

Type: boolean (details)
totext
已弃用。

指定 fromslots=main 并改用 totext-main

tocontentformat
已弃用。

指定toslots=main并改用tocontentformat-main

以下值中的一个:application/json、application/octet-stream、application/unknown、application/x-binary、text/css、text/javascript、text/plain、text/unknown、text/x-wiki、unknown/unknown
tocontentmodel
已弃用。

指定toslots=main的内容模型并改用tocontentmodel-main

以下值中的一个:Scribunto、css、javascript、json、text、unknown、wikitext
tosection
已弃用。

只使用指定“to”内容的指定章节。

prop

要获取的信息束。

diff
差异HTML。
diffsize
差异HTML的大小(字节)。
rel
“from”之前及“to”之后修订版本的修订ID,如果有。
ids
“from”和“to”修订版本的页面及修订ID。
title
“from”和“to”修订版本的页面标题。
user
“from”和“to”修订版本的用户名和 ID。若该用户已被删除修订,将返回fromuserhiddentouserhidden属性。
comment
“from”和“to”修订版本的注释。若该注释已被删除修订,将返回fromcommenthiddentocommenthidden属性。
parsedcomment
“from”和“to”修订版本的已解析注释。若该注释已被删除修订,将返回fromcommenthiddentocommenthidden属性。
size
“from”和“to”修订版本的大小。
timestamp
(没有说明)
值(以|替代物分隔):comment、diff、diffsize、ids、parsedcomment、rel、size、timestamp、title、user
默认:diff|ids|title
slots

返回这些间隔的个别差异,而非所有间隔合并而得到的单个差异。

值(以|替代物分隔):main
要指定所有值,请使用*
例子:
在版本1和2中创建差异。
api.php?action=compare&fromrev=1&torev=2 [在沙盒中打开]