1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01:00

Enable pygment highlighting for diffusion

Summary:
set the config for the diffusion highlighter. In D202 we
enabled it for differential already.

Test Plan:
opened a python file in diffusion and verified it is highlighted.

Reviewed By: epriestley
Reviewers: epriestley, tuomaspelkonen
CC: aran, epriestley
Differential Revision: 260
This commit is contained in:
jungejason 2011-05-10 15:54:11 -07:00
parent a64d5177a7
commit e8744e7eeb
2 changed files with 4 additions and 0 deletions

View file

@ -178,6 +178,9 @@ class DiffusionBrowseFileController extends DiffusionController {
list($text_list, $rev_list, $blame_dict) = $file_query->getBlameData();
$highlightEngine = new PhutilDefaultSyntaxHighlighterEngine();
$highlightEngine->setConfig(
'pygments.enabled',
PhabricatorEnv::getEnvConfig('pygments.enabled'));
$text_list = explode("\n", $highlightEngine->highlightSource($path,
implode("\n", $text_list)));

View file

@ -9,6 +9,7 @@
phutil_require_module('phabricator', 'applications/diffusion/controller/base');
phutil_require_module('phabricator', 'applications/diffusion/query/filecontent/base');
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phabricator', 'infrastructure/javelin/api');
phutil_require_module('phabricator', 'view/layout/panel');