API:Parsing wikitext/zh

解析（Parse）动作用来处理及渲染维基源代码. 如果仅仅想要获得维基源代码，可以用查询动作（Query）.

expandtemplates
返回 preprocessed 维基源代码 (comments stripped, 模板 expanded, etc.)

参数

 * : 维基源代码 to preprocess
 * : Act like the 维基源代码 is on the page specified (default: )
 * This only really matters when parsing links to the page itself or links to subpages, or when using magic words like.

Possible errors
None.

parse
返回解析后的维基源代码

参数

 * ：Disable the PP Report from the parser output. 类型： 布尔值
 * ：解析 the content of this revision. Overrides   and  .  类型： 字符串
 * ：Only do a pre-save transform (PST) on the input, don't 解析 it. 类型： 布尔值
 * 返回 the same 维基源代码, after a PST has been applied. Ignored if ,   or   is used.  类型： 布尔值
 * ：解析 the content of this page. Cannot be used together with  and  . 类型： 字符串
 * ：解析 the content of this page. Overrides . 类型： 字符串
 * ：Which pieces of information to get. A pipe character  separated list containing one or more of the following options:
 * ：解析维基源代码，返回HTML.
 * ：获取 the langlinks the 解析后的维基源代码.
 * ：获取指定的维基源代码中所包含的分类.
 * ：获取 the html version of the categories.
 * ：获取 the html version of the languagelinks.
 * ：获取指定的维基源代码中所包含的内部链接.
 * ：获取指定的维基源代码中所使用的模板.
 * ：获取指定的维基源代码中所包含的图片.
 * ：获取指定的维基源代码中所包含的外部链接.
 * ：解析维基源代码，获取所有章节（即目录）. 返回值带有以下属性：
 * ：If  was used, specify the ID of the revision parsed.
 * ：Adds the title of the 解析后的维基源代码.
 * ：获取 items to put in the of the page.
 * ：获取 parsed of the page.
 * ：获取 interwiki links in the 解析后的维基源代码.
 * NOTE: Section tree is only generated if there are more than 4 sections, if the keyword is present, or if   is explicitly requested and the page contains headings/sub-headings (overrides  ).
 * 类型： 字符串


 * ：Do a pre-save transform (PST) on the input before parsing it (makes  work properly, expands tildes to signatures, etc.). Ignored if ,   or   is used. 类型：布尔值
 * ：If the  parameter is set to a redirect, resolve it. 类型：布尔值
 * ：Only retrieve the content of this section number. 类型：字符串
 * ：Retrieve the page's TOC (if any exists). 类型：字符串
 * ：Summary to 解析. 类型：字符串
 * ：维基源代码 to 解析. 类型：字符串
 * ：Act like the 维基源代码 is on this page (default: ). 类型： 字符串
 * This only really matters when parsing links to the page itself or subpages, or when using magic words like.
 * ：The language code ("en" for English, "fr" for French, etc.) of the language in which the text or the page should be parsed. 类型： 字符串
 * This is useful for language-dependent content, such as generated by the 模板 at the Commons, or generally by things dependent on  . Prior to MediaWiki 1.17, this worked by accident; since 1.17, it works by design.
 * ：Content model of the input text. Default is the model of the specified title, or  if title is not specified. Only valid when used with text. Can be one of the following: 维基源代码, javascript, css, text, JsonZeroConfig, Scribunto, JsonSchema.
 * ：Generate the XML parse tree (requires contentmodel=wikitext). 类型： 布尔值

可能的错误
Note:  is returned only for syntactically invalid page titles (eg. empty). Trying to fetching a missing page will 返回 the rendered HTML of the "page missing" notice, not an error. However, you can check the  attribute of, which will always be   for missing pages.
 * ：There is no revision ID oldid
 * ：The page you specified doesn't exist
 * ：There is no page with ID $1
 * ：There is no section sectionnumber in page
 * ：The page parameter cannot be used together with the text and title parameters
 * ：You don't have permission to view deleted revisions
 * ：You need read permission to use this module