1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Add language specification to code blocks

Summary: Add the language specification to code blocks in documentation.

Test Plan: Eyeball it.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13277
This commit is contained in:
Joshua Spence 2015-06-15 07:32:12 +10:00
parent 934285a6d3
commit d9af48cc52
2 changed files with 11 additions and 0 deletions

View file

@ -22,6 +22,7 @@ Great Z-Index War where all indexes grow without bound in an endless arms race.
Phabricator's preprocessor provides some standard color variables. You can
reference these with `{$color}`. For example:
lang=css
span.critical {
color: {$red};
}
@ -78,6 +79,7 @@ adjust behavior responsively. In particular:
Since many rules are specific to handheld devices, the `.device` class selects
either tablets or phones:
lang=css
.device {
/* Phone or tablet (not desktop). */
}

View file

@ -67,6 +67,7 @@ guidelines, you probably don't need to read this super thoroughly.
**if/else:**
lang=php
if ($some_variable > 3) {
// ...
} else if ($some_variable === null) {
@ -81,6 +82,7 @@ use the "endif" construct, and write "else if" as two words.
**for:**
lang=php
for ($ii = 0; $ii < 10; $ii++) {
// ...
}
@ -90,12 +92,14 @@ visually and react better to "Find Next..." in editors.
**foreach:**
lang=php
foreach ($map as $key => $value) {
// ...
}
**switch:**
lang=php
switch ($value) {
case 1:
// ...
@ -115,6 +119,7 @@ visually and react better to "Find Next..." in editors.
**array literals:**
lang=php
$junk = array(
'nuts',
'bolts',
@ -126,6 +131,7 @@ diffs which add elements to the array affect only one line.
**operators:**
lang=php
$a + $b; // Put spaces around operators.
$omg.$lol; // Exception: no spaces around string concatenation.
$arr[] = $element; // Couple [] with the array when appending.
@ -133,6 +139,7 @@ diffs which add elements to the array affect only one line.
**function/method calls:**
lang=php
// One line
eject($cargo);
@ -143,6 +150,7 @@ diffs which add elements to the array affect only one line.
**function/method definitions:**
lang=php
function example_function($base_value, $additional_value) {
return $base_value + $additional_value;
}
@ -157,6 +165,7 @@ diffs which add elements to the array affect only one line.
**class:**
lang=php
class Dog extends Animal {
const CIRCLES_REQUIRED_TO_LIE_DOWN = 3;