From 5cf7258577296d81740050b8a8c79e6ceba4d356 Mon Sep 17 00:00:00 2001 From: Cam Spiers Date: Wed, 26 Jun 2013 15:01:56 -0700 Subject: [PATCH] Provide syntax highlighting css for oblivious phame posts Summary: I have simply copied the existing css into the oblivious skin. I don't know if this is the right approach (code duplication), but considering this skin should be isolated (and will potentially differ) I think this makes sense. Test Plan: Use a code block on a phame post. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, chad Differential Revision: https://secure.phabricator.com/D6313 --- .../phame/skins/PhameBasicTemplateBlogSkin.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php b/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php index 164d0297cc..7c49d2ae1e 100644 --- a/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php +++ b/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php @@ -11,9 +11,10 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin { $root = dirname(phutil_get_library_root('phabricator')); require_once $root.'/support/phame/libskin.php'; + $this->cssResources = array(); $css = $this->getPath('css/'); + if (Filesystem::pathExists($css)) { - $this->cssResources = array(); foreach (Filesystem::listDirectory($css) as $path) { if (!preg_match('/.css$/', $path)) { continue; @@ -26,9 +27,21 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin { 'href' => $this->getResourceURI('css/'.$path), )); } - $this->cssResources = phutil_implode_html("\n", $this->cssResources); } + $map = CelerityResourceMap::getInstance(); + $symbol_info = $map->lookupSymbolInformation('syntax-highlighting-css'); + + $this->cssResources[] = phutil_tag( + 'link', + array( + 'rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => PhabricatorEnv::getCDNURI($symbol_info['uri']), + )); + + $this->cssResources = phutil_implode_html("\n", $this->cssResources); + $request = $this->getRequest(); $content = $this->renderContent($request);