Extension:SyntaxHighlight
发行状态: 稳定版 |
|
|---|---|
| 实现 | 标签 |
| 描述 | 允许对维基页面的源代码进行语法高亮 |
| 作者 |
|
| 最新版本 | 持续更新 |
| 兼容性政策 | master分支维持向后兼容。 |
| MediaWiki | 1.25+ |
| 数据库更改 | 否 |
|
|
<syntaxhighlight> |
|
| 许可证 | GNU General Public License 2.0 or later |
| 下載 | README |
| 翻译SyntaxHighlight扩展 | |
| 問題 | 开启的任务 · 报告错误 |
SyntaxHighlight(语法高亮)扩展,先前称为SyntaxHighlight_GeSHi,可使用<syntaxhighlight>标签对源代码提供富文本格式。
它是由Pygments库驅動,并支持数百种编程语言和文件格式。
如同<pre>和<poem>标签,文本将按照输入的内容准确呈现且保留所有空格。
SyntaxHighlight扩展不能在使用Hardened-PHP加固过的wiki上工作,因为缺乏proc_open, shell_exec以及其它函数。
请参阅T250763。
自1.39版本起,<syntaxhighlight>标签在单个页面(例如Wikibooks)中有5,000及以上数量的syntaxhighlight标签时被视为高开销。
在極端情況下,請在環境中增加網頁伺服器超時值。
(参见T316858。)
用法
当您安装本扩展后,您就可以在你的wiki使用“syntaxhighlight”标签。举个例子,
def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
else:
pass
这是实现上面内容的维基代码:
<syntaxhighlight lang="python" line>
def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
else:
pass
</syntaxhighlight>
为了给被嵌入引用的源代码应用语法高亮,比如代码来自一个模块调用,使用解析器函数#tag和safesubst::[1]
{{#tag:syntaxhighlight|{{safesubst:Module:Sandbox/userName/myModule}}|lang=lua}}
在MediaWiki 1.16之前,这个扩展使用的是<source>标签。
它现在仍然可以使用,但已棄用,應使用<syntaxhighlight>。
样式
如果您觉得标签里面的预览文字太大,您可以调整它通过把下面的代码拷贝到您wiki的MediaWiki:Common.css中 (创建它如果不存在的话):
/* 放置在这里的CSS会应用于全部皮肤 */
.mw-highlight pre {
font-size: 90%;
/* 在此额外插入CSS样式 */
}
代码块的外框可以通过在上方代码中插入一行border: 1px dashed blue;实现。
控制使用的字体也可以通过添加font-family: "Courier New", monospace;到上面的代码中。
A practical method to generate CSS code in bulk that corresponds to one of the color schemes supported by Pygments is to run the following command from within the MediaWiki installation folder.
以下示例产生stata-dark配色方案:
./extensions/SyntaxHighlight_GeSHi/pygments/pygmentize -S stata-dark -f html | sed 's/^/.mw-highlight /'
这将输出一大坨看起来像这样的CSS:
.mw-highlight pre { line-height: 125%; }
.mw-highlight td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
.mw-highlight span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
.mw-highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.mw-highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.mw-highlight .hll { background-color: #49483e }
.mw-highlight .c { color: #777; font-style: italic } /* Comment */
.mw-highlight .err { color: #A61717; background-color: #E3D2D2 } /* Error */
.mw-highlight .esc { color: #CCC } /* Escape */
/* ... and so on ... */
这些CSS行可以复制粘贴到MediaWiki:Common.css这样的全站CSS页面,或者MediaWiki:Vector.css这样特定于皮肤的页面。
语法高亮错误分类
该扩展将<syntaxhighlight>标签中有错误lang属性的页面添加到一个追踪分类。
消息键MediaWiki:syntaxhighlight-error-category决定了分类的名字,在本维基上为Category:Pages with syntax highlighting errors。
导致页面被此分类标记的最常见错误是<syntaxhighlight>标记根本没有lang属性,因为此扩展的旧版本支持定义$wgSyntaxHighlightDefaultLang。
这些问题标签一般可以替换成<pre>,或者可以添加lang="text"。
例如:
<syntaxhighlight lang="text">
...
</syntaxhighlight>
如果内容超过1000行或者超过100kB文本,分类也可能被添加,内容不会被高亮。[2]
参数
lang
lang="name"属性定义了应使用什么词法分析器。[3]
该语言会影响扩展如何高亮显示源代码。
参阅支持的语言这一章节获得关于受支持语言的详细内容。
def quick_sort(arr):
less = []
<syntaxhighlight lang="python">
...
</syntaxhighlight>
指定了一个无效的或未知的语言名称,则该页面会被加入跟踪分类。 参阅语法高亮错误分类章节获取详细信息。
line
line属性启用行号。
def quick_sort(arr):
less = []
<syntaxhighlight lang="python" line>
...
</syntaxhighlight>
start
start属性(与line相配合)定义了代码块的第一行行号。
例如,line start="55"将会使行号从55开始。
def quick_sort(arr):
less = []
<syntaxhighlight lang="python" line start="55">
...
</syntaxhighlight>
linelinks
| MediaWiki版本: | ≥ 1.36 Gerrit change 653142 |
linelinks属性(与line相配合)为代码块的每行添加锚点。
你可以点击行号来获得一个能高亮所选行的链接,并在内链或外链中使用。
你也可以按住⇧ Shift同时点击另一个行号来获得对选中行范围应用高亮的链接(自从MediaWiki 1.42 • change 1007640)。
若JavaScript被禁用,可以创建若干单行高亮属性,且存在的高亮会跳至正确位置,但是没有高亮;然而范围高亮完全不能使用。所以如果对可用性要求高,应尽可能使用单行高亮。
此属性的值被用作锚点的前缀,用以区分一个页面上的多个代码块
点击此处跳转并高亮上面代码块的第3行。 点击此处跳转并高亮上面代码块的第2-4行。
<syntaxhighlight lang="python" line linelinks="example">
...
</syntaxhighlight>
[[#example-3|...]]
[[#example-2--example-4|...]]
highlight
highlight属性将指定一行或多行将被标记(通过对指定的行显示不同的背景色)。
您可以指定多个行的数字通过逗号分隔(例如,highlight="1,4,8")或使用一个连字符和两个数字表示范围(例如,highlight="5-7")。
start属性对行号重排。def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
上面为下方代码的输出结果:
<syntaxhighlight lang="python" line start="3" highlight="1,5-7">
...
</syntaxhighlight>
inline
| MediaWiki版本: | ≥ 1.26 |
该属性表示源代码将作为段落的一部分内联(而不是自己的块)。 (在版本1.26引入)
class="nowrap"(在那些受支持的维基;见下方)或style="white-space:nowrap"则是不换行的。例如:
以下lambda x: x * 2是在Python的Lambda表达式。
是下方的结果:
以下<syntaxhighlight lang="python" inline>lambda x: x * 2</syntaxhighlight>是在Python的[[w:zh:匿名函数|Lambda表达式]]。
class
当使用了inline时,指定class="nowrap"(在那些受到支持的维基上,而不是MediaWiki本身)不应在代码块内的空格处出现换行符。
例如:
没有class="nowrap":
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlambda x: x * 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
使用style="white-space:nowrap":
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlambda x: x * 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
style
style属性允许CSS属性被直接包含。
这相当于将块封装在<div>标签(不是<span>标签)中。
tab‑size属性不能够通过这种方式指定。它需要<span>标签封装,像下方高级段落中描述的样子。
例如:
def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
else:
pass
是下方的结果:
<syntaxhighlight lang="python" style="border: 3px dashed blue;">
def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
else:
pass
</syntaxhighlight>
copy
| MediaWiki版本: | ≥ 1.43 |
copy属性添加一个按钮链接,点击时能够将代码内容复制至剪切板。
inline属性冲突。 如果二者均指定,copy会被忽略。例如:
def quick_sort(arr):
less = []
实现代码:
<syntaxhighlight lang="python" copy>
def quick_sort(arr):
less = []
</syntaxhighlight>
支持的语言
Pygments库使用被称作词法分析器的内置的、基于正则表达式的词法分析机制,为数以百计的编程语言和文件格式提供语法高亮。
一般地,lang使用小写语言名称,但在Pygments文档中许多语言也有别称或缩写;参见Pygments lexers和SyntaxHighlight.lexers.php
先前GeSHi支持的语言已经映射到等同的Pygments词法分析器,参见 SyntaxHighlightGeSHiCompat.php。
截至2020年1月,Pygments支持的完整语言列表为:
编程语言
- ActionScript
- Ada
- Agda(包括literate)
- Alloy
- AMPL
- ANTLR
- APL
- AppleScript
- 组装(各种)
- Asymptote
- Augeas
- AutoIt
- Awk
- BBC Basic
- Befunge
- BlitzBasic
- Boa
- Boo
- Boogie
- BrainFuck
- C,C ++(包括其变体,例如Arduino)
- C#
- Chapel
- Charm++ CI
- Cirru
- Clay
- Clean
- Clojure
- CoffeeScript
- ColdFusion
- Common Lisp
- Component Pascal
- Coq
- Croc (MiniD)
- Cryptol(包括Literate Cryptol)
- Crystal
- Cypher
- Cython
- D
- Dart
- DCPU-16
- Delphi
- Dylan(包括控制台)
- Eiffel
- Elm
- Emacs Lisp
- Erlang(包括shell session)
- Ezhil
- Factor
- Fancy
- Fantom
- Fennel
- FloScript
- Forth
- Fortran
- FreeFEM++
- F#
- GAP
- Gherkin (Cucumber)
- GLSL shaders
- Golo
- Gosu
- Groovy
- Haskell(包括Literate Haskell)
- HLSL
- HSpec
- Hy
- IDL
- Idris(包括Literate Idris)
- Igor Pro
- Io
- Jags
- Java
- JavaScript
- Jasmin
- Jcl
- Julia
- Kotlin
- Lasso(包括模板)
- Limbo
- LiveScript
- Logtalk
- Logos
- Lua
- Mathematica
- Matlab
- Modelica
- Modula-2
- Monkey
- Monte
- MoonScript
- Mosel
- MuPad
- NASM
- Nemerle
- NesC
- NewLISP
- Nimrod
- Nit
- Notmuch
- NuSMV
- Objective-C
- Objective-J
- Octave
- OCaml
- Opa
- OpenCOBOL
- ParaSail
- Pawn
- PHP
- Perl 5
- Pike
- Pony
- PovRay
- PostScript
- PowerShell
- Praat
- Prolog
- Python(包括控制台会话和回溯)
- QBasic
- Racket
- Raku a.k.a. Perl 6
- REBOL
- Red
- Redcode
- Rexx
- Ride
- Ruby(包括irb会话)
- Rust
- S, S-Plus, R
- Scala
- Scdoc
- Scheme
- Scilab
- SGF
- Shell脚本(Bash、Tcsh、Fish)
- Shen
- Silver
- Slash
- Slurm
- Smalltalk
- SNOBOL
- Snowball
- Solidity
- SourcePawn
- Stan
- Standard ML
- Stata
- Swift
- Swig
- SuperCollider
- Tcl
- Tera Term language
- TypeScript
- TypoScript
- USD
- Unicon
- Urbiscript
- Vala
- VBScript
- Verilog, SystemVerilog
- VHDL
- Visual Basic.NET
- Visual FoxPro
- Whiley
- Xtend
- XQuery
- Zeek
- Zephir
- Zig
模板语言
- Angular模板
- Cheetah模板
- ColdFusion
- Django / Jinja模板
- ERB(Ruby模板)
- Evoque
- Genshi(Trac模板语言)
- Handlebars
- JSP (Java Server Pages)
- Liquid
- Myghty(基于HTML::Mason的框架)
- Mako(Myghty的接替版本)
- Slim
- Smarty模板(PHP模板引擎)
- Tea
- Twig
其他标记
- Apache配置文件
- Apache Pig
- BBCode
- CapDL
- Cap'n Proto
- CMake
- Csound代码
- CSS
- Debian控制文件
- 文件差异
- Dockerfiles
- DTD
- EBNF
- 电子邮件标头
- Extempore
- Flatline
- Gettext目录
- Gnuplot脚本
- Groff命令
- Hexdump
- HTML
- HTTP会话
- IDL
- Inform
- INI风格的配置文件
- IRC日志(irssi风格)
- Isabelle
- JSGF记号
- JSON, JSON-LD
- Lean定理证明器
- Lighttpd配置文件
- Linux内核日志(dmesg)
- LLVM汇编
- LSL脚本
- Makefiles
- MoinMoin/Trac Wiki标记
- MQL
- MySQL
- NCAR语言
- Nginx配置文件
- Nix语言
- NSIS脚本
- Notmuch
- POV-Ray场景
- Puppet
- QML
- Ragel
- Redcode
- ReST
- Roboconf
- Robot Framework
- RPM规范文件
- Rql
- RSL
- Scdoc
- SPARQL
- SQL,以及MySQL、SQLite
- Squid配置文件
- TADS 3
- Terraform
- TeX
- Thrift
- TOML
- Treetop语法
- USD (Universal Scene Description)
- Varnish配置文件
- VGL
- Vim Script
- WDiff
- Windows批处理文件
- XML
- XSLT
- YAML
- Windows注册表文件
- ansys
- apdl
- asc
- gcode
- golang === go
- gsql
- jslt
- julia-repl
- kuin
- meson
- nestedtext
- nodejsrepl
- nt
- omg-idl
- output
- pem
- procfile
- pwsh
- smithy
- teal
- thingsdb
- ti
- wast
- wat
GeSHi之前支持的词法分析器
以下是GeSHi可以高亮显示的部分语言清单,在切换到Pygments之后不再支持语言的被用横线删去。
| GeSHi之前支持的词法分析器 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
安装
- 下载文件,并解压
SyntaxHighlight_GeSHi文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
- 只有是從Git安裝的才需运行Composer来安装PHP依赖,通过发行
composer install --no-dev至扩展的目录。 (参见T173141了解潜在问题。) - 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
- 在Linux中,请为pygmentize二进制文件设置可执行权限。 您可以使用FTP客户端或以下shell命令执行此操作:
chmod a+x /path/to/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
使用Vagrant安装:
- 如果你有使用Vagrant,请通过
vagrant roles enable syntaxhighlight --provision安装
所以,在从Git安装之后,切换到包含该扩展的目录。例如:
"../extensions/SyntaxHighlight_GeSHi/"并运行composer install --no-dev,或在更新时:composer update --no-dev。或者最好将
"extensions/SyntaxHighlight_GeSHi/composer.json"添加到在Wiki根目录下的"composer.local.json"文件中,例如:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
现在运行composer update --no-dev。
配置
$wgSyntaxHighlightMaxLines, $wgSyntaxHighlightMaxBytes
|
Optional | 出于性能原因,大于这些数值的二进制大对象或文件(JS, Lua和CSS页面)不会高亮。 (在版本1.40引入) |
- Linux
$wgPygmentizePath
|
Optional | Pygments包中pygmentize的绝对路径。 默认情况下,扩展中附带了Pygments包,$wgPygmentizePath指向默认了Pygments包,但如果需要,您可以指向不同的版本。 例如:$wgPygmentizePath = "/usr/local/bin/pygmentize";。
|
- Windows
- 若您在一台Windows主机上运行MediaWiki,您需要设置Pygmentize.exe的位置
$wgPygmentizePath = "c:\\Python27\\Scripts\\pygmentize.exe";。- 若没有
pygmentize.exe,从命令行运行在Scripts目录中的easy_install Pygments来生成文件。
- 若没有
若您在使用附带的pygmentize二进制文件(extensions/SyntaxHighlight_GeSHi/pygments/pygmentize),确保您的网络服务器允许执行它。
若您的主机商不允许添加可执行文件到站点目录,安装python-pygments并添加$wgPygmentizePath = pygmentize到LocalSettings.php中。
- 问题排除
找升级到MediaWiki 1.26 版本及其以后,一些用户开始报告与这个扩展的问题。 有些情况下,当某些语言(如Lua)可能无法突出显示并打开调试中时,MediaWiki会抛出错误Notice: Failed to invoke Pygments: /usr/bin/env: python3: No such file or directory。
- 尝试在
LocalSettings.php指定$wgPygmentizePath为外部pygmentize二进制文件。
- In shared hosting environments with cPanel, this can be done by setting up a new Python application through the "Setup Python App" menu, and activating the virtual environment for the app through SSH (
source /virtualenv/python/3.5/bin/activate). After this, the Pygments module can be added to the Python app, for which navigate to the virtual environment path (cd virtualenv/python/3.5/bin/), download and install Pygments (./pip install Pygments) and then activate the module by adding "Pygments" under the "Existing applications" section of the "Setup Python App" menu. This will create the required file at path:virtualenv/python/3.5/bin/pygmentize
- In shared hosting environments with cPanel, this can be done by setting up a new Python application through the "Setup Python App" menu, and activating the virtual environment for the app through SSH (
- 获取更多建议和信息,请参见phab:T128993。
- SELinux can also prevent the extension from running with an error similar to
type=AVC msg=audit(1609598265.169:225924): avc: denied { execute } for pid=2360888 comm="bash" name="pygmentize" dev="dm-0" ino=50814399 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_user_content_t:s0 tclass=file permissive=0in your audit.log. This can be allowed withsetsebool -P httpd_unified 1 - In earlier versions of this extension, Windows would sometimes fail with an _Py_HashRandomization_Init error. This was a bug with the Windows environment not being passed to python executions. A fix was released in 1.40, with backports to 1.38 and 1.39.
可视化编辑器集成
该插件允许使用可视化编辑器直接编辑语法高亮代码块。
若用户想要编辑syntaxhighlight段落,会打开一个对话框。
要使其工作,可视化编辑器必须从最新git版本被安装和配置,与Parsoid相同。
该功能在较老的Parsoid版本中随机地无法使用。
参见Extension:SyntaxHighlight/VisualEditor获取更多细节
Using with MediaWiki-Docker
See MediaWiki-Docker/Extension/SyntaxHighlight for instructions on configuring a MediaWiki-Docker environment for SyntaxHighlight usage, development, and testing.
高级信息
- 与
<pre>和<code>标记不同,HTML代码实体(例如 )不需要(也不应该)将&字符转义为&。 - 与
<pre>标签一样,但与<code>标签不同,范围内的标签(除了自己的结束标签)不需要将<符号转义为<,也不需要使用<nowiki>标签转义wikitext。 - 此外,虽然
<pre>假定制表符每8个字符停靠并在复制渲染文本时使用实际空格渲染制表符,<syntaxhighlight>使用4空格制表位(Internet Explorer使用8空格除外)并保留渲染文本中的制表符。<syntaxhighlight>的制表符停靠長度可透過在其內部嵌套的<span style="">標籤進行調整,該標籤用於指定tab-size值。
(其自身的 style 屬性無法用於指定制表位停靠,且<div>亦無法取而代之):<span style="-moz-tab-size: nn; -o-tab-size: nn; tab-size: nn;">
- Firefox(从4.0版到90版)需要
-moz-前缀,Opera需要-o-前缀(从10.60版到15版)。[4]
- Firefox(从4.0版到90版)需要
参阅
- Instructions on updating the pygments version used by SyntaxHighlight
- Instructions on setting up SyntaxHighlight in a MediaWiki-Docker development environment
- Pygments – Python syntax highlighter
- 基于此的扩展:
- Extension:SyntaxHighlightPages – 基于标题后缀的高亮。
- 可选扩展:
- Extension:Highlightjs Integration – 使用HighlightJS库的语法高亮(包括Maxima等一些Pygments不支持的语言)。
- Extension:ExternalContent – embed external content, such as code from GitHub, GitLab, and Bitkeeper repos with automatic rendering of Markdown files; and using syntax highlighting via the Prism.js library for nearly 300 supported languages. Content indexed by CirrusSearch
脚注
- ↑ 参见讨论“syntaxhighlight对代码嵌入的问题”
- ↑ phab:T104109#3879800
- ↑ 词法分析器:将源代码切分成令牌(tokens,或译为“形符”),即拥有指示文本语义的令牌类型(比如关键字、字符串字面量或注释)的源代码小片。 Pygments支持的每个(标记)语言都有词法分析器。 参见https://pygments.org/docs/quickstart/
- ↑ devmo:Web/CSS/tab-size
| 此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |
| 此扩展在以下wiki农场/托管网站和/或软件包中提供: |
- Extensions bundled with MediaWiki 1.21/zh
- Stable extensions/zh
- Tag extensions/zh
- ApiFormatHighlight extensions/zh
- ParserFirstCallInit extensions/zh
- ResourceLoaderRegisterModules extensions/zh
- SoftwareInfo extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- All extensions/zh
- Pages using deprecated NoteTA template
- Extensions requiring Composer with git/zh
- Extensions used on Wikimedia/zh
- Extensions included in BlueSpice/zh
- Extensions included in Canasta/zh
- Extensions available as Debian packages/zh
- Extensions included in Fandom/zh
- Extensions included in Miraheze/zh
- Extensions included in MyWikis/zh
- Extensions included in ProWiki/zh
- Extensions included in semantic::core/zh
- Extensions included in ShoutWiki/zh
- Extensions included in Telepedia/zh
- Extensions included in Weird Gloop/zh
- Extensions included in wiki.gg/zh
- Syntax highlighting extensions/zh
- GeSHi extensions/zh
- Extensions with VisualEditor support/zh
