1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Send Markdown in Diffusion through SourceSans

Summary: This moves Markdown rendering from normal fonts to PHUIDocumentView with Source Sans improving readability of this longer form text.

Test Plan:
Test libphutil and Phabricator readmes in my sandbox.

{F363483}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12330
This commit is contained in:
Chad Little 2015-04-08 09:41:56 -07:00
parent 21f0ce7362
commit ff59f4f16b
3 changed files with 29 additions and 17 deletions

View file

@ -64,6 +64,7 @@ return array(
'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33',
'rsrc/css/application/differential/table-of-contents.css' => '63f3ef4a', 'rsrc/css/application/differential/table-of-contents.css' => '63f3ef4a',
'rsrc/css/application/diffusion/diffusion-icons.css' => '9c5828da', 'rsrc/css/application/diffusion/diffusion-icons.css' => '9c5828da',
'rsrc/css/application/diffusion/diffusion-readme.css' => '2106ea08',
'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661', 'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661',
'rsrc/css/application/feed/feed.css' => 'b513b5f4', 'rsrc/css/application/feed/feed.css' => 'b513b5f4',
'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad', 'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad',
@ -531,6 +532,7 @@ return array(
'differential-revision-list-css' => 'f3c47d33', 'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => '63f3ef4a', 'differential-table-of-contents-css' => '63f3ef4a',
'diffusion-icons-css' => '9c5828da', 'diffusion-icons-css' => '9c5828da',
'diffusion-readme-css' => '2106ea08',
'diffusion-source-css' => '66fdf661', 'diffusion-source-css' => '66fdf661',
'diviner-shared-css' => '38813222', 'diviner-shared-css' => '38813222',
'font-fontawesome' => 'ae9a7b4d', 'font-fontawesome' => 'ae9a7b4d',

View file

@ -53,6 +53,7 @@ final class DiffusionReadmeView extends DiffusionView {
$readme_path = $this->getPath(); $readme_path = $this->getPath();
$readme_name = basename($readme_path); $readme_name = basename($readme_path);
$interpreter = $this->getReadmeLanguage($readme_name); $interpreter = $this->getReadmeLanguage($readme_name);
require_celerity_resource('diffusion-readme-css');
$content = $this->getContent(); $content = $this->getContent();
@ -86,7 +87,7 @@ final class DiffusionReadmeView extends DiffusionView {
} }
$readme_content = $content; $readme_content = $content;
$class = 'phabricator-remarkup'; $class = null;
break; break;
case 'rainbow': case 'rainbow':
$content = id(new PhutilRainbowSyntaxHighlighter()) $content = id(new PhutilRainbowSyntaxHighlighter())
@ -95,30 +96,25 @@ final class DiffusionReadmeView extends DiffusionView {
$readme_content = phutil_escape_html_newlines($content); $readme_content = phutil_escape_html_newlines($content);
require_celerity_resource('syntax-highlighting-css'); require_celerity_resource('syntax-highlighting-css');
$class = 'remarkup-code'; $class = 'remarkup-code ml';
break; break;
default: default:
case 'text': case 'text':
$readme_content = phutil_escape_html_newlines($content); $readme_content = phutil_escape_html_newlines($content);
$class = 'ml';
break; break;
} }
$readme_content = phutil_tag( $readme_content = phutil_tag_div($class, $readme_content);
'div', $header = id(new PHUIHeaderView())
array( ->setHeader($readme_name);
'class' => $class,
),
$readme_content);
$box = new PHUIBoxView(); return id(new PHUIDocumentView())
$box->appendChild($readme_content); ->setFluid(true)
$box->addPadding(PHUI::PADDING_LARGE); ->appendChild($readme_content)
->addClass('diffusion-readme-view')
$object_box = id(new PHUIObjectBoxView()) ->setHeader($header)
->setHeaderText($readme_name) ->setFontKit(PHUIDocumentView::FONT_SOURCE_SANS);
->appendChild($box);
return $object_box;
} }
} }

View file

@ -0,0 +1,14 @@
/**
* @provides diffusion-readme-css
*/
.device .diffusion-readme-view {
margin: 16px 8px 0;
background-color: #fff;
border: 1px solid {$lightblueborder};
border-bottom: 1px solid {$blueborder};
}
.device-tablet .diffusion-readme-view {
margin: 16px;
}