扩展:Linter
Linter 发布状态: 稳定版 |
|
---|---|
![]() |
|
实现 | 特殊页面 |
描述 | 显示与追踪lint错误 |
作者 | Kunal Mehta (Legoktm讨论) |
数据庫更改 | 是 |
表 | linter |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下载 | README |
|
|
翻譯Linter擴充功能如在translatewiki.net可用 | |
问题 | 尚未完成的工作 · 回報錯誤 |
Linter扩展可以用一个外部服务追踪lint错误。 目前的主要用途是追踪由Parsoid发现的错误并报告给编者。 想要修复错误的用户可以查看帮助:扩展:Linter 的帮助。
安装
This extension requires Parsoid to be installed and linting enabled in Parsoid's configuration.
- 下载文件,并将其放置在您
extensions/
文件夹中的Linter
目录内。 - 将下列代码放置在您的LocalSettings.php的底部:
wfLoadExtension( 'Linter' );
- 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
- 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。
致使用MediaWiki 1.24或更早版本的用户:
上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()
。
如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'Linter' );
,您需要使用:
require_once "$IP/extensions/Linter/Linter.php";
配置参数
在你的Parsoid config.yaml,设置:
linting: true
linter:
sendAPI: true
API
list=linterrors (lnt)
- This module requires read rights.
- Source: Linter
- License: GPL-2.0-or-later
Get a list of lint errors
Parameters:
- lntcategories
Categories of lint errors
- Values (separate with | or alternative): bogus-image-options, deletable-table-tag, fostered, html5-misnesting, misc-tidy-replacement-issues, misnested-tag, missing-end-tag, multi-colon-escape, multiline-html-table-in-list, multiple-unclosed-formatting-tags, obsolete-tag, pwrap-bug-workaround, self-closed-tag, stripped-tag, tidy-font-bug, tidy-whitespace-bug, unclosed-quotes-in-heading, wikilink-in-extlink
- Default: deletable-table-tag|html5-misnesting|misc-tidy-replacement-issues|multiline-html-table-in-list|multiple-unclosed-formatting-tags|pwrap-bug-workaround|self-closed-tag|tidy-font-bug|tidy-whitespace-bug|unclosed-quotes-in-heading|bogus-image-options|fostered|misnested-tag|multi-colon-escape|wikilink-in-extlink|missing-end-tag|obsolete-tag|stripped-tag
- lntlimit
Number of results to query
- Type: integer or max
- The value must be between 1 and 500.
- Default: 10
- lntnamespace
Only include lint errors from the specified namespaces
- Values (separate with | or alternative): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600, 5500, 5501
- To specify all values, use *.
- lntpageid
Only include lint errors from the specified page IDs
- Type: list of integers
- Separate values with | or alternative.
- Maximum number of values is 50 (500 for clients allowed higher limits).
- lnttitle
Only include lint errors from the specified page title
- lntfrom
Lint ID to start querying from
- Type: integer
Example:
- Get all lint errors of the obsolete-tag category
- api.php?action=query&list=linterrors&lntcategories=obsolete-tag [open in sandbox]
Linter 分类
Linter分类的列表在网站信息属性。
参见
此扩展被用于一个或多个维基媒体项目上。 这可能意味着扩展稳定且工作良好,足以用在同等高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中寻找此扩展名称以查看安装它的网站。 详细的已安装扩展的完整列表可在wiki的Special:Version页面找到。 |