2015-05-20 21:36:13 +00:00
|
|
|
{
|
|
|
|
"name": "SyntaxHighlight",
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
"version": "2.0",
|
2015-05-20 21:36:13 +00:00
|
|
|
"author": [
|
|
|
|
"Brion Vibber",
|
|
|
|
"Tim Starling",
|
|
|
|
"Rob Church",
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
"Niklas Laxström",
|
2015-05-27 16:15:00 +00:00
|
|
|
"Ori Livneh",
|
|
|
|
"Ed Sanders"
|
2015-05-20 21:36:13 +00:00
|
|
|
],
|
2017-05-10 14:18:57 +00:00
|
|
|
"url": "https://www.mediawiki.org/wiki/Extension:SyntaxHighlight",
|
2015-05-20 21:36:13 +00:00
|
|
|
"descriptionmsg": "syntaxhighlight-desc",
|
2018-01-29 05:53:44 +00:00
|
|
|
"license-name": "GPL-2.0-or-later",
|
2015-05-20 21:36:13 +00:00
|
|
|
"type": "parserhook",
|
2017-02-05 20:06:42 +00:00
|
|
|
"requires": {
|
2024-08-22 22:28:23 +00:00
|
|
|
"MediaWiki": ">= 1.43",
|
2019-04-13 15:15:49 +00:00
|
|
|
"platform": {
|
|
|
|
"ability-shell": true
|
|
|
|
}
|
2016-01-09 23:23:40 +00:00
|
|
|
},
|
2015-05-20 21:36:13 +00:00
|
|
|
"MessagesDirs": {
|
|
|
|
"SyntaxHighlight_GeSHi": [
|
|
|
|
"i18n"
|
|
|
|
]
|
|
|
|
},
|
2021-09-03 02:30:32 +00:00
|
|
|
"AutoloadNamespaces": {
|
|
|
|
"MediaWiki\\SyntaxHighlight\\": "includes/"
|
|
|
|
},
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
"ResourceFileModulePaths": {
|
|
|
|
"localBasePath": "modules",
|
|
|
|
"remoteExtPath": "SyntaxHighlight_GeSHi/modules"
|
2015-05-20 21:36:13 +00:00
|
|
|
},
|
|
|
|
"ResourceModules": {
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
"ext.pygments": {
|
2021-09-03 02:30:32 +00:00
|
|
|
"class": "MediaWiki\\SyntaxHighlight\\ResourceLoaderPygmentsModule",
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
"styles": [
|
2020-12-30 15:31:33 +00:00
|
|
|
"pygments.wrapper.less"
|
Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.
Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.
To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.
The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.
Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
]
}
}
}
Then run `composer update`.
Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-16 03:52:58 +00:00
|
|
|
]
|
2021-01-01 19:48:57 +00:00
|
|
|
},
|
2021-01-03 00:25:21 +00:00
|
|
|
"ext.geshi.visualEditor": {
|
|
|
|
"scripts": [
|
|
|
|
"ve-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.dm.MWBlockSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.dm.MWInlineSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.ce.MWBlockSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.ce.MWInlineSyntaxHighlightNode.js",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightWindow.js",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.js",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.js",
|
2023-05-08 07:15:48 +00:00
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js",
|
|
|
|
{
|
|
|
|
"name": "ve-syntaxhighlight/ve.MWSyntaxHighlightConfig.js",
|
|
|
|
"callback": "MediaWiki\\SyntaxHighlight\\VisualEditorConfig::makeScript"
|
|
|
|
}
|
2021-01-03 00:25:21 +00:00
|
|
|
],
|
|
|
|
"styles": [
|
|
|
|
"ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.css",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.css",
|
|
|
|
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.css"
|
|
|
|
],
|
|
|
|
"dependencies": [
|
|
|
|
"ext.visualEditor.mwcore",
|
|
|
|
"oojs-ui.styles.icons-editing-advanced"
|
|
|
|
],
|
|
|
|
"messages": [
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-code",
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-language",
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-none",
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-showlines",
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-startingline",
|
|
|
|
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title"
|
2023-08-19 06:08:26 +00:00
|
|
|
]
|
2015-05-20 21:36:13 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"Hooks": {
|
2023-08-14 18:23:40 +00:00
|
|
|
"ParserFirstCallInit": "main",
|
|
|
|
"ContentGetParserOutput": "main",
|
|
|
|
"ApiFormatHighlight": "main",
|
2024-09-09 17:42:55 +00:00
|
|
|
"SoftwareInfo": "main",
|
|
|
|
"ResourceLoaderRegisterModules": "main"
|
2023-08-14 18:23:40 +00:00
|
|
|
},
|
|
|
|
"HookHandlers": {
|
|
|
|
"main": {
|
|
|
|
"class": "MediaWiki\\SyntaxHighlight\\SyntaxHighlight"
|
|
|
|
}
|
2015-05-20 21:36:13 +00:00
|
|
|
},
|
2022-07-22 22:14:03 +00:00
|
|
|
"ParsoidModules": [
|
|
|
|
"MediaWiki\\SyntaxHighlight\\ParsoidExt"
|
|
|
|
],
|
2020-05-12 01:05:15 +00:00
|
|
|
"attributes": {
|
2020-05-12 18:27:56 +00:00
|
|
|
"SyntaxHighlight": {
|
2021-02-11 01:12:03 +00:00
|
|
|
"Models": {}
|
2020-05-12 18:27:56 +00:00
|
|
|
},
|
2020-05-12 01:05:15 +00:00
|
|
|
"VisualEditor": {
|
|
|
|
"PluginModules": [
|
|
|
|
"ext.geshi.visualEditor"
|
|
|
|
]
|
|
|
|
}
|
2015-05-20 21:36:13 +00:00
|
|
|
},
|
|
|
|
"config": {
|
2020-05-12 01:05:15 +00:00
|
|
|
"PygmentizePath": {
|
|
|
|
"value": false
|
2022-11-02 19:55:20 +00:00
|
|
|
},
|
|
|
|
"SyntaxHighlightMaxLines": {
|
|
|
|
"value": 1000
|
|
|
|
},
|
|
|
|
"SyntaxHighlightMaxBytes": {
|
|
|
|
"value": 102400
|
2020-05-12 01:05:15 +00:00
|
|
|
}
|
2015-05-29 03:39:54 +00:00
|
|
|
},
|
2015-06-26 21:39:15 +00:00
|
|
|
"TrackingCategories": [
|
2020-01-06 06:22:26 +00:00
|
|
|
"syntaxhighlight-error-category",
|
|
|
|
"syntaxhighlight-enclose-category",
|
|
|
|
"syntaxhighlight-source-category"
|
2015-06-26 21:39:15 +00:00
|
|
|
],
|
2020-05-12 01:05:15 +00:00
|
|
|
"manifest_version": 2
|
2015-05-20 21:36:13 +00:00
|
|
|
}
|