mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 16:30:59 +01:00
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:
parent
3815668a6d
commit
0e06cd85b7
3 changed files with 11 additions and 0 deletions
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue