MediaWiki API ヘルプ
このページは自動生成された MediaWiki API の説明文書ページです。
説明文書と例: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
action=compare
- このモジュールは読み取りの権限を必要とします。
 - ソース: MediaWiki
 - ライセンス: GPL-2.0-or-later
 
2つの版間の差分を取得します。
"from" と "to" の両方の版番号、ページ名、もしくはページIDを渡す必要があります。
- fromtitle
 比較する1つ目のページ名。
- fromid
 比較する1つ目のページID。
- 型: 整数
 - fromrev
 比較する1つ目の版。
- 型: 整数
 - 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}
 Text of the specified slot. If omitted, the slot is removed from the revision.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
 - fromsection-{slot}
 When fromtext-{slot} is the content of a single section, this is the section identifier. It will be merged into the revision specified by fromtitle, fromid or fromrev as if for a section edit.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
 - fromcontentformat-{slot}
 Content serialization format of fromtext-{slot}.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
 - 値 (次の値のいずれか1つ): 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.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
 - 値 (次の値のいずれか1つ): Scribunto、css、javascript、json、text、unknown、wikitext
 - frompst
 fromtext-{slot}に保存前変換を行います。
- 型: 真偽値 (詳細)
 - fromtext
 - 廃止予定です。
 fromslots=mainを指定し、代わりにfromtext-main を使用してください。
- fromcontentformat
 - 廃止予定です。
 fromslots=mainを指定し、代わりにfromcontentformat-main を使用してください。
- 値 (次の値のいずれか1つ): 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 を使用してください。
- 値 (次の値のいずれか1つ): Scribunto、css、javascript、json、text、unknown、wikitext
 - fromsection
 - 廃止予定です。
 'from' の内容のうち指定された節のみを使用します。
- totitle
 比較する2つ目のページ名。
- toid
 比較する2つ目のページID。
- 型: 整数
 - torev
 比較する2つ目の版。
- 型: 整数
 - torelative
 Use a revision relative to the revision determined from fromtitle, fromid or fromrev. All of the other 'to' options will be ignored.
- 値 (次の値のいずれか1つ): 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.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
 - tosection-{slot}
 When totext-{slot} is the content of a single section, this is the section identifier. It will be merged into the revision specified by totitle, toid or torev as if for a section edit.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
 - tocontentformat-{slot}
 Content serialization format of totext-{slot}.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
 - 値 (次の値のいずれか1つ): 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.
- This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
 - 値 (次の値のいずれか1つ): Scribunto、css、javascript、json、text、unknown、wikitext
 - topst
 totextに保存前変換を行います。
- 型: 真偽値 (詳細)
 - totext
 - 廃止予定です。
 toslots=mainを指定し、代わりにtotext-main を使用してください。
- tocontentformat
 - 廃止予定です。
 toslots=mainを指定し、代わりにtocontentformat-main を使用してください。
- 値 (次の値のいずれか1つ): 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 を使用してください。
- 値 (次の値のいずれか1つ): Scribunto、css、javascript、json、text、unknown、wikitext
 - tosection
 - 廃止予定です。
 'to' の内容のうち指定された節のみを使用します。
- prop
 どの情報を取得するか:
- diff
 - 差分HTML。
 - diffsize
 - 差分HTMLのサイズ (バイト数)。
 - rel
 - 存在する場合、'from' の直前、および 'to' の直後の版ID。
 - ids
 - 'from' および 'to' の版のページIDおよび版ID。
 - title
 - 'from' および 'to' の版のページ名。
 - user
 - 'from' および 'to' の版の投稿者の利用者名およびID。もし、その利用者が削除されていたら、fromuserhidden または touserhiddenプロパティを返します。
 - comment
 - 'from' および 'to' の版のコメント。もし、その版のコメントが削除されていたら、fromcommenthidden または tocommenthiddenプロパティを返します。
 - parsedcomment
 - 'from' および 'to' の版の整形済みコメント。もし、その版のコメントが削除されていたら、fromcommenthidden または tocommenthiddenプロパティを返します。
 - size
 - 'from' および 'to' の版のサイズ。
 - timestamp
 - 'from' および 'to' の版のタイムスタンプ。
 
- 値 (| または別の文字列で区切る): comment、diff、diffsize、ids、parsedcomment、rel、size、timestamp、title、user
 - 既定: diff|ids|title
 - slots
 Return individual diffs for these slots, rather than one combined diff for all slots.
- 値 (| または別の文字列で区切る): main
 - すべての値を指定するには、*を用いてください。
 - difftype
 インラインHTMLとして整形された比較を返します。
- 値 (次の値のいずれか1つ): table、unified
 - 既定: table
 
- 版1と2の差分を生成する。
 - api.php?action=compare&fromrev=1&torev=2 [サンドボックスで開く]