Differential D21768 Diff 51887 src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
Show All 25 Lines | return array( | ||||
$this->newOption( | $this->newOption( | ||||
'syntax-highlighter.engine', | 'syntax-highlighter.engine', | ||||
'class', | 'class', | ||||
'PhutilDefaultSyntaxHighlighterEngine') | 'PhutilDefaultSyntaxHighlighterEngine') | ||||
->setBaseClass('PhutilSyntaxHighlighterEngine') | ->setBaseClass('PhutilSyntaxHighlighterEngine') | ||||
->setSummary(pht('Default non-pygments syntax highlighter engine.')) | ->setSummary(pht('Default non-pygments syntax highlighter engine.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Phabricator can highlight PHP by default and use Pygments for '. | 'You can provide a custom highlighter engine by extending '. | ||||
'other languages if enabled. You can provide a custom '. | 'class %s.', | ||||
'highlighter engine by extending class %s.', | |||||
'PhutilSyntaxHighlighterEngine')), | 'PhutilSyntaxHighlighterEngine')), | ||||
$this->newOption('pygments.enabled', 'bool', false) | $this->newOption('pygments.enabled', 'bool', false) | ||||
->setSummary( | ->setSummary( | ||||
pht('Should Phabricator use Pygments to highlight code?')) | pht('Use Pygments to highlight code?')) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Use Pygments'), | pht('Use Pygments'), | ||||
pht('Do Not Use Pygments'), | pht('Do Not Use Pygments'), | ||||
)) | )) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Phabricator supports syntax highlighting a few languages by '. | 'Syntax highlighting a supported for a few languages by '. | ||||
'default, but you can install Pygments (a third-party syntax '. | 'default, but you can install Pygments (a third-party syntax '. | ||||
'highlighting tool) to provide support for many more languages.'. | 'highlighting tool) to provide support for many more languages.'. | ||||
"\n\n". | "\n\n". | ||||
'To install Pygments, visit '. | 'To install Pygments, visit '. | ||||
'[[ http://pygments.org | pygments.org ]] and follow the '. | '[[ http://pygments.org | pygments.org ]] and follow the '. | ||||
'download and install instructions.'. | 'download and install instructions.'. | ||||
"\n\n". | "\n\n". | ||||
'Once Pygments is installed, enable this option '. | 'Once Pygments is installed, enable this option '. | ||||
'(`pygments.enabled`) to make Phabricator use Pygments when '. | '(`pygments.enabled`) to make use of Pygments when '. | ||||
'highlighting source code.'. | 'highlighting source code.'. | ||||
"\n\n". | "\n\n". | ||||
'After you install and enable Pygments, newly created source '. | 'After you install and enable Pygments, newly created source '. | ||||
'code (like diffs and pastes) should highlight correctly. '. | 'code (like diffs and pastes) should highlight correctly. '. | ||||
'You may need to clear Phabricator\'s caches to get previously '. | 'You may need to clear caches to get previously '. | ||||
'existing source code to highlight. For instructions on '. | 'existing source code to highlight. For instructions on '. | ||||
'managing caches, see [[ %s | Managing Caches ]].', | 'managing caches, see [[ %s | Managing Caches ]].', | ||||
$caches_href)), | $caches_href)), | ||||
$this->newOption( | $this->newOption( | ||||
'pygments.dropdown-choices', | 'pygments.dropdown-choices', | ||||
'wild', | 'wild', | ||||
array( | array( | ||||
'apacheconf' => 'Apache Configuration', | 'apacheconf' => 'Apache Configuration', | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |