MediaWiki API ヘルプ

このページは自動生成された MediaWiki API の説明文書ページです。

説明文書と例: https://www.mediawiki.org/wiki/API

action=parse

(main | parse)
  • このモジュールは読み取りの権限を必要とします。
  • Source: MediaWiki
  • License: GPL-2.0-or-later

Parses content and returns parser output.

See the various prop-modules of action=query to get information from the current version of a page.

There are several ways to specify the text to parse:

Specify a page or revision, using page, pageid, or oldid.

Specify content explicitly, using text, title, revid, and contentmodel.

Specify only a summary to parse. prop should be given an empty value.

パラメーター:
title

文字列が属するページのページ名。これを省略する場合、必ず contentmodel を指定しなければなりません。また、その場合 API がページ名として使用されます。

text

構文解析する文字列。コンテンツ・モデルを制御するためにはtitle または contentmodel を使用してください。

revid

Revision ID, for '"UNIQ--nowiki-00000000-QINU"' and similar variables.

Type: integer
summary

構文解析する要約

page

このページの内容を構文解析します。text および title とは同時に使用できません。

pageid

このページの内容を構文解析する。page をオーバーライドします。

Type: integer
redirects

もし page や pageid に転送ページが指定された場合、それを解決する。

Type: boolean (details)
oldid

この版の内容を構文解析する。page および pageid をオーバーライドします。

Type: integer
prop

どの情報を取得するか:

;text:ウィキテキストの解析されたテキストを提供します。

;langlinks:解析されたウィキテキストにおける言語リンクを提供します。

;categories:構文解析されたウィキテキストのカテゴリを提供します。

;categorieshtml:カテゴリのHTMLバージョンを提供します。

;links:構文解析されたウィキテキスト内で内部リンクを提供します。

;templates:構文解析されたウィキテキストでテンプレートを提供します。

;images:構文解析されたウィキテキストの画像を提供します。

;externallinks:構文解析されたウィキテキスト内で外部リンクを提供します。

;sections:構文解析されたウィキテキスト内のセクションを提供します。

;revid:構文解析されたページの版IDを追加します。

;displaytitle:構文解析されたウィキテキストのタイトルを追加します。

;headhtml:ページの解析された <head> を与える。

;modules:Gives the ResourceLoader modules used on the page. To load, use mw.loader.using(). Either jsconfigvars or encodedjsconfigvars must be requested jointly with modules.

;jsconfigvars:ページに固有のJavaScriptの設定変数を提供します。適用するには、mw.config.set()を使用します。

;encodedjsconfigvars:JSON文字列としてページに固有のJavaScriptの設定変数を提供します。

;indicators:ページ上で使用されるページのステータスインジケータのHTMLを提供します。

;iwlinks:構文解析されたウィキテキスト内でウィキ間リンクを提供します。

;wikitext:構文解析されたオリジナルのwikiテキストを提供します。

;properties:構文解析されたウィキテキスト内で定義されたさまざまなプロパティを提供します。

;limitreportdata:Gives the limit report in a structured way. Gives no data, when disablelimitreport is set.

;limitreporthtml:Gives the HTML version of the limit report. Gives no data, when disablelimitreport is set.

;parsetree:版内容のXML構文解析ツリー (requires content model wikitext)

;parsewarnings:Gives the warnings that occurred while parsing content.

;headitems:廃止予定です。 ページの <head> の中に入れてアイテムを提供します。

値 (|もしくは別の文字列で区切る): text、langlinks、categories、categorieshtml、links、templates、images、externallinks、sections、revid、displaytitle、headhtml、modules、jsconfigvars、encodedjsconfigvars、indicators、iwlinks、wikitext、properties、limitreportdata、limitreporthtml、parsetree、parsewarnings、headitems
既定値: text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties|parsewarnings
wrapoutputclass

CSS class to use to wrap the parser output.

既定値: mw-parser-output
pst

それを構文解析する前に、入力の上で事前保存の変換を実行してください。テキストで使用した場合のみ有効です。

Type: boolean (details)
onlypst

Do a pre-save transform (PST) on the input, but don't parse it. Returns the same wikitext, after a PST has been applied. Only valid when used with text.

Type: boolean (details)
effectivelanglinks
廃止予定です。

エクステンションによって供給された言語リンクが含まれています (for use with prop=langlinks).

Type: boolean (details)
section

この節番号の内容のみを構文解析します。

new のとき、ページに新しい節を追加するかのように text とsectiontitle を解析します。

new は text を指定したときのみ許可されます。

sectiontitle

section が new のときの、新しい節の節名。

ページ編集とは異なり、これは summary が省略または空のときにはフォールバックしません。

disablepp
廃止予定です。

disablelimitreport を代わりに使用してください。

Type: boolean (details)
disablelimitreport

構文解析の出力で制限レポート (New PP limit report) を省略する。

Type: boolean (details)
disableeditsection

構文解析の出力で節リンクを省略する。

Type: boolean (details)
disabletidy

構文解析の出力にHTMLのクリーンアップ (例えば整頓) を適用しない。

Type: boolean (details)
disablestylededuplication

Do not deduplicate inline stylesheets in the parser output.

Type: boolean (details)
generatexml
廃止予定です。

Generate XML parse tree (requires content model wikitext; replaced by prop=parsetree).

Type: boolean (details)
preview

プレビューモードでのパース

Type: boolean (details)
sectionpreview

Parse in section preview mode (enables preview mode too).

Type: boolean (details)
disabletoc

Omit table of contents in output.

Type: boolean (details)
useskin

Apply the selected skin to the parser output. May affect the following properties: langlinks, headitems, modules, jsconfigvars, indicators.

値 (次の値のいずれか1つ): monobook、timeless、vector
contentformat

Content serialization format used for the input text. Only valid when used with text.

値 (次の値のいずれか1つ): application/json、text/x-wiki、text/javascript、text/css、text/plain
contentmodel

Content model of the input text. If omitted, title must be specified, and default will be the model of the specified title. Only valid when used with text.

値 (次の値のいずれか1つ): GadgetDefinition、wikitext、javascript、json、css、text