MediaWiki API 說明

此頁為自動產生的 MediaWiki API 說明文件頁面。

說明文件與範例:https://www.mediawiki.org/wiki/API

action=compare

main | compare

比較 2 個頁面間的差異。

"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.

多值 (以 |alternative 分隔):main
fromtext-{slot}

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

这是一个模板参数。当做出请求时,参数名中的{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的值。
單值:text/x-wikitext/javascriptapplication/jsontext/csstext/plain
fromcontentmodel-{slot}

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

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

fromtext执行预保存转变。

類型:布林值(詳細資訊
fromtext
已停用。

指定 fromslots=main 並改用 fromtext-main

fromcontentformat
已停用。

指定 fromslots=main 並改使用 fromcontentformat-main

單值:text/x-wikitext/javascriptapplication/jsontext/csstext/plain
fromcontentmodel
已停用。

指定 fromslots=main 並改使用 fromcontentmodel-main

單值:wikitextjavascriptjsoncsstext
fromsection
已停用。

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

totitle

要比對的第二個標題。

toid

要比對的第二個頁面 ID。

類型:整數
torev

要比對的第二個修訂。

類型:整數
torelative

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

單值:prevnextcur
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.

多值 (以 |alternative 分隔):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}

totext-{slot} 的內容序列化格式。

这是一个模板参数。当做出请求时,参数名中的{slot}应替换为toslots的值。
單值:text/x-wikitext/javascriptapplication/jsontext/csstext/plain
tocontentmodel-{slot}

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

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

totext 執行預先保存轉換。

類型:布林值(詳細資訊
totext
已停用。

指定 toslots=main 並改用 totext-main

tocontentformat
已停用。

指定 toslots=main 並改使用 tocontentformat-main

單值:text/x-wikitext/javascriptapplication/jsontext/csstext/plain
tocontentmodel
已停用。

指定 toslots=main 並改使用 tocontentmodel-main

單值:wikitextjavascriptjsoncsstext
tosection
已停用。

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

prop

要取得的資訊部份。

diff
HTML 差異。
diffsize
以位元組為單位的 HTML 差異大小。
rel
“from”之前及“to”之后修订版本的修订ID,如果有。
ids
「from」與「to」修訂的頁面與修訂 ID。
title
「from」與「to」修訂的頁面標題。
user
「from」與「to」修訂的使用者名稱與 ID。
comment
「from」與「to」修訂的註釋。
parsedcomment
「from」與「to」修訂的解析註釋。
size
「from」與「to」修訂的大小。
多值 (以 |alternative 分隔):diffdiffsizerelidstitleusercommentparsedcommentsize
預設值:diff|ids|title
slots

Return individual diffs for these slots, rather than one combined diff for all slots.

多值 (以 |alternative 分隔):main
要指定所有值,請使用*
範例:
建立修訂 1 與 1 的差異檔
api.php?action=compare&fromrev=1&torev=2 [在沙盒中開啟]