Improve diffusion readme layout

Summary: Uses more standard objects and more padding for reading. Removes the ToC, which is visually broken anyways.

Test Plan: Review a README.md in a local repository.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17752
This commit is contained in:
Chad Little
2017-04-21 10:44:11 -07:00
parent 7c61ace086
commit d3546f94c1
3 changed files with 9 additions and 18 deletions

View File

@@ -73,18 +73,6 @@ final class DiffusionReadmeView extends DiffusionView {
->getOutput($markup_object, $markup_field);
$engine = $markup_object->newMarkupEngine($markup_field);
$toc = PhutilRemarkupHeaderBlockRule::renderTableOfContents($engine);
if ($toc) {
$toc = phutil_tag_div(
'phabricator-remarkup-toc',
array(
phutil_tag_div(
'phabricator-remarkup-toc-header',
pht('Table of Contents')),
$toc,
));
$content = array($toc, $content);
}
$readme_content = $content;
$class = null;
@@ -106,15 +94,13 @@ final class DiffusionReadmeView extends DiffusionView {
}
$readme_content = phutil_tag_div($class, $readme_content);
$header = id(new PHUIHeaderView())
->setHeader($readme_name);
$document = id(new PHUIDocumentViewPro())
->setFluid(true)
->appendChild($readme_content);
return id(new PHUIObjectBoxView())
->setHeader($header)
->setHeaderText($readme_name)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($document)
->addClass('diffusion-readme-view');
}