1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

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
This commit is contained in:
Cam Spiers 2013-06-26 15:01:56 -07:00 committed by epriestley
parent b62ecb7c11
commit 5cf7258577

View file

@ -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);