Pygments support for Phabricator
Summary: Thread a config option through, see D197. Test Plan: Source code gets highlighted. Reviewed By: aran Reviewers: aran, tomo, jungejason, tuomaspelkonen CC: aran Differential Revision: 198
This commit is contained in:
@@ -265,6 +265,13 @@ return array(
|
|||||||
'phabricator.timezone' => null,
|
'phabricator.timezone' => null,
|
||||||
|
|
||||||
|
|
||||||
|
// Phabricator can highlight PHP by default, but if you want syntax
|
||||||
|
// highlighting for other languages you should install the python package
|
||||||
|
// 'Pygments', make sure the 'pygmentize' script is available in the
|
||||||
|
// $PATH of the webserver, and then enable this.
|
||||||
|
'pygments.enabled' => false,
|
||||||
|
|
||||||
|
|
||||||
// -- Files ----------------------------------------------------------------- //
|
// -- Files ----------------------------------------------------------------- //
|
||||||
|
|
||||||
// Lists which uploaded file types may be viewed in the browser. If a file
|
// Lists which uploaded file types may be viewed in the browser. If a file
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ class DifferentialMarkupEngineFactory {
|
|||||||
$engine = new PhutilRemarkupEngine();
|
$engine = new PhutilRemarkupEngine();
|
||||||
|
|
||||||
$engine->setConfig('preserve-linebreaks', true);
|
$engine->setConfig('preserve-linebreaks', true);
|
||||||
|
$engine->setConfig(
|
||||||
|
'pygments.enabled',
|
||||||
|
PhabricatorEnv::getEnvConfig('pygments.enabled'));
|
||||||
|
|
||||||
$rules = array();
|
$rules = array();
|
||||||
$rules[] = new PhutilRemarkupRuleEscapeRemarkup();
|
$rules[] = new PhutilRemarkupRuleEscapeRemarkup();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'infrastructure/env');
|
||||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/differential');
|
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/differential');
|
||||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/diffusion');
|
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/diffusion');
|
||||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/imagemacro');
|
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/imagemacro');
|
||||||
|
|||||||
Reference in New Issue
Block a user