راهنمای واسط برنامه‌نویسی کاربردی مدیاویکی

این یک صفحهٔ مستندات برای واسط برنامه‌نویسی کاربردی مدیاویکی است که به‌طور خودکار ایجاد شده‌است.

مستندات و نمونه‌ها: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=parse

(main | parse)
  • این پودمان نیازمند اختیارات خواندن است.
  • منبع: MediaWiki
  • مجوز: 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:

  1. Specify a page or revision, using page, pageid, or oldid.
  2. Specify content explicitly, using text, title, revid, and contentmodel.
  3. Specify only a summary to parse. prop should be given an empty value.
پارامترها:
title

Title of page the text belongs to. If omitted, contentmodel must be specified, and API will be used as the title.

text

Text to parse. Use title or contentmodel to control the content model.

revid

Revision ID, for {{REVISIONID}} and similar variables.

نوع: عدد صحیح
summary

Summary to parse.

page

Parse the content of this page. Cannot be used together with text and title.

pageid

Parse the content of this page. Overrides page.

نوع: عدد صحیح
redirects

If page or pageid is set to a redirect, resolve it.

نوع: بولی (جزئیات)
oldid

Parse the content of this revision. Overrides page and pageid.

نوع: عدد صحیح
prop

Which pieces of information to get:

text
Gives the parsed text of the wikitext.
langlinks
Gives the language links in the parsed wikitext.
categories
Gives the categories in the parsed wikitext.
categorieshtml
Gives the HTML version of the categories.
links
پیوندهای داخلی در ویکی‌متن تجزیه‌شده را برمی‌گرداند.
templates
Gives the templates in the parsed wikitext.
images
Gives the images in the parsed wikitext.
externallinks
Gives the external links in the parsed wikitext.
sections
Gives the sections in the parsed wikitext.
revid
Adds the revision ID of the parsed page.
displaytitle
Adds the title of the parsed wikitext.
subtitle
Adds the page subtitle for the parsed page.
headhtml
Gives parsed doctype, opening <html>, <head> element and opening <body> of the page.
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
Gives the JavaScript configuration variables specific to the page. To apply, use mw.config.set().
encodedjsconfigvars
Gives the JavaScript configuration variables specific to the page as a JSON string.
indicators
Gives the HTML of page status indicators used on the page.
iwlinks
Gives interwiki links in the parsed wikitext.
wikitext
Gives the original wikitext that was parsed.
properties
Gives various properties defined in the parsed wikitext.
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
The XML parse tree of revision content (requires content model wikitext)
parsewarnings
Gives the warnings that occurred while parsing content (as wikitext).
parsewarningshtml
Gives the warnings that occurred while parsing content (as HTML).
headitems
منسوخ‌شده. Gives items to put in the <head> of the page.
مقدارهای (جداشده با | یا جایگزین‌های آن): categories، categorieshtml، displaytitle، encodedjsconfigvars، externallinks، headhtml، images، indicators، iwlinks، jsconfigvars، langlinks، limitreportdata، limitreporthtml، links، modules، parsetree، parsewarnings، parsewarningshtml، properties، revid، sections، subtitle، templates، text، wikitext، 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

انجام تبدیل پیشاذخیره بر روی ورودی پیش از تجزیهٔ آن. تنها در صورت استفاده به‌همراه متن معتبر است.

نوع: بولی (جزئیات)
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.

نوع: بولی (جزئیات)
effectivelanglinks
منسوخ‌شده.

Includes language links supplied by extensions (for use with prop=langlinks).

نوع: بولی (جزئیات)
section

Only parse the content of the section with this identifier.

When new, parse text and sectiontitle as if adding a new section to the page.

new is allowed only when specifying text.

sectiontitle

New section title when section is new.

Unlike page editing, this does not fall back to summary when omitted or empty.

disablepp
منسوخ‌شده.

به جایش از disablelimitreport استفاده کن.

نوع: بولی (جزئیات)
disablelimitreport

Omit the limit report ("NewPP limit report") from the parser output.

نوع: بولی (جزئیات)
disableeditsection

Omit edit section links from the parser output.

نوع: بولی (جزئیات)
disablestylededuplication

Do not deduplicate inline stylesheets in the parser output.

نوع: بولی (جزئیات)
showstrategykeys

Whether to include internal merge strategy information in jsconfigvars.

نوع: بولی (جزئیات)
generatexml
منسوخ‌شده.

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

نوع: بولی (جزئیات)
preview

تجزیه در حالت پیش‌نمایش.

نوع: بولی (جزئیات)
sectionpreview

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

نوع: بولی (جزئیات)
disabletoc

Omit table of contents in output.

نوع: بولی (جزئیات)
useskin

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

یکی از مقدارهای زیر: apioutput، cologneblue، fallback، minerva، modern، monobook، timeless، vector، vector-2022
contentformat

قالب تسلسل محتوای مورد استفاده برای متن ورودی. تنها در صورت استفاده به‌همراه text معتبر است.

یکی از مقدارهای زیر: application/json، application/octet-stream، application/unknown، application/x-binary، text/css، text/javascript، text/plain، text/unknown، text/x-wiki، unknown/unknown
contentmodel

مدل محتوای متن ورودی. اگر استفاده نشود، title باید مشخص شود و پیش‌فرض آن برابر با مدل محتوای عنوان مشخص‌شده خواهد بود. تنها در صورت استفاده به‌همراه text معتبر است.

یکی از مقدارهای زیر: GadgetDefinition، MassMessageListContent، Scribunto، css، javascript، json، sanitized-css، text، unknown، wikitext
mobileformat

Return parse output in a format suitable for mobile devices.

نوع: بولی (جزئیات)