diff --git a/conf/default.conf.php b/conf/default.conf.php index 0548384a65..f5d14d3408 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -265,6 +265,13 @@ return array( '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 ----------------------------------------------------------------- // // Lists which uploaded file types may be viewed in the browser. If a file diff --git a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php index 15ed808532..a3f909298a 100644 --- a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php +++ b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php @@ -22,6 +22,9 @@ class DifferentialMarkupEngineFactory { $engine = new PhutilRemarkupEngine(); $engine->setConfig('preserve-linebreaks', true); + $engine->setConfig( + 'pygments.enabled', + PhabricatorEnv::getEnvConfig('pygments.enabled')); $rules = array(); $rules[] = new PhutilRemarkupRuleEscapeRemarkup(); diff --git a/src/applications/differential/parser/markup/__init__.php b/src/applications/differential/parser/markup/__init__.php index 3bd80e23da..87d1030636 100644 --- a/src/applications/differential/parser/markup/__init__.php +++ b/src/applications/differential/parser/markup/__init__.php @@ -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/diffusion'); phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/imagemacro');