Differential D25002 Diff 39 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 '. | '%s can highlight PHP by default and use Pygments for '. | ||||
'other languages if enabled. You can provide a custom '. | 'other languages if enabled. You can provide a custom '. | ||||
'highlighter engine by extending class %s.', | 'highlighter engine by extending class %s.', | ||||
PhabricatorPlatformSite::getName(), | |||||
'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('Should %s use Pygments to highlight code?', | ||||
PhabricatorPlatformSite::getName())) | |||||
->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 '. | '%s supports syntax highlighting 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 %s use 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 %s\'s 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 ]].', | ||||
PhabricatorPlatformSite::getName(), | |||||
PhabricatorPlatformSite::getName(), | |||||
PhabricatorPlatformSite::getName(), | |||||
$caches_href)), | $caches_href)), | ||||
$this->newOption( | $this->newOption( | ||||
'pygments.dropdown-choices', | 'pygments.dropdown-choices', | ||||
'wild', | 'wild', | ||||
array( | array( | ||||
'apacheconf' => 'Apache Configuration', | 'apacheconf' => 'Apache Configuration', | ||||
'bash' => 'Bash Scripting', | 'bash' => 'Bash Scripting', | ||||
'brainfuck' => 'Brainf*ck', | 'brainfuck' => 'Brainf*ck', | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0