Add a syntax highlight dropdown, if pygments is enabled.

Summary:
- Add a default list of supported languages to default.conf.php
  and make the initial/default value customizable.
- Store a '' in the database to infer the language from the filename/title.

Test Plan:
Tested in my sandbox with pygments enabled and disabled and various
combinations of filename/extension/dropdown selection.

Reviewers:
epriestley

CC:

Differential Revision: 587
This commit is contained in:
Ricky Elrod
2011-07-03 18:29:58 -04:00
parent fc28ab06c2
commit 9454060c29
7 changed files with 75 additions and 10 deletions

View File

@@ -96,7 +96,7 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
$text_list = explode(
"\n", $highlightEngine->highlightSource(
$paste->getTitle(),
nonempty($paste->getLanguage(), $paste->getTitle()),
$file->loadFileData()));
$rows = $this->buildDisplayRows($text_list);