mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-08 22:01:03 +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:
parent
b62ecb7c11
commit
5cf7258577
1 changed files with 15 additions and 2 deletions
|
@ -11,9 +11,10 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin {
|
||||||
$root = dirname(phutil_get_library_root('phabricator'));
|
$root = dirname(phutil_get_library_root('phabricator'));
|
||||||
require_once $root.'/support/phame/libskin.php';
|
require_once $root.'/support/phame/libskin.php';
|
||||||
|
|
||||||
|
$this->cssResources = array();
|
||||||
$css = $this->getPath('css/');
|
$css = $this->getPath('css/');
|
||||||
|
|
||||||
if (Filesystem::pathExists($css)) {
|
if (Filesystem::pathExists($css)) {
|
||||||
$this->cssResources = array();
|
|
||||||
foreach (Filesystem::listDirectory($css) as $path) {
|
foreach (Filesystem::listDirectory($css) as $path) {
|
||||||
if (!preg_match('/.css$/', $path)) {
|
if (!preg_match('/.css$/', $path)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -26,9 +27,21 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin {
|
||||||
'href' => $this->getResourceURI('css/'.$path),
|
'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();
|
$request = $this->getRequest();
|
||||||
$content = $this->renderContent($request);
|
$content = $this->renderContent($request);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue