@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

Change monospace text formatting

Summary: Using `##` can cause some formatting issues, see D13071.

Test Plan: See D13071.

Reviewers: epriestley, #blessed_reviewers, chad

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

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

+254 -255
+1 -2
src/docs/contributor/adding_new_css_and_js.diviner
··· 18 18 `webroot/rsrc/css/` or `webroot/rsrc/js/` inside your `phabricator/` 19 19 directory. 20 20 21 - Each file must ##@provides## itself as a component, declared in a header 22 - comment: 21 + Each file must `@provides` itself as a component, declared in a header comment: 23 22 24 23 LANG=css 25 24 /**
+1 -1
src/docs/contributor/darkconsole.diviner
··· 37 37 = Plugin: Error Log = 38 38 39 39 The "Error Log" plugin shows errors that occurred while generating the page, 40 - similar to the httpd ##error.log##. You can send information to the error log 40 + similar to the httpd `error.log`. You can send information to the error log 41 41 explicitly with the @{function@libphutil:phlog} function. 42 42 43 43 If errors occurred, a red dot will appear on the plugin tab.
+14 -14
src/docs/contributor/javascript_coding_standards.diviner
··· 18 18 19 19 - Use two spaces for indentation. Don't use literal tab characters. 20 20 - Use Unix linebreaks ("\n"), not MSDOS ("\r\n") or OS9 ("\r"). 21 - - Put a space after control keywords like ##if## and ##for##. 21 + - Put a space after control keywords like `if` and `for`. 22 22 - Put a space after commas in argument lists. 23 - - Put space around operators like ##=##, ##<##, etc. 23 + - Put space around operators like `=`, `<`, etc. 24 24 - Don't put spaces after function names. 25 25 - Parentheses should hug their contents. 26 26 - Generally, prefer to wrap code at 80 columns. ··· 30 30 The Javascript language unambiguously dictates casing/naming rules; follow those 31 31 rules. 32 32 33 - - Name variables using ##lowercase_with_underscores##. 34 - - Name classes using ##UpperCamelCase##. 35 - - Name methods and properties using ##lowerCamelCase##. 36 - - Name global functions using ##lowerCamelCase##. Avoid defining global 33 + - Name variables using `lowercase_with_underscores`. 34 + - Name classes using `UpperCamelCase`. 35 + - Name methods and properties using `lowerCamelCase`. 36 + - Name global functions using `lowerCamelCase`. Avoid defining global 37 37 functions. 38 - - Name constants using ##UPPERCASE##. 39 - - Write ##true##, ##false##, and ##null## in lowercase. 38 + - Name constants using `UPPERCASE`. 39 + - Write `true`, `false`, and `null` in lowercase. 40 40 - "Internal" methods and properties should be prefixed with an underscore. 41 41 For more information about what "internal" means, see 42 42 **Leading Underscores**, below. 43 43 44 44 = Comments = 45 45 46 - - Strongly prefer ##//## comments for making comments inside the bodies of 46 + - Strongly prefer `//` comments for making comments inside the bodies of 47 47 functions and methods (this lets someone easily comment out a block of code 48 48 while debugging later). 49 49 50 50 = Javascript Language = 51 51 52 - - Use ##[]## and ##{}##, not ##new Array## and ##new Object##. 52 + - Use `[]` and `{}`, not `new Array` and `new Object`. 53 53 - When creating an object literal, do not quote keys unless required. 54 54 55 55 = Examples = ··· 66 66 } 67 67 68 68 You should always put braces around the body of an if clause, even if it is only 69 - one line. Note that operators like ##>## and ##===## are also surrounded by 69 + one line. Note that operators like `>` and `===` are also surrounded by 70 70 spaces. 71 71 72 72 **for (iteration):** ··· 107 107 } 108 108 109 109 `break` statements should be indented to block level. If you don't push them 110 - in, you end up with an inconsistent rule for conditional ##break## statements, 111 - as in the ##2## case. 110 + in, you end up with an inconsistent rule for conditional `break` statements, 111 + as in the `2` case. 112 112 113 - If you insist on having a "fall through" case that does not end with ##break##, 113 + If you insist on having a "fall through" case that does not end with `break`, 114 114 make it clear in a comment that you wrote this intentionally. For instance: 115 115 116 116 lang=js
+2 -2
src/docs/contributor/n_plus_one.diviner
··· 14 14 // ... 15 15 } 16 16 17 - Assuming ##load_cats()## has an implementation that boils down to: 17 + Assuming `load_cats()` has an implementation that boils down to: 18 18 19 19 SELECT * FROM cat WHERE ... 20 20 21 - ..and ##load_hats_for_cat($cat)## has an implementation something like this: 21 + ..and `load_hats_for_cat($cat)` has an implementation something like this: 22 22 23 23 SELECT * FROM hat WHERE catID = ... 24 24
+29 -29
src/docs/contributor/phabricator_code_layout.diviner
··· 20 20 21 21 = Best Practice Class and Subdirectory Organization = 22 22 23 - Suppose you were working on the application ##Derp##. 23 + Suppose you were working on the application `Derp`. 24 24 25 25 phabricator/src/applications/derp/ 26 26 27 - If ##Derp## were as simple as possible, it would have one subdirectory: 27 + If `Derp` were as simple as possible, it would have one subdirectory: 28 28 29 29 phabricator/src/applications/derp/controller/ 30 30 31 - containing the file ##DerpController.php## with the class 31 + containing the file `DerpController.php` with the class 32 32 33 - - ##DerpController##: minimally implements a ##processRequest()## method 33 + - `DerpController`: minimally implements a `processRequest()` method 34 34 which returns some @{class:AphrontResponse} object. The class would probably 35 35 extend @{class:PhabricatorController}. 36 36 37 - If ##Derp## were (relatively) complex, one could reasonably expect to see 37 + If `Derp` were (relatively) complex, one could reasonably expect to see 38 38 the following directory layout: 39 39 40 40 phabricator/src/applications/derp/conduit/ ··· 54 54 phabricator/webroot/rsrc/js/application/derp/ 55 55 phabricator/webroot/rsrc/css/application/derp/ 56 56 57 - These directories under ##phabricator/src/applications/derp/## represent 57 + These directories under `phabricator/src/applications/derp/` represent 58 58 the basic set of class types from which most Phabrictor applications are 59 - assembled. Each would contain a class file. For ##Derp##, these classes could be 59 + assembled. Each would contain a class file. For `Derp`, these classes could be 60 60 something like: 61 61 62 - - **DerpConstants**: constants used in the ##Derp## application. 62 + - **DerpConstants**: constants used in the `Derp` application. 63 63 - **DerpController**: business logic providing functionality for a given 64 64 URI. Typically, controllers load data via Storage or Query classes, then 65 65 present the data to the user via one or more View classes. 66 66 - **DerpEditor**: business logic for workflows that change one or more 67 67 Storage objects. Editor classes are only necessary for particularly 68 68 complicated edits and should be used pragmatically versus Storage objects. 69 - - **DerpException**: exceptions used in the ##Derp## application. 70 - - **DerpQuery**: query one or more storage objects for pertinent ##Derp## 69 + - **DerpException**: exceptions used in the `Derp` application. 70 + - **DerpQuery**: query one or more storage objects for pertinent `Derp` 71 71 application data. @{class:PhabricatorOffsetPagedQuery} is particularly 72 72 handy for pagination and works well with @{class:AphrontPagerView}. 73 73 - **DerpReplyHandler**: business logic from any configured email interactions 74 - users can have with the ##Derp## application. 75 - - **DerpStorage**: storage objects for the ##Derp## application. Typically 74 + users can have with the `Derp` application. 75 + - **DerpStorage**: storage objects for the `Derp` application. Typically 76 76 there is a base class which extends @{class:PhabricatorLiskDAO} to configure 77 77 application-wide storage settings like the application (thus database) name. 78 78 Reading more about the @{class:LiskDAO} is highly recommended. 79 - - **DerpView**: view objects for the ##Derp## application. Typically these 79 + - **DerpView**: view objects for the `Derp` application. Typically these 80 80 extend @{class:AphrontView}. 81 - - **DerpConduitAPIMethod**: provides any and all ##Derp## application 81 + - **DerpConduitAPIMethod**: provides any and all `Derp` application 82 82 functionality that is accessible over Conduit. 83 83 84 - However, it is likely that ##Derp## is even more complex, and rather than 84 + However, it is likely that `Derp` is even more complex, and rather than 85 85 containing one class, each directory has several classes. A typical example 86 86 happens around the CRUD of an object: 87 87 88 88 - **DerpBaseController**: typically extends @{class:PhabricatorController}, 89 - implements ##buildStandardPageResponse## with the ##Derp## application name 90 - and other ##Derp##-specific meta-data, and contains any controller-specific 91 - functionality used throughout the ##Derp## application. 92 - - **DerpDeleteController**: typically extends ##DerpBaseController## and 93 - presents a confirmation dialogue to the user about deleting a ##Derp##. 94 - - **DerpEditController**: typically extends ##DerpBaseController## and 95 - presents a form to create and edit ##Derps##. Most likely uses 96 - @{class:AphrontFormView} and various ##AphrontFormXControl## classes such as 89 + implements `buildStandardPageResponse` with the `Derp` application name 90 + and other `Derp`-specific meta-data, and contains any controller-specific 91 + functionality used throughout the `Derp` application. 92 + - **DerpDeleteController**: typically extends `DerpBaseController` and 93 + presents a confirmation dialogue to the user about deleting a `Derp`. 94 + - **DerpEditController**: typically extends `DerpBaseController` and 95 + presents a form to create and edit `Derps`. Most likely uses 96 + @{class:AphrontFormView} and various `AphrontFormXControl` classes such as 97 97 @{class:AphrontFormTextControl} to create the form. 98 - - **DerpListController**: typically extends ##DerpBaseController## and displays 99 - a set of one or more ##Derps##. Might use @{class:AphrontTableView} to create 100 - a table of ##Derps##. 101 - - **DerpViewController**: typically extends ##DerpBaseController## and displays 102 - a single ##Derp##. 98 + - **DerpListController**: typically extends `DerpBaseController` and displays 99 + a set of one or more `Derps`. Might use @{class:AphrontTableView} to create 100 + a table of `Derps`. 101 + - **DerpViewController**: typically extends `DerpBaseController` and displays 102 + a single `Derp`. 103 103 104 - Some especially awesome directories might have a ##__tests__## subdirectory 104 + Some especially awesome directories might have a `__tests__` subdirectory 105 105 containing all pertinent unit test code for the class. 106 106 107 107 = Next Steps =
+10 -10
src/docs/contributor/php_coding_standards.diviner
··· 19 19 20 20 - Use two spaces for indentation. Don't use tab literal characters. 21 21 - Use Unix linebreaks ("\n"), not MSDOS ("\r\n") or OS9 ("\r"). 22 - - Put a space after control keywords like ##if## and ##for##. 22 + - Put a space after control keywords like `if` and `for`. 23 23 - Put a space after commas in argument lists. 24 - - Put a space around operators like ##=##, ##<##, etc. 24 + - Put a space around operators like `=`, `<`, etc. 25 25 - Don't put spaces after function names. 26 26 - Parentheses should hug their contents. 27 27 - Generally, prefer to wrap code at 80 columns. 28 28 29 29 = Case and Capitalization = 30 30 31 - - Name variables and functions using ##lowercase_with_underscores##. 32 - - Name classes using ##UpperCamelCase##. 33 - - Name methods and properties using ##lowerCamelCase##. 31 + - Name variables and functions using `lowercase_with_underscores`. 32 + - Name classes using `UpperCamelCase`. 33 + - Name methods and properties using `lowerCamelCase`. 34 34 - Use uppercase for common acronyms like ID and HTML. 35 - - Name constants using ##UPPERCASE##. 36 - - Write ##true##, ##false## and ##null## in lowercase. 35 + - Name constants using `UPPERCASE`. 36 + - Write `true`, `false` and `null` in lowercase. 37 37 38 38 = Comments = 39 39 ··· 43 43 = PHP Language Style = 44 44 45 45 - Use "<?php", not the "<?" short form. Omit the closing "?>" tag. 46 - - Prefer casts like ##(string)## to casting functions like ##strval()##. 47 - - Prefer type checks like ##$v === null## to type functions like 48 - ##is_null()##. 46 + - Prefer casts like `(string)` to casting functions like `strval()`. 47 + - Prefer type checks like `$v === null` to type functions like 48 + `is_null()`. 49 49 - Avoid all crazy alternate forms of language constructs like "endwhile" 50 50 and "<>". 51 51 - Always put braces around conditional and loop blocks.
+11 -11
src/docs/contributor/unit_tests.diviner
··· 9 9 framework. This document is aimed at project contributors and describes how to 10 10 use it to add and run tests in these projects or other libphutil libraries. 11 11 12 - In the general case, you can integrate ##arc## with a custom unit test engine 12 + In the general case, you can integrate `arc` with a custom unit test engine 13 13 (like PHPUnit or any other unit testing library) to run tests in other projects. 14 14 See @{article:Arcanist User Guide: Customizing Lint, Unit Tests and Workflows} 15 15 for information on customizing engines. ··· 18 18 19 19 To add new tests to a libphutil, Arcanist or Phabricator module: 20 20 21 - - Create a ##__tests__/## directory in the module if it doesn't exist yet. 22 - - Add classes to the ##__tests__/## directory which extend from 21 + - Create a `__tests__/` directory in the module if it doesn't exist yet. 22 + - Add classes to the `__tests__/` directory which extend from 23 23 @{class:PhabricatorTestCase} (in Phabricator) or 24 24 @{class@arcanist:PhutilTestCase} (elsewhere). 25 - - Run ##arc liberate## on the library root so your classes are loadable. 25 + - Run `arc liberate` on the library root so your classes are loadable. 26 26 27 27 = Running Tests = 28 28 29 29 Once you've added test classes, you can run them with: 30 30 31 - - ##arc unit path/to/module/##, to explicitly run module tests. 32 - - ##arc unit##, to run tests for all modules affected by changes in the 31 + - `arc unit path/to/module/`, to explicitly run module tests. 32 + - `arc unit`, to run tests for all modules affected by changes in the 33 33 working copy. 34 - - ##arc diff## will also run ##arc unit## for you. 34 + - `arc diff` will also run `arc unit` for you. 35 35 36 36 = Example Test Case = 37 37 ··· 76 76 is reasonable. 77 77 - Build a real database simulation layer (fairly complex). 78 78 - Disable isolation for a single test by using 79 - ##LiskDAO::endIsolateAllLiskEffectsToCurrentProcess();## before your test 80 - and ##LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess();## after your 79 + `LiskDAO::endIsolateAllLiskEffectsToCurrentProcess();` before your test 80 + and `LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess();` after your 81 81 test. This will disable isolation for one test. NOT RECOMMENDED. 82 82 - Disable isolation for your entire test case by overriding 83 - ##getPhabricatorTestCaseConfiguration()## and providing 84 - ##self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK => false## in the configuration 83 + `getPhabricatorTestCaseConfiguration()` and providing 84 + `self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK => false` in the configuration 85 85 dictionary you return. This will disable isolation entirely. STRONGLY NOT 86 86 RECOMMENDED.
+1 -1
src/docs/contributor/using_oauthserver.diviner
··· 105 105 106 106 If the token has expired or is otherwise invalid, the client will receive 107 107 an error indicating as such. In these cases, the client should re-initiate 108 - the entire ##Authorization Code Grant## flow. 108 + the entire `Authorization Code Grant` flow. 109 109 110 110 NOTE: See "Scopes" section below for more information on what data is 111 111 currently exposed through the OAuth Server.
+6 -6
src/docs/flavor/javascript_object_array.diviner
··· 8 8 = Primitives = 9 9 10 10 Javascript has two native datatype primitives, Object and Array. Both are 11 - classes, so you can use ##new## to instantiate new objects and arrays: 11 + classes, so you can use `new` to instantiate new objects and arrays: 12 12 13 13 COUNTEREXAMPLE 14 14 var a = new Array(); // Not preferred. ··· 42 42 43 43 = Objects are Maps, Arrays are Lists = 44 44 45 - PHP has a single ##array## datatype which behaves like as both map and a list, 45 + PHP has a single `array` datatype which behaves like as both map and a list, 46 46 and a common mistake is to treat Javascript arrays (or objects) in the same way. 47 47 **Don't do this.** It sort of works until it doesn't. Instead, learn how 48 48 Javascript's native datatypes work and use them properly. ··· 94 94 95 95 NOTE: There's some sparse array nonsense being omitted here, see below. 96 96 97 - If you try to use ##for (var k in ...)## syntax to iterate over an Array, you'll 97 + If you try to use `for (var k in ...)` syntax to iterate over an Array, you'll 98 98 pick up a whole pile of keys you didn't intend to and it won't work. If you try 99 - to use ##for (var ii = 0; ...)## syntax to iterate over an Object, it won't work 99 + to use `for (var ii = 0; ...)` syntax to iterate over an Object, it won't work 100 100 at all. 101 101 102 102 If you consistently treat Arrays as lists and Objects as maps and use the ··· 106 106 = hasOwnProperty() = 107 107 108 108 An issue with this model is that if you write stuff to Object.prototype, it will 109 - show up every time you use enumeration ##for##: 109 + show up every time you use enumeration `for`: 110 110 111 111 COUNTEREXAMPLE 112 112 var o = {}; ··· 117 117 118 118 There are two ways to avoid this: 119 119 120 - - test that ##k## exists on ##o## by calling ##o.hasOwnProperty(k)## in every 120 + - test that `k` exists on `o` by calling `o.hasOwnProperty(k)` in every 121 121 single loop everywhere in your program and only use libraries which also do 122 122 this and never forget to do it ever; or 123 123 - don't write to Object.prototype.
+6 -6
src/docs/flavor/javascript_pitfalls.diviner
··· 27 27 places where insertion of a semicolon would not make the unparseable parseable, 28 28 usually after operators. 29 29 30 - = ##with## is Bad News = 30 + = `with` is Bad News = 31 31 32 32 `with` is a pretty bad feature, for this reason among others: 33 33 ··· 35 35 property = 3; // Might be on object, might be on window: who knows. 36 36 } 37 37 38 - Avoid ##with##. 38 + Avoid `with`. 39 39 40 - = ##arguments## is not an Array = 40 + = `arguments` is not an Array = 41 41 42 - You can convert ##arguments## to an array using JX.$A() or similar. Note that 43 - you can pass ##arguments## to Function.prototype.apply() without converting it. 42 + You can convert `arguments` to an array using JX.$A() or similar. Note that 43 + you can pass `arguments` to Function.prototype.apply() without converting it. 44 44 45 45 = Object, Array, and iteration are needlessly hard = 46 46 ··· 82 82 Number.prototype, etc.) and their logical behavior is at best absurd and at 83 83 worst strictly wrong. 84 84 85 - **Never use** ##new Number()##, ##new String()## or ##new Boolean()## unless 85 + **Never use** `new Number()`, `new String()` or `new Boolean()` unless 86 86 your Javascript is God Tier and you are absolutely sure you know what you are 87 87 doing.
+7 -7
src/docs/flavor/php_pitfalls.diviner
··· 31 31 32 32 = isset(), empty() and Truthiness = 33 33 34 - A value is "truthy" if it evaluates to true in an ##if## clause: 34 + A value is "truthy" if it evaluates to true in an `if` clause: 35 35 36 36 $value = something(); 37 37 if ($value) { ··· 61 61 COMMENT IS TOTALLY AWESOME AND I MAKE IT ALL THE TIME SO YOU HAD BETTER NOT 62 62 BREAK IT!!!// A better test is probably strlen(). 63 63 64 - In addition to truth tests with ##if##, PHP has two special truthiness operators 64 + In addition to truth tests with `if`, PHP has two special truthiness operators 65 65 which look like functions but aren't: empty() and isset(). These operators help 66 66 deal with undeclared variables. 67 67 ··· 147 147 148 148 These functions are much slower for even moderately large inputs than 149 149 array_intersect_key() and array_diff_key(), because they can not make the 150 - assumption that their inputs are unique scalars as the ##key## varieties can. 151 - Strongly prefer the ##key## varieties. 150 + assumption that their inputs are unique scalars as the `key` varieties can. 151 + Strongly prefer the `key` varieties. 152 152 153 153 = array_uintersect() and array_udiff() are Definitely Slow Too = 154 154 155 - These functions have the problems of both the ##usort()## family and the 155 + These functions have the problems of both the `usort()` family and the 156 156 `array_diff()` family. Avoid them. 157 157 158 158 = foreach() Does Not Create Scope = ··· 205 205 $x = 41; 206 206 call_user_func('add_one', $x); 207 207 208 - ...##$x## will not be modified. The solution is to use call_user_func_array() 208 + ...`$x` will not be modified. The solution is to use call_user_func_array() 209 209 and wrap the reference in an array: 210 210 211 211 $x = 41; ··· 243 243 244 244 = Invoking "new" With an Argument Vector is Really Hard = 245 245 246 - If you have some ##$class_name## and some ##$argv## of constructor 246 + If you have some `$class_name` and some `$argv` of constructor 247 247 arguments and you want to do this: 248 248 249 249 new $class_name($argv[0], $argv[1], ...);
+4 -4
src/docs/flavor/recommendations_on_revision_control.diviner
··· 24 24 conceptual changeset ("add a foo widget") is represented in the remote as 25 25 exactly one commit (in some form), not a sequence of checkpoint commits. 26 26 27 - - In SVN, this means don't ##commit## until after an idea has been completely 27 + - In SVN, this means don't `commit` until after an idea has been completely 28 28 written. All reasonable SVN workflows naturally enforce this. 29 - - In Git, this means squashing checkpoint commits as you go (with ##git commit 30 - --amend##) or before pushing (with ##git rebase -i## or ##git merge 31 - --squash##), or having a strict policy where your master/trunk contains only 29 + - In Git, this means squashing checkpoint commits as you go (with `git commit 30 + --amend`) or before pushing (with `git rebase -i` or `git merge 31 + --squash`), or having a strict policy where your master/trunk contains only 32 32 merge commits and each is a merge between the old master and a branch which 33 33 represents a single idea. Although this preserves the checkpoint commits 34 34 along the branches, you can view master alone as a series of single-idea
+1 -1
src/docs/flavor/soon_static_resources.diviner
··· 84 84 = Caches and Serving Content = 85 85 86 86 In the simplest implementation of static resources, you write out a raw JS tag 87 - with something like ##src="/js/base.js"##. This will break disastrously as you 87 + with something like `src="/js/base.js"`. This will break disastrously as you 88 88 scale, because clients will be running with stale versions of resources. There 89 89 are bunch of subtle problems (especially once you have a CDN), but the big one 90 90 is that if a user is browsing your site as you push/deploy, their client will
+4 -4
src/docs/tech/celerity.diviner
··· 29 29 resource for inclusion when a response is rendered (e.g., when the HTML page is 30 30 generated, or when the response to an Ajax request is built). For instance, if 31 31 you use a CSS class like "widget-view", you must ensure the appropriate CSS is 32 - included by calling ##require_celerity_resource('widget-view-css')## (or 32 + included by calling `require_celerity_resource('widget-view-css')` (or 33 33 similar), at your use site. 34 34 35 35 This function uses @{class:CelerityAPI} to access the active ··· 48 48 generate fewer resource requests, improving performance). It then generates 49 49 `<script />` and `<link />` references to these resources. 50 50 51 - These references point at ##/res/## URIs, which are handled by 51 + These references point at `/res/` URIs, which are handled by 52 52 @{class:CelerityResourceController}. It responds to these requests and delivers 53 53 the relevant resources and packages, managing cache lifetimes and handling any 54 54 neessary preprocessing. It uses @{class:CelerityResourceMap} to locate resources 55 55 and read packaging rules. 56 56 57 - The dependency and packaging maps are generated by ##bin/celerity map##, 58 - which updates ##resources/celerity/map.php##. 57 + The dependency and packaging maps are generated by `bin/celerity map`, 58 + which updates `resources/celerity/map.php`. 59 59 60 60 @{class:CelerityStaticResourceResponse} also manages some Javelin information, 61 61 and @{function:celerity_generate_unique_node_id} uses this metadata to provide
+20 -20
src/docs/tech/chatbot.diviner
··· 21 21 22 22 These are the configuration values it reads: 23 23 24 - - ##server## String, required, the server to connect to. 25 - - ##port## Int, optional, the port to connect to (defaults to 6667). 26 - - ##ssl## Bool, optional, whether to connect via SSL or not (defaults to 24 + - `server` String, required, the server to connect to. 25 + - `port` Int, optional, the port to connect to (defaults to 6667). 26 + - `ssl` Bool, optional, whether to connect via SSL or not (defaults to 27 27 false). 28 - - ##nick## String, nickname to use. 29 - - ##user## String, optional, username to use (defaults to ##nick##). 30 - - ##pass## String, optional, password for server. 31 - - ##nickpass## String, optional, password for NickServ. 32 - - ##join## Array, list of channels to join. 33 - - ##handlers## Array, list of handlers to run. These are like plugins for the 28 + - `nick` String, nickname to use. 29 + - `user` String, optional, username to use (defaults to `nick`). 30 + - `pass` String, optional, password for server. 31 + - `nickpass` String, optional, password for NickServ. 32 + - `join` Array, list of channels to join. 33 + - `handlers` Array, list of handlers to run. These are like plugins for the 34 34 bot. 35 - - ##conduit.uri##, ##conduit.user##, ##conduit.cert## Conduit configuration, 35 + - `conduit.uri`, `conduit.user`, `conduit.cert` Conduit configuration, 36 36 see below. 37 - - ##notification.channels## Notification configuration, see below. 37 + - `notification.channels` Notification configuration, see below. 38 38 39 39 = Handlers = 40 40 ··· 46 46 up, and says their name with a link to the object. Requires conduit. 47 47 - @{class:PhabricatorBotFeedNotificationHandler} This handler posts 48 48 notifications about changes to revisions to the channels listed in 49 - ##notification.channels##. 49 + `notification.channels`. 50 50 - @{class:PhabricatorBotLogHandler} This handler records chatlogs which can 51 51 be browsed in the Phabricator web interface. 52 52 - @{class:PhabricatorBotSymbolHandler} This handler posts responses to lookups 53 53 for symbols in Diffusion 54 54 - @{class:PhabricatorBotMacroHandler} This handler looks for users mentioning 55 55 macros, if found will convert image to ASCII and output in chat. Configure 56 - with ##macro.size## and ##macro.aspect## 56 + with `macro.size` and `macro.aspect` 57 57 58 58 You can also write your own handlers, by extending 59 59 @{class:PhabricatorBotHandler}. ··· 70 70 `People -> Create New Account`. Create a new account and flag them as a 71 71 "Bot/Script". Then in your configuration file, set these parameters: 72 72 73 - - ##conduit.uri## The URI for your Phabricator install, like 74 - ##http://phabricator.example.com/## 75 - - ##conduit.user## The username your bot should login to Phabricator with -- 76 - whatever you selected above, like ##phabot##. 77 - - ##conduit.cert## The user's certificate, from the "Conduit Certificate" tab 73 + - `conduit.uri` The URI for your Phabricator install, like 74 + `http://phabricator.example.com/` 75 + - `conduit.user` The username your bot should login to Phabricator with -- 76 + whatever you selected above, like `phabot`. 77 + - `conduit.cert` The user's certificate, from the "Conduit Certificate" tab 78 78 in the user's administrative view. 79 79 80 80 Now the bot should be able to connect to Phabricator via Conduit. 81 81 82 82 = Starting the Bot = 83 83 84 - The bot is a Phabricator daemon, so start it with ##phd##: 84 + The bot is a Phabricator daemon, so start it with `phd`: 85 85 86 86 ./bin/phd launch phabricatorbot <absolute_path_to_config_file> 87 87 88 - If you have issues you can try ##debug## instead of ##launch##, see 88 + If you have issues you can try `debug` instead of `launch`, see 89 89 @{article:Managing Daemons with phd} for more information.
+4 -4
src/docs/tech/conduit.diviner
··· 22 22 Conduit provides an authenticated HTTP API for Phabricator. It is informal and 23 23 extremely simple: you post a JSON blob and you get a JSON blob back. You can 24 24 access Conduit in PHP with @{class@libphutil:ConduitClient}, or in any language 25 - by executing ##arc call-conduit method## (see ##arc help call-conduit## for 26 - more information). You can see and test available methods at ##/conduit/## in 25 + by executing `arc call-conduit method` (see `arc help call-conduit` for 26 + more information). You can see and test available methods at `/conduit/` in 27 27 the web interface. 28 28 29 29 Arcanist is implemented using Conduit, and @{class:PhabricatorBot} is ··· 32 32 33 33 = Class Relationships = 34 34 35 - The primary Conduit workflow is exposed at ##/api/##, which routes to 35 + The primary Conduit workflow is exposed at `/api/`, which routes to 36 36 @{class:PhabricatorConduitAPIController}. This controller builds a 37 37 @{class:ConduitAPIRequest} representing authentication information and POST 38 38 parameters, instantiates an appropriate subclass of @{class:ConduitAPIMethod}, ··· 49 49 A log of connections and calls is stored by 50 50 @{class:PhabricatorConduitConnectionLog} and 51 51 @{class:PhabricatorConduitMethodCallLog}, and can be accessed on the web via 52 - @{class:PhabricatorConduitLogController} at ##/conduit/log/##. 52 + @{class:PhabricatorConduitLogController} at `/conduit/log/`. 53 53 54 54 Conduit provides a token-based handshake mechanism used by 55 55 `arc install-certificate` at `/conduit/token/`, implemented by
+3 -3
src/docs/user/configuration/configuration_guide.diviner
··· 20 20 down to their sections. 21 21 22 22 Get Apache running and verify it's serving a test page. Consult the Apache 23 - documentation for help. Make sure ##mod_php## and ##mod_rewrite## are enabled, 24 - and ##mod_ssl## if you intend to set up SSL. 23 + documentation for help. Make sure `mod_php` and `mod_rewrite` are enabled, 24 + and `mod_ssl` if you intend to set up SSL. 25 25 26 26 If you haven't already, set up a domain name to point to the host you're 27 27 installing on. You can either install Phabricator on a subdomain (like ··· 177 177 178 178 phabricator/ $ ./bin/storage upgrade --user <user> --password <password> 179 179 180 - You can avoid the prompt the script issues by passing the ##--force## flag (for 180 + You can avoid the prompt the script issues by passing the `--force` flag (for 181 181 example, if you are scripting the upgrade process). 182 182 183 183 phabricator/ $ ./bin/storage upgrade --force
+11 -11
src/docs/user/configuration/configuring_outbound_email.diviner
··· 48 48 default. If your domain is `example.org`, set this to something like 49 49 `noreply@example.org`. 50 50 - **metamta.domain** should be set to your domain, e.g. `example.org`. 51 - - **metamta.can-send-as-user** should be left as ##false## in most cases, 51 + - **metamta.can-send-as-user** should be left as `false` in most cases, 52 52 but see the documentation for details. 53 53 54 54 = Configuring Mail Adapters = ··· 56 56 To choose how mail will be sent, change the `metamta.mail-adapter` key in 57 57 your configuration. Possible values are listed in the UI: 58 58 59 - - ##PhabricatorMailImplementationAmazonMailgunAdapter##: use Mailgun, see 59 + - `PhabricatorMailImplementationAmazonMailgunAdapter`: use Mailgun, see 60 60 "Adapter: Mailgun". 61 - - ##PhabricatorMailImplementationAmazonSESAdapter##: use Amazon SES, see 61 + - `PhabricatorMailImplementationAmazonSESAdapter`: use Amazon SES, see 62 62 "Adapter: Amazon SES". 63 - - ##PhabricatorMailImplementationPHPMailerLiteAdapter##: default, uses 63 + - `PhabricatorMailImplementationPHPMailerLiteAdapter`: default, uses 64 64 "sendmail", see "Adapter: Sendmail". 65 - - ##PhabricatorMailImplementationPHPMailerAdapter##: uses SMTP, see 65 + - `PhabricatorMailImplementationPHPMailerAdapter`: uses SMTP, see 66 66 "Adapter: SMTP". 67 - - ##PhabricatorMailImplementationSendGridAdapter##: use SendGrid, see 67 + - `PhabricatorMailImplementationSendGridAdapter`: use SendGrid, see 68 68 "Adapter: SendGrid". 69 - - ##Some Custom Class You Write##: use a custom adapter you write, see 69 + - `Some Custom Class You Write`: use a custom adapter you write, see 70 70 "Adapter: Custom". 71 - - ##PhabricatorMailImplementationTestAdapter##: this will 71 + - `PhabricatorMailImplementationTestAdapter`: this will 72 72 **completely disable** outbound mail. You can use this if you don't want to 73 73 send outbound mail, or want to skip this step for now and configure it 74 74 later. ··· 137 137 - **amazon-ses.secret-key**: set to your Amazon SES secret key. 138 138 139 139 NOTE: Amazon SES **requires you to verify your "From" address**. Configure which 140 - "From" address to use by setting "##metamta.default-address##" in your config, 140 + "From" address to use by setting "`metamta.default-address`" in your config, 141 141 then follow the Amazon SES verification process to verify it. You won't be able 142 142 to send email until you do this! 143 143 ··· 147 147 <http://sendgrid.com/>. It is easy to configure, but not free. 148 148 149 149 You can configure SendGrid in two ways: you can send via SMTP or via the REST 150 - API. To use SMTP, just configure ##sendmail## and leave Phabricator's setup 150 + API. To use SMTP, just configure `sendmail` and leave Phabricator's setup 151 151 with defaults. To use the REST API, follow the instructions in this section. 152 152 153 153 To configure Phabricator to use SendGrid, set these configuration keys: ··· 187 187 188 188 Run `bin/mail help <command>` for more help on using these commands. 189 189 190 - You can monitor daemons using the Daemon Console (##/daemon/##, or click 190 + You can monitor daemons using the Daemon Console (`/daemon/`, or click 191 191 **Daemon Console** from the homepage). 192 192 193 193 = Next Steps =
+4 -4
src/docs/user/configuration/managing_daemons.diviner
··· 1 1 @title Managing Daemons with phd 2 2 @group config 3 3 4 - Explains Phabricator daemons and the daemon control program ##phd##. 4 + Explains Phabricator daemons and the daemon control program `phd`. 5 5 6 6 = Overview = 7 7 ··· 23 23 24 24 = phd = 25 25 26 - **phd** is a command-line script (located at ##phabricator/bin/phd##). To get 27 - a list of commands, run ##phd help##: 26 + **phd** is a command-line script (located at `phabricator/bin/phd`). To get 27 + a list of commands, run `phd help`: 28 28 29 29 phabricator/ $ ./bin/phd help 30 30 NAME ··· 49 49 = Daemon Console = 50 50 51 51 You can view status and debugging information for daemons in the Daemon Console 52 - via the web interface. Go to ##/daemon/## in your install or click 52 + via the web interface. Go to `/daemon/` in your install or click 53 53 **Daemon Console** from "More Stuff". 54 54 55 55 The Daemon Console shows a list of all the daemons that have ever launched, and
+21 -21
src/docs/user/userguide/arcanist.diviner
··· 8 8 unit tests, and manages common workflows like getting changes into Differential 9 9 for review. 10 10 11 - A detailed command reference is available by running ##arc help##. This 11 + A detailed command reference is available by running `arc help`. This 12 12 document provides an overview of common workflows and installation. 13 13 14 14 Arcanist has technical, contributor-focused documentation here: ··· 38 38 39 39 Arcanist allows you to do things like: 40 40 41 - - get detailed help about available commands with ##arc help## 42 - - send your code to Differential for review with ##arc diff## (for detailed 41 + - get detailed help about available commands with `arc help` 42 + - send your code to Differential for review with `arc diff` (for detailed 43 43 instructions, see @{article:Arcanist User Guide: arc diff}) 44 - - show pending revision information with ##arc list## 45 - - find likely reviewers for a change with ##arc cover## 46 - - apply changes in a revision to the working copy with ##arc patch## 47 - - download a patch from Differential with ##arc export## 48 - - update Git commit messages after review with ##arc amend## 49 - - commit SVN changes with ##arc commit## 50 - - push Git and Mercurial changes with ##arc land## 51 - - view enhanced information about Git branches with ##arc branch## 44 + - show pending revision information with `arc list` 45 + - find likely reviewers for a change with `arc cover` 46 + - apply changes in a revision to the working copy with `arc patch` 47 + - download a patch from Differential with `arc export` 48 + - update Git commit messages after review with `arc amend` 49 + - commit SVN changes with `arc commit` 50 + - push Git and Mercurial changes with `arc land` 51 + - view enhanced information about Git branches with `arc branch` 52 52 53 53 Once you've configured lint and unit test integration, you can also: 54 54 55 - - check your code for syntax and style errors with ##arc lint## 55 + - check your code for syntax and style errors with `arc lint` 56 56 (see @{article:Arcanist User Guide: Lint}) 57 - - run unit tests that cover your changes with ##arc unit## 57 + - run unit tests that cover your changes with `arc unit` 58 58 59 59 Arcanist integrates with other tools: 60 60 61 - - upload and download files with ##arc upload## and ##arc download## 62 - - create and view pastes with ##arc paste## 61 + - upload and download files with `arc upload` and `arc download` 62 + - create and view pastes with `arc paste` 63 63 64 64 Arcanist has some advanced features as well, you can: 65 65 66 - - execute Conduit method calls with ##arc call-conduit## 67 - - create or update libphutil libraries with ##arc liberate## 68 - - activate tab completion with ##arc shell-complete## 66 + - execute Conduit method calls with `arc call-conduit` 67 + - create or update libphutil libraries with `arc liberate` 68 + - activate tab completion with `arc shell-complete` 69 69 - ...or extend Arcanist and add new commands. 70 70 71 71 Except where otherwise noted, these workflows are generally agnostic to the ··· 99 99 arcanist/ # Arcanist-specific code and libraries. 100 100 libphutil/ # A shared library Arcanist depends upon. 101 101 102 - Now add ##some_install_path/arcanist/bin/## to your PATH environment variable. 102 + Now add `some_install_path/arcanist/bin/` to your PATH environment variable. 103 103 When you type "arc", you should see something like this: 104 104 105 105 Usage Exception: No command provided. Try 'arc help'. ··· 137 137 138 138 == Installing Tab Completion == 139 139 140 - If you use ##bash##, you can set up tab completion by adding something like this 141 - to your ##.bashrc##, ##.profile## or similar: 140 + If you use `bash`, you can set up tab completion by adding something like this 141 + to your `.bashrc`, `.profile` or similar: 142 142 143 143 source /path/to/arcanist/resources/shell/bash-completion 144 144
+2 -2
src/docs/user/userguide/arcanist_coverage.diviner
··· 22 22 arc unit --detailed-coverage src/some/file.php 23 23 24 24 Depending on how your test engine is configured, this will run tests relevant 25 - to ##src/some/file.php## and give you a detailed coverage report. 25 + to `src/some/file.php` and give you a detailed coverage report. 26 26 27 27 If the test engine enables coverage by default, it will be uploaded to 28 28 Differential and displayed in the right gutter when viewing diffs. ··· 39 39 40 40 = Building Coverage Support = 41 41 42 - To add coverage support to a unit test engine, just call ##setCoverage()## when 42 + To add coverage support to a unit test engine, just call `setCoverage()` when 43 43 building @{class@arcanist:ArcanistUnitTestResult} objects. Provide a map of 44 44 file names (relative to the working copy root) to coverage report strings. 45 45 Coverage report strings look like this:
+5 -5
src/docs/user/userguide/arcanist_extending_lint.diviner
··· 34 34 35 35 By default, most linters raise lint messages as errors. You may want to reduce 36 36 the severity of some messages (e.g., reduce errors to warnings). Do this by 37 - calling ##setCustomSeverityMap()##: 37 + calling `setCustomSeverityMap()`: 38 38 39 39 $linter = new ArcanistTextLinter(); 40 40 ··· 50 50 51 51 = Disabling Rules = 52 52 53 - To disable rules entirely, set their severities to ##SEVERITY_DISABLED##: 53 + To disable rules entirely, set their severities to `SEVERITY_DISABLED`: 54 54 55 55 $linter = new ArcanistTextLinter(); 56 56 ··· 91 91 92 92 == ArcanistTextLinter == 93 93 94 - - Use ##setMaxLineLength()## to change the 80-column warning to something 94 + - Use `setMaxLineLength()` to change the 80-column warning to something 95 95 else. 96 96 97 97 == ArcanistXHPASTLinter == 98 98 99 - - Use ##lint.xhpast.naminghook## in ##.arcconfig## to override naming 99 + - Use `lint.xhpast.naminghook` in `.arcconfig` to override naming 100 100 convention rules. See @{class@arcanist:ArcanistXHPASTLintNamingHook} 101 101 for details. 102 - - Use ##getXHPASTTreeForPath()## to reuse the AAST in other linters. 102 + - Use `getXHPASTTreeForPath()` to reuse the AAST in other linters.
+6 -6
src/docs/user/userguide/arcanist_lint_unit.diviner
··· 30 30 make this work, you need to do three things: 31 31 32 32 - actually write the class; 33 - - add the library where the class exists to your ##.arcconfig##; 34 - - add the class name to your ##.arcconfig## as the **lint.engine**, 33 + - add the library where the class exists to your `.arcconfig`; 34 + - add the class name to your `.arcconfig` as the **lint.engine**, 35 35 **unit.engine**, or **arcanist_configuration**. 36 36 37 37 = Create a libphutil Library = ··· 39 39 If you haven't created a library for the class to live in yet, you need to do 40 40 that first. Follow the instructions in 41 41 @{article:libphutil Libraries User Guide}, then make the library loadable by 42 - adding it to your ##.arcconfig## like this: 42 + adding it to your `.arcconfig` like this: 43 43 44 44 { 45 45 // ... ··· 53 53 } 54 54 55 55 You can either specify an absolute path, or a path relative to the project root. 56 - When you run ##arc list --trace##, you should see a message to the effect that 56 + When you run `arc list --trace`, you should see a message to the effect that 57 57 it has loaded your library. 58 58 59 59 For debugging or testing, you can also run Arcanist with the ··· 67 67 68 68 = Use the Class = 69 69 70 - This step is easy: just edit ##.arcconfig## to specify your class name as 70 + This step is easy: just edit `.arcconfig` to specify your class name as 71 71 the appropriate configuration value. 72 72 73 73 { ··· 79 79 Now, when you run Arcanist in your project, it will invoke your class when 80 80 appropriate. 81 81 82 - For lint and unit tests, you can also use the ##--engine## flag override the 82 + For lint and unit tests, you can also use the `--engine` flag override the 83 83 default engine: 84 84 85 85 arc lint --engine MyCustomArcanistLintEngine
+3 -3
src/docs/user/userguide/arcanist_new_project.diviner
··· 88 88 == History Mutability: Git == 89 89 90 90 In a workflow with //mutable// history, you rewrite local history. You develop 91 - in feature branches, but squash or amend before pushing by using ##git commit 92 - --amend##, ##git rebase -i##, or `git merge --squash`. Generally, one idea in 91 + in feature branches, but squash or amend before pushing by using `git commit 92 + --amend`, `git rebase -i`, or `git merge --squash`. Generally, one idea in 93 93 the remote is represented by one commit. 94 94 95 95 In a workflow with //immutable// history, you do not rewrite local history. You 96 96 develop in feature branches and push them without squashing commits. You do not 97 - use ##git commit --amend## or ##git rebase -i##. Generally, one idea in the 97 + use `git commit --amend` or `git rebase -i`. Generally, one idea in the 98 98 remote is represented by many commits. 99 99 100 100 Practically, these are the differences you'll see based on your setting:
+1 -1
src/docs/user/userguide/differential_test_plans.diviner
··· 39 39 - **Concurrent Change Robustness:** If you're making a refactoring change, is 40 40 it robust against people introducing new calls between the time you started 41 41 the change and when you commit it? For example, if you change the parameter 42 - order of some function from ##f(a, b)## to ##f(b, a)## and a new callsite is 42 + order of some function from `f(a, b)` to `f(b, a)` and a new callsite is 43 43 introduced in the meantime, could it go unnoticed? How bad would that be? 44 44 (Because of this risk, you should almost never make parameter order 45 45 changes in weakly typed languages like PHP and Javascript.)
+4 -4
src/docs/user/userguide/diffusion_symbols.diviner
··· 35 35 ./scripts/symbols/generate_ctags_symbols.php 36 36 37 37 If you want to identify symbols from another language, you need to write a 38 - script which can export them (for example, maybe by parsing a ##ctags## file). 38 + script which can export them (for example, maybe by parsing a `ctags` file). 39 39 40 40 The output format of the script should be one symbol per line: 41 41 ··· 49 49 defined. For object-oriented languages, this is probably a class name. The 50 50 symbols with that context are class constants, methods, properties, nested 51 51 classes, etc. When printing symbols without a context (those that are defined 52 - globally, for instance), the ##<context>## field should be empty (that is, the 52 + globally, for instance), the `<context>` field should be empty (that is, the 53 53 line should start with a space). 54 54 55 55 Your script should enumerate all the symbols in your project, and provide paths 56 56 from the project root (where ".arcconfig" is) beginning with a "/". 57 57 58 - You can look at ##generate_php_symbols.php## for an example of how you might 58 + You can look at `generate_php_symbols.php` for an example of how you might 59 59 write such a script, and run this command to see its output: 60 60 61 61 $ cd phabricator/ ··· 69 69 Then just set up a cronjob to run that however often you like. 70 70 71 71 You can test that the import worked by querying for symbols using the Conduit 72 - method ##diffusion.findsymbols##. Some features (like that method, and the 72 + method `diffusion.findsymbols`. Some features (like that method, and the 73 73 IRC bot integration) will start working immediately. Others will require more 74 74 configuration. 75 75
+10 -10
src/docs/user/userguide/events.diviner
··· 154 154 This event is dispatched before a task is edited, and allows you to respond to 155 155 or alter the edit. Data available on this event: 156 156 157 - - ##task## The @{class:ManiphestTask} being edited. 158 - - ##transactions## The list of edits (objects of class 157 + - `task` The @{class:ManiphestTask} being edited. 158 + - `transactions` The list of edits (objects of class 159 159 @{class:ManiphestTransaction}) being applied. 160 - - ##new## A boolean indicating if this task is being created. 161 - - ##mail## If this edit originates from email, the 160 + - `new` A boolean indicating if this task is being created. 161 + - `mail` If this edit originates from email, the 162 162 @{class:PhabricatorMetaMTAReceivedMail} object. 163 163 164 164 This is similar to the next event (did edit task) but occurs before the edit ··· 172 172 This event is dispatched after a task is edited, and allows you to react to the 173 173 edit. Data available on this event: 174 174 175 - - ##task## The @{class:ManiphestTask} that was edited. 176 - - ##transactions## The list of edits (objects of class 175 + - `task` The @{class:ManiphestTask} that was edited. 176 + - `transactions` The list of edits (objects of class 177 177 @{class:ManiphestTransaction}) that were applied. 178 - - ##new## A boolean indicating if this task was newly created. 179 - - ##mail## If this edit originates from email, the 178 + - `new` A boolean indicating if this task was newly created. 179 + - `mail` If this edit originates from email, the 180 180 @{class:PhabricatorMetaMTAReceivedMail} object. 181 181 182 182 This is similar to the previous event (will edit task) but occurs after the ··· 190 190 This event is dispatched before Differential decides if a file is generated (and 191 191 doesn't need to be reviewed) or not. Data available on this event: 192 192 193 - - ##corpus## Body of the file. 194 - - ##is_generated## Boolean indicating if this file should be treated as 193 + - `corpus` Body of the file. 194 + - `is_generated` Boolean indicating if this file should be treated as 195 195 generated. 196 196 197 197 == Diffusion: Did Discover Commit ==
+1 -1
src/docs/user/userguide/external_editor.diviner
··· 27 27 28 28 == Configuring: TextMate on OS X == 29 29 30 - TextMate installs a ##txmt://## handler by default, so it's easy to configure 30 + TextMate installs a `txmt://` handler by default, so it's easy to configure 31 31 this feature if you use TextMate. 32 32 33 33 First, create a local directory with symlinks for each repository callsign. For
+3 -3
src/docs/user/userguide/herald.diviner
··· 43 43 44 44 To create a new Herald rule, choose which type of event you want to act on 45 45 (e.g., changes to Differential Revisions, or Commits), and then set a list of 46 - conditions. For example, you might add the condition ##Author is alincoln 47 - (Abraham Lincoln)## to keep track of everything alincoln does. Finally, set 46 + conditions. For example, you might add the condition `Author is alincoln 47 + (Abraham Lincoln)` to keep track of everything alincoln does. Finally, set 48 48 a list of actions to take when the conditions match, like adding yourself to the 49 49 CC list. 50 50 ··· 90 90 filename of the changed file; the second will be used to match the content. 91 91 For example, if you want to match revisions which add or remove calls to 92 92 a "muffinize" function, //but only in JS files//, you can set the value 93 - to ##["/\\.js$/", "/muffinize/"]## or similar. 93 + to `["/\\.js$/", "/muffinize/"]` or similar. 94 94 - **Another Herald rule**: you can create Herald rules which depend on other 95 95 rules. This can be useful if you need to express a more complicated predicate 96 96 than "all" vs "any" allows, or have a common set of conditions which you want
+16 -16
src/docs/user/userguide/libraries.diviner
··· 17 17 In general, you perform these one-time setup steps: 18 18 19 19 - Create a new directory. 20 - - Use ##arc liberate## to initialize and name the library. 20 + - Use `arc liberate` to initialize and name the library. 21 21 - Add a dependency on Phabricator if necessary. 22 - - Add the library to your Phabricator config or ##.arcconfig## so it will be 22 + - Add the library to your Phabricator config or `.arcconfig` so it will be 23 23 loaded at runtime. 24 24 25 25 Then, to add new code, you do this: 26 26 27 27 - Write or update classes. 28 - - Update the library metadata by running ##arc liberate## again. 28 + - Update the library metadata by running `arc liberate` again. 29 29 30 30 = Creating a New Library = 31 31 ··· 61 61 62 62 This will write three files: 63 63 64 - - ##src/.phutil_module_cache## This is a cache which makes "arc liberate" 64 + - `src/.phutil_module_cache` This is a cache which makes "arc liberate" 65 65 faster when you run it to update the library. You can safely remove it at 66 66 any time. If you check your library into version control, you can add this 67 67 file to ignore rules (like .gitignore). 68 - - ##src/__phutil_library_init__.php## This records the name of the library and 68 + - `src/__phutil_library_init__.php` This records the name of the library and 69 69 tells libphutil that a library exists here. 70 - - ##src/__phutil_library_map__.php## This is a map of all the symbols 70 + - `src/__phutil_library_map__.php` This is a map of all the symbols 71 71 (functions and classes) in the library, which allows them to be autoloaded 72 72 at runtime and dependencies to be statically managed by "arc liberate". 73 73 ··· 78 78 step. 79 79 80 80 But, if you intend to use this library with Phabricator, you need to define its 81 - dependency on Phabricator by creating a ##.arcconfig## file which points at 81 + dependency on Phabricator by creating a `.arcconfig` file which points at 82 82 Phabricator. For example, you might write this file to 83 83 `libcustom/.arcconfig`: 84 84 ··· 88 88 ] 89 89 } 90 90 91 - For details on creating a ##.arcconfig##, see 91 + For details on creating a `.arcconfig`, see 92 92 @{article:Arcanist User Guide: Configuring a New Project}. In general, this 93 - tells ##arc liberate## that it should look for symbols in Phabricator when 93 + tells `arc liberate` that it should look for symbols in Phabricator when 94 94 performing static analysis. 95 95 96 96 NOTE: If Phabricator isn't located next to your custom library, specify a 97 - path which actually points to the ##phabricator/## directory. 97 + path which actually points to the `phabricator/` directory. 98 98 99 - You do not need to declare dependencies on ##arcanist## or ##libphutil##, 100 - since ##arc liberate## automatically loads them. 99 + You do not need to declare dependencies on `arcanist` or `libphutil`, 100 + since `arc liberate` automatically loads them. 101 101 102 102 Finally, edit your Phabricator config to tell it to load your library at 103 - runtime, by adding it to ##load-libraries##: 103 + runtime, by adding it to `load-libraries`: 104 104 105 105 ... 106 106 'load-libraries' => array( ··· 117 117 libcustom/ $ mkdir src/example/ 118 118 libcustom/ $ nano src/example/ExampleClass.php # Edit some code. 119 119 120 - Now, run ##arc liberate## to regenerate the static resource map: 120 + Now, run `arc liberate` to regenerate the static resource map: 121 121 122 122 libcustom/ $ arc liberate src/ 123 123 ··· 126 126 = What You Can Extend And Invoke = 127 127 128 128 libphutil, Arcanist and Phabricator are strict about extensibility of classes 129 - and visibility of methods and properties. Most classes are marked ##final##, and 129 + and visibility of methods and properties. Most classes are marked `final`, and 130 130 methods have the minimum required visibility (protected or private). The goal of 131 131 this strictness is to make it clear what you can safely extend, access, and 132 132 invoke, so your code will keep working as the upstream changes. ··· 137 137 example: @{class@libphutil:AbstractDirectedGraph}). These classes are external 138 138 interfaces intended for extension. 139 139 140 - If you want to extend a class but it is not marked ##@stable##, here are some 140 + If you want to extend a class but it is not marked `@stable`, here are some 141 141 approaches you can take: 142 142 143 143 - Good: If possible, use composition rather than extension to build your
+13 -13
src/docs/user/userguide/mail_rules.diviner
··· 34 34 Phabricator sends a variety of mail headers that can be useful in crafting rules 35 35 to route and manage mail. 36 36 37 - Headers in plural contain lists. A list containing two items, ##1## and 37 + Headers in plural contain lists. A list containing two items, `1` and 38 38 `15` will generally be formatted like this: 39 39 40 40 X-Header: <1>, <15> ··· 49 49 50 50 The headers Phabricator adds to mail are: 51 51 52 - - ##X-Phabricator-Sent-This-Message##: this is attached to all mail 52 + - `X-Phabricator-Sent-This-Message`: this is attached to all mail 53 53 Phabricator sends. You can use it to differentiate between email from 54 54 Phabricator and replies/forwards of Phabricator mail from human beings. 55 - - ##X-Phabricator-To##: this is attached to all mail Phabricator sends. 55 + - `X-Phabricator-To`: this is attached to all mail Phabricator sends. 56 56 It shows the PHIDs of the original "To" line, before any mutation 57 57 by the mailer configuration. 58 - - ##X-Phabricator-Cc##: this is attached to all mail Phabricator sends. 58 + - `X-Phabricator-Cc`: this is attached to all mail Phabricator sends. 59 59 It shows the PHIDs of the original "Cc" line, before any mutation by the 60 60 mailer configuration. 61 - - ##X-Differential-Author##: this is attached to Differential mail and shows 61 + - `X-Differential-Author`: this is attached to Differential mail and shows 62 62 the revision's author. You can use it to filter mail about your revisions 63 63 (or other users' revisions). 64 - - ##X-Differential-Reviewer##: this is attached to Differential mail and 64 + - `X-Differential-Reviewer`: this is attached to Differential mail and 65 65 shows the reviewers. You can use it to filter mail about revisions you 66 66 are reviewing, versus revisions you are explicitly CC'd on or CC'd as 67 67 a result of Herald rules. 68 - - ##X-Differential-Reviewers##: list version of the previous. 69 - - ##X-Differential-CC##: this is attached to Differential mail and shows 68 + - `X-Differential-Reviewers`: list version of the previous. 69 + - `X-Differential-CC`: this is attached to Differential mail and shows 70 70 the CCs on the revision. 71 - - ##X-Differential-CCs##: list version of the previous. 72 - - ##X-Differential-Explicit-CC##: this is attached to Differential mail and 71 + - `X-Differential-CCs`: list version of the previous. 72 + - `X-Differential-Explicit-CC`: this is attached to Differential mail and 73 73 shows the explicit CCs on the revision (those that were added by humans, 74 74 not by Herald). 75 - - ##X-Differential-Explicit-CCs##: list version of the previous. 76 - - ##X-Phabricator-Mail-Tags##: this is attached to some mail and has 75 + - `X-Differential-Explicit-CCs`: list version of the previous. 76 + - `X-Phabricator-Mail-Tags`: this is attached to some mail and has 77 77 a list of descriptors about the mail. (This is fairly new and subject 78 78 to some change.) 79 - - ##X-Herald-Rules##: this is attached to some mail and shows Herald rule 79 + - `X-Herald-Rules`: this is attached to some mail and shows Herald rule 80 80 IDs which have triggered for the object. You can use this to sort or 81 81 categorize mail that has triggered specific rules.
+1 -1
src/docs/user/userguide/utf8.diviner
··· 61 61 62 62 If you have a prohibitively large number of UTF-8 issues in your source code, 63 63 Phabricator doesn't include any default tools to help you process them in a 64 - systematic way. You could hack up ##utf8.php## as a starting point, or use other 64 + systematic way. You could hack up `utf8.php` as a starting point, or use other 65 65 tools to batch-process your source files. 66 66 67 67 = Support for Alternate Encodings =
+5 -5
webroot/rsrc/externals/javelin/docs/concepts/behaviors.diviner
··· 52 52 53 53 The function will be invoked once for each configuration dictionary passed to 54 54 @{function:JX.initBehaviors}, and the dictionary will be passed as the 55 - ##config## parameter. For example, to alert the user that they've won two hogs: 55 + `config` parameter. For example, to alert the user that they've won two hogs: 56 56 57 57 lang=js 58 58 JX.initBehaviors({ 59 59 "win-a-hog" : [{hogName : "Ethel"}, {hogName: "Beatrice"}] 60 60 }); 61 61 62 - This will invoke the function twice, once for each ##config## dictionary. 62 + This will invoke the function twice, once for each `config` dictionary. 63 63 Usually, you invoke a behavior multiple times if you have several similar 64 64 controls on a page, like multiple @{class:JX.Tokenizer}s. 65 65 66 - An initially empty object will be passed in the ##statics## parameter, but 66 + An initially empty object will be passed in the `statics` parameter, but 67 67 changes to this object will persist across invocations of the behavior. For 68 68 example: 69 69 ··· 142 142 By 2010 (particularly with the introduction of XHP) the API had become more 143 143 sophisticated, but this is basically how most of Facebook's glue code still 144 144 works as of mid-2011. If you view the source of any page, you'll see a bunch 145 - of ##onloadRegister()## calls in the markup which are generated like this. 145 + of `onloadRegister()` calls in the markup which are generated like this. 146 146 147 147 This mitigates many of the problems but is still fairly awkward. Escaping is 148 148 easier, but still possible to get wrong. Stuff is a bit easier to grep for, but ··· 168 168 - The entire interface the server may invoke against can be readily inferred. 169 169 170 170 Note that Javelin does provide @{function:JX.onload}, which behaves like 171 - ##onloadRegister()##. However, its use is discouraged. 171 + `onloadRegister()`. However, its use is discouraged. 172 172 173 173 The two major downsides to the behavior design appear to be: 174 174
+8 -8
webroot/rsrc/externals/javelin/docs/concepts/event_delegation.diviner
··· 111 111 // ... 112 112 }); 113 113 114 - This is similar to setting ##node.onclick## or ##node.addEventListener##, but 114 + This is similar to setting `node.onclick` or `node.addEventListener`, but 115 115 uses the Javelin delegation core. You can also provide a sigil set, which works 116 116 just like @{method:JX.Stratcom.listen} general events. This is useful if your 117 - node is a container, like a ##<div />##, with a lot of stuff in it. 117 + node is a container, like a `<div />`, with a lot of stuff in it. 118 118 119 119 120 120 = DOM Event Flow = ··· 144 144 = Listening to Class Events = 145 145 146 146 Beyond DOM events, you can also listen to class events. Every class installed 147 - by Javelin has static and instance methods called ##listen## (see 147 + by Javelin has static and instance methods called `listen` (see 148 148 @{method:JX.Base.listen}). The static method allows you to listen for all events 149 149 emitted by every instance of a class and its descendants: 150 150 ··· 172 172 Javelin implements general delegation by building and comparing sigil sets. Some 173 173 of these sigils are not DOM sigils, but derived from other things: 174 174 175 - - ##id:*## ID sigils are generated when an examined node has an "id" property. 176 - - ##obj:*## Object sigils are generated when an event affects a class 175 + - `id:*` ID sigils are generated when an examined node has an "id" property. 176 + - `obj:*` Object sigils are generated when an event affects a class 177 177 instance. 178 - - ##class:*## Class sigils are generated while walking an affected instance's 178 + - `class:*` Class sigils are generated while walking an affected instance's 179 179 class chain. 180 - - ##tag:*## Tag sigils are generated by examining the tag names of DOM nodes. 180 + - `tag:*` Tag sigils are generated by examining the tag names of DOM nodes. 181 181 182 - For instance, you can listen to all clicks on ##<a />## tags in a document like 182 + For instance, you can listen to all clicks on `<a />` tags in a document like 183 183 this: 184 184 185 185 lang=js
+2 -2
webroot/rsrc/externals/javelin/docs/concepts/sigils_metadata.diviner
··· 21 21 It is reasonable to think of sigils as being CSS class names in a different, 22 22 semantic namespace. 23 23 24 - If you're emitting raw tags, you specify sigils by adding a ##data-sigil## 24 + If you're emitting raw tags, you specify sigils by adding a `data-sigil` 25 25 attribute to a node: 26 26 27 27 lang=html ··· 94 94 you need to be able to distinguish between the different links so you can know 95 95 which story the user is trying to like. Javelin allows you to do this by 96 96 attaching **metadata** to each node. Metadata is attached to a node by adding a 97 - ##data-meta## attribute which has an index into data later provided to 97 + `data-meta` attribute which has an index into data later provided to 98 98 @{method:JX.Stratcom.mergeData}: 99 99 100 100 lang=html
+14 -14
webroot/rsrc/externals/javelin/docs/facebook.diviner
··· 8 8 Javelin now ships with the source to build several libfbjs-based binaries, which 9 9 serve to completely sever its dependencies on trunk: 10 10 11 - - ##javelinsymbols##: used for lint 12 - - ##jsast##: used for documentation generation 13 - - ##jsxmin##: used to crush packages 11 + - `javelinsymbols`: used for lint 12 + - `jsast`: used for documentation generation 13 + - `jsxmin`: used to crush packages 14 14 15 15 To build these, first build libfbjs: 16 16 ··· 36 36 37 37 javelin/ $ ./scripts/sync-from-facebook.php ~/www 38 38 39 - ...where ##~/www## is the root you want to pull Javelin files from. The script 40 - will copy files out of ##html/js/javelin## and build packages, and leave the 39 + ...where `~/www` is the root you want to pull Javelin files from. The script 40 + will copy files out of `html/js/javelin` and build packages, and leave the 41 41 results in your working copy. From there you can review changes and commit, and 42 42 then push, diff, or send a pull request. 43 43 ··· 46 46 47 47 javelin/ $ ./scripts/sync-to-facebook.php ~/www 48 48 49 - ...where ##~/www## is the root you want to push Javelin files to. The script 50 - will copy files out of the working copy into your ##www## and leave you with a 51 - dirty ##www##. From there you can review changes. 49 + ...where `~/www` is the root you want to push Javelin files to. The script 50 + will copy files out of the working copy into your `www` and leave you with a 51 + dirty `www`. From there you can review changes. 52 52 53 - Once Facebook moves to pure git for ##www## we can probably just submodule 53 + Once Facebook moves to pure git for `www` we can probably just submodule 54 54 Javelin into it and get rid of all this nonsense, but the mixed SVN/git 55 55 environment makes that difficult until then. 56 56 57 57 = Building Documentation = 58 58 59 - Check out ##diviner## and ##libphutil## from Facebook github, and put them in a 60 - directory with ##javelin##: 59 + Check out `diviner` and `libphutil` from Facebook github, and put them in a 60 + directory with `javelin`: 61 61 62 62 somewhere/ $ ls 63 63 diviner/ ··· 65 65 libphutil/ 66 66 somewhere/ $ 67 67 68 - Now run ##diviner## on ##javelin##: 68 + Now run `diviner` on `javelin`: 69 69 70 70 somewhere/ $ cd javelin 71 71 somewhere/javelin/ $ ../diviner/bin/diviner . ··· 73 73 [JavelinDivinerEngine] Generating documentation for 74 files... 74 74 somewhere/javelin/ $ 75 75 76 - Documentation is now available in ##javelin/docs/##. 76 + Documentation is now available in `javelin/docs/`. 77 77 78 78 = Editing javelinjs.com = 79 79 80 - The source for javelinjs.com lives in ##javelin/support/webroot/##. The site 80 + The source for javelinjs.com lives in `javelin/support/webroot/`. The site 81 81 itself is served off the phabricator.com host. You need access to that host to 82 82 push it.