@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

More Diviner style updates

Summary: This adds a number of new styles for Diviner documentation. Not sure I've covered all the bases or wrote this in the most efficient manner, but passing it along now for early review before tightening everything up.

Test Plan: Review various class pages.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6888

+201 -70
+46 -46
src/__celerity_resource_map__.php
··· 1149 1149 ), 1150 1150 'diviner-shared-css' => 1151 1151 array( 1152 - 'uri' => '/res/582ff299/rsrc/css/diviner/diviner-shared.css', 1152 + 'uri' => '/res/cf15b860/rsrc/css/diviner/diviner-shared.css', 1153 1153 'type' => 'css', 1154 1154 'requires' => 1155 1155 array( ··· 3182 3182 ), 3183 3183 'phabricator-header-view-css' => 3184 3184 array( 3185 - 'uri' => '/res/016b9d83/rsrc/css/layout/phabricator-header-view.css', 3185 + 'uri' => '/res/83d195c2/rsrc/css/layout/phabricator-header-view.css', 3186 3186 'type' => 'css', 3187 3187 'requires' => 3188 3188 array( ··· 3774 3774 ), 3775 3775 'phui-document-view-css' => 3776 3776 array( 3777 - 'uri' => '/res/dd1ef24b/rsrc/css/phui/phui-document.css', 3777 + 'uri' => '/res/23e84bdc/rsrc/css/phui/phui-document.css', 3778 3778 'type' => 'css', 3779 3779 'requires' => 3780 3780 array( ··· 4171 4171 ), array( 4172 4172 'packages' => 4173 4173 array( 4174 - '5e2ee206' => 4174 + '1cb4ed1d' => 4175 4175 array( 4176 4176 'name' => 'core.pkg.css', 4177 4177 'symbols' => ··· 4218 4218 39 => 'phabricator-property-list-view-css', 4219 4219 40 => 'phabricator-tag-view-css', 4220 4220 ), 4221 - 'uri' => '/res/pkg/5e2ee206/core.pkg.css', 4221 + 'uri' => '/res/pkg/1cb4ed1d/core.pkg.css', 4222 4222 'type' => 'css', 4223 4223 ), 4224 4224 '8977e356' => ··· 4409 4409 ), 4410 4410 'reverse' => 4411 4411 array( 4412 - 'aphront-dialog-view-css' => '5e2ee206', 4413 - 'aphront-error-view-css' => '5e2ee206', 4414 - 'aphront-list-filter-view-css' => '5e2ee206', 4415 - 'aphront-pager-view-css' => '5e2ee206', 4416 - 'aphront-panel-view-css' => '5e2ee206', 4417 - 'aphront-table-view-css' => '5e2ee206', 4418 - 'aphront-tokenizer-control-css' => '5e2ee206', 4419 - 'aphront-tooltip-css' => '5e2ee206', 4420 - 'aphront-typeahead-control-css' => '5e2ee206', 4412 + 'aphront-dialog-view-css' => '1cb4ed1d', 4413 + 'aphront-error-view-css' => '1cb4ed1d', 4414 + 'aphront-list-filter-view-css' => '1cb4ed1d', 4415 + 'aphront-pager-view-css' => '1cb4ed1d', 4416 + 'aphront-panel-view-css' => '1cb4ed1d', 4417 + 'aphront-table-view-css' => '1cb4ed1d', 4418 + 'aphront-tokenizer-control-css' => '1cb4ed1d', 4419 + 'aphront-tooltip-css' => '1cb4ed1d', 4420 + 'aphront-typeahead-control-css' => '1cb4ed1d', 4421 4421 'differential-changeset-view-css' => '44bfe40c', 4422 4422 'differential-core-view-css' => '44bfe40c', 4423 4423 'differential-inline-comment-editor' => 'd07a3bc2', ··· 4431 4431 'differential-table-of-contents-css' => '44bfe40c', 4432 4432 'diffusion-commit-view-css' => 'c8ce2d88', 4433 4433 'diffusion-icons-css' => 'c8ce2d88', 4434 - 'global-drag-and-drop-css' => '5e2ee206', 4434 + 'global-drag-and-drop-css' => '1cb4ed1d', 4435 4435 'inline-comment-summary-css' => '44bfe40c', 4436 4436 'javelin-aphlict' => '8977e356', 4437 4437 'javelin-behavior' => '2dbbb7d1', ··· 4504 4504 'javelin-util' => '2dbbb7d1', 4505 4505 'javelin-vector' => '2dbbb7d1', 4506 4506 'javelin-workflow' => '2dbbb7d1', 4507 - 'lightbox-attachment-css' => '5e2ee206', 4507 + 'lightbox-attachment-css' => '1cb4ed1d', 4508 4508 'maniphest-task-summary-css' => '0a9e494f', 4509 4509 'maniphest-transaction-detail-css' => '0a9e494f', 4510 - 'phabricator-action-list-view-css' => '5e2ee206', 4511 - 'phabricator-application-launch-view-css' => '5e2ee206', 4510 + 'phabricator-action-list-view-css' => '1cb4ed1d', 4511 + 'phabricator-application-launch-view-css' => '1cb4ed1d', 4512 4512 'phabricator-busy' => '8977e356', 4513 4513 'phabricator-content-source-view-css' => '44bfe40c', 4514 - 'phabricator-core-css' => '5e2ee206', 4515 - 'phabricator-crumbs-view-css' => '5e2ee206', 4514 + 'phabricator-core-css' => '1cb4ed1d', 4515 + 'phabricator-crumbs-view-css' => '1cb4ed1d', 4516 4516 'phabricator-drag-and-drop-file-upload' => 'd07a3bc2', 4517 4517 'phabricator-dropdown-menu' => '8977e356', 4518 4518 'phabricator-file-upload' => '8977e356', 4519 - 'phabricator-filetree-view-css' => '5e2ee206', 4520 - 'phabricator-flag-css' => '5e2ee206', 4521 - 'phabricator-header-view-css' => '5e2ee206', 4519 + 'phabricator-filetree-view-css' => '1cb4ed1d', 4520 + 'phabricator-flag-css' => '1cb4ed1d', 4521 + 'phabricator-header-view-css' => '1cb4ed1d', 4522 4522 'phabricator-hovercard' => '8977e356', 4523 - 'phabricator-jump-nav' => '5e2ee206', 4523 + 'phabricator-jump-nav' => '1cb4ed1d', 4524 4524 'phabricator-keyboard-shortcut' => '8977e356', 4525 4525 'phabricator-keyboard-shortcut-manager' => '8977e356', 4526 - 'phabricator-main-menu-view' => '5e2ee206', 4526 + 'phabricator-main-menu-view' => '1cb4ed1d', 4527 4527 'phabricator-menu-item' => '8977e356', 4528 - 'phabricator-nav-view-css' => '5e2ee206', 4528 + 'phabricator-nav-view-css' => '1cb4ed1d', 4529 4529 'phabricator-notification' => '8977e356', 4530 - 'phabricator-notification-css' => '5e2ee206', 4531 - 'phabricator-notification-menu-css' => '5e2ee206', 4532 - 'phabricator-object-item-list-view-css' => '5e2ee206', 4530 + 'phabricator-notification-css' => '1cb4ed1d', 4531 + 'phabricator-notification-menu-css' => '1cb4ed1d', 4532 + 'phabricator-object-item-list-view-css' => '1cb4ed1d', 4533 4533 'phabricator-object-selector-css' => '44bfe40c', 4534 4534 'phabricator-phtize' => '8977e356', 4535 4535 'phabricator-prefab' => '8977e356', 4536 4536 'phabricator-project-tag-css' => '0a9e494f', 4537 - 'phabricator-property-list-view-css' => '5e2ee206', 4538 - 'phabricator-remarkup-css' => '5e2ee206', 4537 + 'phabricator-property-list-view-css' => '1cb4ed1d', 4538 + 'phabricator-remarkup-css' => '1cb4ed1d', 4539 4539 'phabricator-shaped-request' => 'd07a3bc2', 4540 - 'phabricator-side-menu-view-css' => '5e2ee206', 4541 - 'phabricator-standard-page-view' => '5e2ee206', 4542 - 'phabricator-tag-view-css' => '5e2ee206', 4540 + 'phabricator-side-menu-view-css' => '1cb4ed1d', 4541 + 'phabricator-standard-page-view' => '1cb4ed1d', 4542 + 'phabricator-tag-view-css' => '1cb4ed1d', 4543 4543 'phabricator-textareautils' => '8977e356', 4544 4544 'phabricator-tooltip' => '8977e356', 4545 - 'phabricator-transaction-view-css' => '5e2ee206', 4546 - 'phabricator-zindex-css' => '5e2ee206', 4547 - 'phui-button-css' => '5e2ee206', 4548 - 'phui-form-css' => '5e2ee206', 4549 - 'phui-form-view-css' => '5e2ee206', 4550 - 'phui-icon-view-css' => '5e2ee206', 4551 - 'phui-spacing-css' => '5e2ee206', 4552 - 'sprite-apps-large-css' => '5e2ee206', 4553 - 'sprite-gradient-css' => '5e2ee206', 4554 - 'sprite-icons-css' => '5e2ee206', 4555 - 'sprite-menu-css' => '5e2ee206', 4556 - 'syntax-highlighting-css' => '5e2ee206', 4545 + 'phabricator-transaction-view-css' => '1cb4ed1d', 4546 + 'phabricator-zindex-css' => '1cb4ed1d', 4547 + 'phui-button-css' => '1cb4ed1d', 4548 + 'phui-form-css' => '1cb4ed1d', 4549 + 'phui-form-view-css' => '1cb4ed1d', 4550 + 'phui-icon-view-css' => '1cb4ed1d', 4551 + 'phui-spacing-css' => '1cb4ed1d', 4552 + 'sprite-apps-large-css' => '1cb4ed1d', 4553 + 'sprite-gradient-css' => '1cb4ed1d', 4554 + 'sprite-icons-css' => '1cb4ed1d', 4555 + 'sprite-menu-css' => '1cb4ed1d', 4556 + 'syntax-highlighting-css' => '1cb4ed1d', 4557 4557 ), 4558 4558 ));
+2
src/__phutil_library_map__.php
··· 542 542 'DivinerRemarkupRuleSymbol' => 'applications/diviner/markup/DivinerRemarkupRuleSymbol.php', 543 543 'DivinerRenderer' => 'applications/diviner/renderer/DivinerRenderer.php', 544 544 'DivinerReturnTableView' => 'applications/diviner/view/DivinerReturnTableView.php', 545 + 'DivinerSectionView' => 'applications/diviner/view/DivinerSectionView.php', 545 546 'DivinerStaticPublisher' => 'applications/diviner/publisher/DivinerStaticPublisher.php', 546 547 'DivinerWorkflow' => 'applications/diviner/workflow/DivinerWorkflow.php', 547 548 'DoorkeeperBridge' => 'applications/doorkeeper/bridge/DoorkeeperBridge.php', ··· 2577 2578 'DivinerPublishCache' => 'DivinerDiskCache', 2578 2579 'DivinerRemarkupRuleSymbol' => 'PhutilRemarkupRule', 2579 2580 'DivinerReturnTableView' => 'AphrontTagView', 2581 + 'DivinerSectionView' => 'AphrontTagView', 2580 2582 'DivinerStaticPublisher' => 'DivinerPublisher', 2581 2583 'DivinerWorkflow' => 'PhutilArgumentWorkflow', 2582 2584 'DoorkeeperBridge' => 'Phobject',
+39 -24
src/applications/diviner/controller/DivinerAtomController.php
··· 135 135 if ($tasks) { 136 136 $methods_by_task = igroup($methods, 'task'); 137 137 138 - $document->appendChild( 139 - id(new PhabricatorHeaderView()) 140 - ->setHeader(pht('Tasks'))); 138 + $section = id(new DivinerSectionView()) 139 + ->setHeader(pht('Tasks')); 141 140 142 141 if (isset($methods_by_task[''])) { 143 142 $tasks[''] = array( ··· 148 147 } 149 148 150 149 foreach ($tasks as $spec) { 151 - $document->appendChild( 150 + $section->addContent( 152 151 id(new PhabricatorHeaderView()) 152 + ->setNoBackground(true) 153 153 ->setHeader($spec['title'])); 154 154 155 155 $task_methods = idx($methods_by_task, $spec['name'], array()); 156 - if ($task_methods) { 157 - $document->appendChild(hsprintf('<ul>')); 156 + $inner_box = id(new PHUIBoxView()) 157 + ->addPadding(PHUI::PADDING_LARGE_LEFT) 158 + ->addPadding(PHUI::PADDING_LARGE_RIGHT) 159 + ->addPadding(PHUI::PADDING_LARGE_BOTTOM); 160 + if ($task_methods) { 161 + $inner_box->appendChild(hsprintf('<ul class="diviner-list">')); 158 162 foreach ($task_methods as $task_method) { 159 163 $atom = last($task_method['atoms']); 160 - $document->appendChild( 164 + $inner_box->appendChild( 161 165 hsprintf('<li>%s()</li>', $atom->getName())); 162 166 } 163 - $document->appendChild(hsprintf('</ul>')); 167 + $inner_box->appendChild(hsprintf('</ul>')); 164 168 } else { 165 - $document->appendChild("No methods for this task."); 169 + $no_methods = pht('No methods for this task.'); 170 + $inner_box->appendChild(hsprintf('<em>%s</em>', $no_methods)); 166 171 } 172 + $section->addContent($inner_box); 167 173 } 174 + $document->appendChild($section); 168 175 } 169 176 170 - $document->appendChild( 171 - id(new PhabricatorHeaderView()) 172 - ->setHeader(pht('Methods'))); 177 + $section = id(new DivinerSectionView()) 178 + ->setHeader(pht('Methods')); 179 + 173 180 foreach ($methods as $spec) { 174 181 $matom = last($spec['atoms']); 175 182 $method_header = id(new PhabricatorHeaderView()) 183 + ->setNoBackground(true) 176 184 ->setHeader($matom->getName()); 177 185 178 186 $inherited = $spec['inherited']; ··· 187 195 $method_header->setSubheader( 188 196 $this->renderFullSignature($matom)); 189 197 190 - $document->appendChild( 198 + $section->addContent( 191 199 array( 192 200 $method_header, 193 201 $this->renderMethodDocumentationText($symbol, $spec, $engine), 194 202 $this->buildParametersAndReturn($spec['atoms']), 195 203 )); 196 204 } 205 + $document->appendChild($section); 197 206 } 198 207 199 208 if ($toc) { ··· 534 543 } else { 535 544 $atom = $symbol->getAtom(); 536 545 $undoc = DivinerAtom::getThisAtomIsNotDocumentedString($atom->getType()); 537 - $content = id(new AphrontErrorView()) 538 - ->appendChild($undoc) 539 - ->setSeverity(AphrontErrorView::SEVERITY_NODATA); 546 + $content = id(new PHUIBoxView()) 547 + ->addPadding(PHUI::PADDING_LARGE_LEFT) 548 + ->addPadding(PHUI::PADDING_LARGE_BOTTOM) 549 + ->addPadding(PHUI::PADDING_LARGE_RIGHT) 550 + ->appendChild(hsprintf('<em>%s</em>', $undoc)); 540 551 } 541 552 542 553 return $content; ··· 559 570 if (!strlen(trim($symbol->getMarkupText($field)))) { 560 571 continue; 561 572 } 562 - $out[] = phutil_tag( 563 - 'div', 564 - array(), 565 - pht('From parent implementation in %s:', $impl->getName())); 573 + $out[] = id(new PHUIBoxView()) 574 + ->addPadding(PHUI::PADDING_LARGE_LEFT) 575 + ->addPadding(PHUI::PADDING_LARGE_RIGHT) 576 + ->addClass('diviner-method-implementation-header') 577 + ->appendChild( 578 + pht('From parent implementation in %s:', $impl->getName())); 566 579 } else if ($out) { 567 - $out[] = phutil_tag( 568 - 'div', 569 - array(), 570 - pht('From this implementation:')); 580 + $out[] = id(new PHUIBoxView()) 581 + ->addPadding(PHUI::PADDING_LARGE_LEFT) 582 + ->addPadding(PHUI::PADDING_LARGE_RIGHT) 583 + ->addClass('diviner-method-implementation-header') 584 + ->appendChild( 585 + pht('From this implementation:')); 571 586 } 572 587 $out[] = $this->renderDocumentationText($symbol, $engine); 573 588 }
+43
src/applications/diviner/view/DivinerSectionView.php
··· 1 + <?php 2 + 3 + final class DivinerSectionView extends AphrontTagView { 4 + 5 + private $header; 6 + private $content; 7 + 8 + public function addContent($content) { 9 + $this->content[] = $content; 10 + return $this; 11 + } 12 + 13 + public function setHeader($text) { 14 + $this->header = $text; 15 + return $this; 16 + } 17 + 18 + public function getTagName() { 19 + return 'div'; 20 + } 21 + 22 + public function getTagAttributes() { 23 + return array( 24 + 'class' => 'diviner-document-section', 25 + ); 26 + } 27 + 28 + public function getTagContent() { 29 + require_celerity_resource('diviner-shared-css'); 30 + 31 + $header = id(new PhabricatorHeaderView()) 32 + ->setBleedHeader(true) 33 + ->setHeader($this->header); 34 + 35 + $content = id(new PHUIBoxView()) 36 + ->addPadding(PHUI::PADDING_LARGE_LEFT) 37 + ->addPadding(PHUI::PADDING_LARGE_RIGHT) 38 + ->appendChild($this->content); 39 + 40 + return array($header, $content); 41 + } 42 + 43 + }
+1
src/applications/uiexample/examples/PHUIColorPalletteExample.php
··· 43 43 ); 44 44 45 45 $blues = array( 46 + 'DDE8EF' => 'Thin Blue Border {$thinblueborder}', 46 47 'BFCFDA' => 'Light Blue Border {$lightblueborder}', 47 48 '95A6C5' => 'Blue Border {$blueborder}', 48 49 '626E82' => 'Dark Blue Border {$darkblueborder}',
+1
src/infrastructure/celerity/CelerityResourceTransformer.php
··· 160 160 'greybackground' => '#EBECEE', 161 161 162 162 // Base Blues 163 + 'thinblueborder' => '#DDE8EF', 163 164 'lightblueborder' => '#BFCFDA', 164 165 'blueborder' => '#8C98B8', 165 166 'darkblueborder' => '#626E82',
+20
src/view/layout/PhabricatorHeaderView.php
··· 8 8 private $image; 9 9 private $subheader; 10 10 private $gradient; 11 + private $noBackground; 12 + private $bleedHeader; 11 13 12 14 public function setHeader($header) { 13 15 $this->header = $header; ··· 16 18 17 19 public function setObjectName($object_name) { 18 20 $this->objectName = $object_name; 21 + return $this; 22 + } 23 + 24 + public function setNoBackground($nada) { 25 + $this->noBackground = $nada; 19 26 return $this; 20 27 } 21 28 ··· 34 41 return $this; 35 42 } 36 43 44 + public function setBleedHeader($bleed) { 45 + $this->bleedHeader = $bleed; 46 + return $this; 47 + } 48 + 37 49 public function setGradient($gradient) { 38 50 $this->gradient = $gradient; 39 51 return $this; ··· 44 56 45 57 $classes = array(); 46 58 $classes[] = 'phabricator-header-shell'; 59 + 60 + if ($this->noBackground) { 61 + $classes[] = 'phabricator-header-no-backgound'; 62 + } 63 + 64 + if ($this->bleedHeader) { 65 + $classes[] = 'phabricator-bleed-header'; 66 + } 47 67 48 68 if ($this->gradient) { 49 69 $classes[] = 'sprite-gradient';
+17
webroot/rsrc/css/diviner/diviner-shared.css
··· 56 56 width: 80%; 57 57 background-color: #fff; 58 58 } 59 + 60 + .diviner-document-section { 61 + padding: 0 0 16px 0; 62 + } 63 + 64 + .device-phone .diviner-document-section { 65 + padding: 0 8px 16px 0; 66 + } 67 + 68 + .diviner-document-section em { 69 + color: {$lightgreytext}; 70 + text-decoration: italic; 71 + } 72 + 73 + .diviner-method-implementation-header { 74 + color: {$lightgreytext}; 75 + }
+19
webroot/rsrc/css/layout/phabricator-header-view.css
··· 10 10 overflow: hidden; 11 11 } 12 12 13 + body .phabricator-header-shell.phabricator-header-no-backgound { 14 + background-color: transparent; 15 + border: none; 16 + } 17 + 18 + body .phabricator-header-shell.phabricator-bleed-header { 19 + background-color: {$lightgreybackground}; 20 + border-top: 1px solid {$thinblueborder}; 21 + border-bottom: none; 22 + width: auto; 23 + margin-bottom: 16px; 24 + } 25 + 26 + body .phabricator-header-shell.phabricator-bleed-header 27 + .phabricator-header-view { 28 + padding: 8px 24px 8px 16px; 29 + font-size: 18px; 30 + } 31 + 13 32 .phabricator-header-shell + .phabricator-form-view { 14 33 border-top-width: 0; 15 34 }
+13
webroot/rsrc/css/phui/phui-document.css
··· 67 67 border-bottom: 1px solid #BFCFDA; 68 68 } 69 69 70 + .phui-document-content 71 + .phabricator-header-shell.phabricator-header-no-backgound { 72 + border-bottom: 1px solid {$thinblueborder}; 73 + margin: 0 0 16px 0; 74 + } 75 + 76 + .phui-document-content 77 + .phabricator-header-shell.phabricator-header-no-backgound 78 + .phabricator-header-view { 79 + padding: 8px 0 4px; 80 + font-size: 14px; 81 + } 82 + 70 83 .phui-document-content .phabricator-header-view { 71 84 padding: 16px; 72 85 color: #6b748c;