Extension:CodeMirror/zh

CodeMirror扩展为MediaWiki中的wiki文本（源代码）编辑器提供语法高亮功能. 它会在编辑工具栏中添加一个图标为的按钮，点击可以切换开启和关闭语法高亮. 支持2010年WikiEditor工具栏以及可视化编辑器工具栏.

语法高亮功能默认关闭. 开启功能后，它将使用CodeMirror库提供的编辑器替换标准的多行文本框. 功能关闭后，不产生效果.

The colors used in this extension have been optimised for higher contrast, accessibility and better readability and now conform to the Web Content Accessibility Guidelines (WCAG 1.4.3 AA). The colors provide better access for people with limited vision as well as for users working in bright daylight conditions.

Bracket matching
This feature highlights the innermost pair of brackets when the cursor lies between any bracket pair, and when the cursor lies directly next to a bracket, the feature highlights the corresponding matching bracket. Bracket matching is active in both editors when syntax highlighting is turned on in any namespace using these editors.

Line numbering
In the wikitext edit mode line numbers are automatically displayed in both editors.

Colorblind mode
For users who have difficulty distinguishing between colors, CodeMirror offers a colorblind-friendly mode. This feature can be activated on wikis with CodeMirror enabled by navigating to Special:Preferences page.



With the colorblind-friendly scheme active, the colors of the following page elements change:

In addition, background highlights and colors are removed from all text and objects. Bolding and underlining behavior remains unaffected.

浏览器支持
支持所有受MediaWiki支持的浏览器.

配置
颜色和样式的自定义见元维基帮助页面. 您可以使用自定义的wikitext语法高亮样式. 所用的样式在这里. 您的自定义样式应放入.

添加上述代码到你的的结尾.

To try out the new features mentioned above in your local installation, add the following lines as well. Note: these features are intended to become default features. Once made default, these settings may no longer have an effect.

扩展集成
如果你的MediaWiki扩展添加了新的标签并且想确保CodeMirror正确高亮其中的内容，可以为你的扩展添加CodeMirror支持. 两则例子：扩展和扩展.

JavaScript integration
The following front-end hooks are used in this extension:

有待完成

 * 高亮定义列表 (foo :bar )
 * 自动完成（T95100）
 * 代码折叠
 * 高亮gallery标签中的内容

参见

 * 缺失的功能和错误概述：MediaWiki-extensions-CodeMirror
 * User:Remember the dot/Syntax highlighter
 * Community Tech/Wikitext editor syntax highlighting - includes information on customizing the colors
 * c:Category:MediaWiki extension CodeMirror
 * Community Tech/Wikitext editor syntax highlighting - includes information on customizing the colors
 * c:Category:MediaWiki extension CodeMirror
 * c:Category:MediaWiki extension CodeMirror