Minor improvements to Diviner layout
Summary: - Render functions as `func()` for consistency/clarity. - Sort articles first. - Sort case insensitively. - Label the "no group" symbols. Test Plan: Regenerated and examined docs. Reviewers: btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8480
This commit is contained in:
@@ -46,6 +46,7 @@ final class DivinerBookController extends DivinerController {
|
||||
->setViewer($viewer)
|
||||
->withBookPHIDs(array($book->getPHID()))
|
||||
->execute();
|
||||
|
||||
$atoms = msort($atoms, 'getSortKey');
|
||||
|
||||
$group_spec = $book->getConfig('groups');
|
||||
@@ -64,8 +65,11 @@ final class DivinerBookController extends DivinerController {
|
||||
$out = array();
|
||||
foreach ($groups as $group => $atoms) {
|
||||
$group_name = $book->getGroupName($group);
|
||||
if (!strlen($group_name)) {
|
||||
$group_name = pht('Free Radicals');
|
||||
}
|
||||
$section = id(new DivinerSectionView())
|
||||
->setHeader($group_name);
|
||||
->setHeader($group_name);
|
||||
$section->addContent($this->renderAtomList($atoms));
|
||||
$out[] = $section;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,18 @@ abstract class DivinerController extends PhabricatorController {
|
||||
|
||||
$list = array();
|
||||
foreach ($symbols as $symbol) {
|
||||
|
||||
switch ($symbol->getType()) {
|
||||
case DivinerAtom::TYPE_FUNCTION:
|
||||
$title = $symbol->getTitle().'()';
|
||||
break;
|
||||
default:
|
||||
$title = $symbol->getTitle();
|
||||
break;
|
||||
}
|
||||
|
||||
$item = id(new DivinerBookItemView())
|
||||
->setTitle($symbol->getTitle())
|
||||
->setTitle($title)
|
||||
->setHref($symbol->getURI())
|
||||
->setSubtitle($symbol->getSummary())
|
||||
->setType(DivinerAtom::getAtomTypeNameString(
|
||||
|
||||
Reference in New Issue
Block a user