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

Allow Diviner books to have a "preface" section

Summary: Ref T988. This is primarily intended to let us add the "HEY! THIS ISN'T USER DOCUMENTATION" notices to the arcanist and libphutil technical docs.

Test Plan: Added some prefaces, generated docs, looked at them.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D8410
This commit is contained in:
epriestley 2014-03-05 12:08:01 -08:00
parent feac35a0fd
commit fb52eda3d9
6 changed files with 38 additions and 22 deletions

View file

@ -401,7 +401,7 @@ return array(
'rsrc/js/application/policy/behavior-policy-control.js' => 'c01153ea', 'rsrc/js/application/policy/behavior-policy-control.js' => 'c01153ea',
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '263aeb8c', 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '263aeb8c',
'rsrc/js/application/ponder/behavior-votebox.js' => '327dbe61', 'rsrc/js/application/ponder/behavior-votebox.js' => '327dbe61',
'rsrc/js/application/projects/behavior-project-boards.js' => '1b9facd8', 'rsrc/js/application/projects/behavior-project-boards.js' => 'cbdc9b22',
'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc',
'rsrc/js/application/releeph/releeph-preview-branch.js' => '9eb2cedb', 'rsrc/js/application/releeph/releeph-preview-branch.js' => '9eb2cedb',
'rsrc/js/application/releeph/releeph-request-state-change.js' => 'fe7fc914', 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'fe7fc914',
@ -610,7 +610,7 @@ return array(
'javelin-behavior-policy-control' => 'c01153ea', 'javelin-behavior-policy-control' => 'c01153ea',
'javelin-behavior-policy-rule-editor' => '263aeb8c', 'javelin-behavior-policy-rule-editor' => '263aeb8c',
'javelin-behavior-ponder-votebox' => '327dbe61', 'javelin-behavior-ponder-votebox' => '327dbe61',
'javelin-behavior-project-boards' => '1b9facd8', 'javelin-behavior-project-boards' => 'cbdc9b22',
'javelin-behavior-project-create' => '065227cc', 'javelin-behavior-project-create' => '065227cc',
'javelin-behavior-refresh-csrf' => 'c4b31646', 'javelin-behavior-refresh-csrf' => 'c4b31646',
'javelin-behavior-releeph-preview-branch' => '9eb2cedb', 'javelin-behavior-releeph-preview-branch' => '9eb2cedb',
@ -937,15 +937,6 @@ return array(
1 => 'javelin-util', 1 => 'javelin-util',
2 => 'phabricator-keyboard-shortcut-manager', 2 => 'phabricator-keyboard-shortcut-manager',
), ),
'1b9facd8' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-util',
3 => 'javelin-stratcom',
4 => 'javelin-workflow',
5 => 'phabricator-draggable-list',
),
'1e1c8a59' => '1e1c8a59' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
@ -1225,13 +1216,6 @@ return array(
2 => 'javelin-util', 2 => 'javelin-util',
3 => 'phabricator-shaped-request', 3 => 'phabricator-shaped-request',
), ),
'62e18640' =>
array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead-normalizer',
),
'6453c869' => '6453c869' =>
array( array(
0 => 'javelin-install', 0 => 'javelin-install',
@ -1265,6 +1249,13 @@ return array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
1 => 'javelin-dom', 1 => 'javelin-dom',
), ),
'62e18640' =>
array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead-normalizer',
),
'75903ee1' => '75903ee1' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
@ -1698,6 +1689,15 @@ return array(
2 => 'javelin-stratcom', 2 => 'javelin-stratcom',
3 => 'phabricator-phtize', 3 => 'phabricator-phtize',
), ),
'cbdc9b22' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-util',
3 => 'javelin-stratcom',
4 => 'javelin-workflow',
5 => 'phabricator-draggable-list',
),
'cd9e7094' => 'cd9e7094' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',

View file

@ -83,17 +83,26 @@ final class DivinerBookController extends DivinerController {
} }
private function buildPropertyList(DivinerLiveBook $book) { private function buildPropertyList(DivinerLiveBook $book) {
$user = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($user); ->setUser($viewer);
$policies = PhabricatorPolicyQuery::renderPolicyDescriptions( $policies = PhabricatorPolicyQuery::renderPolicyDescriptions(
$user, $viewer,
$book); $book);
$view->addProperty( $view->addProperty(
pht('Updated'), pht('Updated'),
phabricator_datetime($book->getDateModified(), $user)); phabricator_datetime($book->getDateModified(), $viewer));
$preface = $book->getPreface();
if (strlen($preface)) {
$view->addTextContent(
PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($preface),
'default',
$viewer));
}
return $view; return $view;
} }

View file

@ -38,6 +38,10 @@ final class DivinerLiveBook extends DivinerDAO
return $this->getConfig('short', $this->getTitle()); return $this->getConfig('short', $this->getTitle());
} }
public function getPreface() {
return $this->getConfig('preface');
}
public function getGroupName($group) { public function getGroupName($group) {
$groups = $this->getConfig('groups'); $groups = $this->getConfig('groups');
$spec = idx($groups, $group, array()); $spec = idx($groups, $group, array());

View file

@ -37,6 +37,7 @@ abstract class DivinerWorkflow extends PhabricatorManagementWorkflow {
'name' => 'string', 'name' => 'string',
'title' => 'optional string', 'title' => 'optional string',
'short' => 'optional string', 'short' => 'optional string',
'preface' => 'optional string',
'root' => 'optional string', 'root' => 'optional string',
'uri.source' => 'optional string', 'uri.source' => 'optional string',
'rules' => 'optional map<regex, string>', 'rules' => 'optional map<regex, string>',

View file

@ -2,6 +2,7 @@
"name" : "phabdev", "name" : "phabdev",
"title" : "Phabricator Technical Documentation", "title" : "Phabricator Technical Documentation",
"short" : "Phabricator Tech Docs", "short" : "Phabricator Tech Docs",
"preface" : "Technical documentation intended for Phabricator developers.",
"root" : "../../../", "root" : "../../../",
"uri.source" : "uri.source" :
"https://secure.phabricator.com/diffusion/P/browse/master/%f$%l", "https://secure.phabricator.com/diffusion/P/browse/master/%f$%l",

View file

@ -2,6 +2,7 @@
"name" : "phabricator", "name" : "phabricator",
"title" : "Phabricator User Documentation", "title" : "Phabricator User Documentation",
"short" : "Phabricator User Docs", "short" : "Phabricator User Docs",
"preface" : "Instructions for installing, configuring, and using Phabricator.",
"root" : "../../../", "root" : "../../../",
"uri.source" : "uri.source" :
"https://secure.phabricator.com/diffusion/P/browse/master/%f$%l", "https://secure.phabricator.com/diffusion/P/browse/master/%f$%l",