mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 18:51:12 +01:00
Setup check to install/enable pygments
Summary: Fixes T6533 - actively prompt the user to install and enable pygments Test Plan: uninstalled / disabled pygments and checked setup checks Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6533 Differential Revision: https://secure.phabricator.com/D11048
This commit is contained in:
parent
9dd0eca335
commit
736857d1f6
1 changed files with 18 additions and 1 deletions
|
@ -3,7 +3,6 @@
|
|||
final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck {
|
||||
|
||||
protected function executeChecks() {
|
||||
|
||||
$pygment = PhabricatorEnv::getEnvConfig('pygments.enabled');
|
||||
|
||||
if ($pygment) {
|
||||
|
@ -47,6 +46,24 @@ final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck {
|
|||
->addPhabricatorConfig('environment.append-paths');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$summary = pht('Pygments should be installed and enabled '.
|
||||
'to provide advanced syntax highlighting.');
|
||||
|
||||
$message = pht('Phabricator can highlight a few languages by default, '.
|
||||
'but installing and enabling Pygments (a third-party highlighting '.
|
||||
'tool) will add syntax highlighting for many more languages. '."\n\n".
|
||||
'For instructions on installing and enabling Pygments, see the '.
|
||||
'%s configuration option.'."\n\n".
|
||||
'If you do not want to install Pygments, you can ignore this issue.',
|
||||
phutil_tag('tt', array(), 'pygments.enabled'));
|
||||
|
||||
$this
|
||||
->newIssue('pygments.noenabled')
|
||||
->setName(pht('Install Pygments to Improve Syntax Highlighting'))
|
||||
->setSummary($summary)
|
||||
->setMessage($message)
|
||||
->addRelatedPhabricatorConfig('pygments.enabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue