Skip to content

Commit

Permalink
Add examples of code
Browse files Browse the repository at this point in the history
  • Loading branch information
neolao committed Jul 3, 2011
1 parent ba300d5 commit a147509
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 25 deletions.
44 changes: 22 additions & 22 deletions .wiki/themes/dark/screen.css
Expand Up @@ -353,52 +353,52 @@ pre:before {
}

.sh_keyword { color: #669; font-weight: bold; } /** language keywords */
.sh_type { color: #696; } /** basic types */
.sh_type { color: #696; } /** basic types */
.sh_usertype { color: #ff0; } /** user defined types */
.sh_string { color: #933; } /** strings and chars */
.sh_string { color: #933; } /** strings and chars */
.sh_regexp { color: orange; } /** regular expressions */
.sh_specialchar { color: pink; } /** e.g., \n, \t, \\ */
.sh_comment { color: brown; font-style: italic; } /** comments */
.sh_number { color: purple; } /** literal numbers */
.sh_preproc { color: #449; font-weight: bold; } /** e.g., #include, import */
.sh_symbol { color: #966; } /** e.g., <, >, + */
.sh_function { color: #99c; font-weight: bold; } /** function calls and declarations */
.sh_cbracket { color: #966; } /** block brackets (e.g., {, }) */
.sh_todo { font-weight: bold; background-color: cyan; } /** TODO and FIXME */
.sh_specialchar { color: #666; } /** e.g., \n, \t, \\ */
.sh_comment { color: #666; font-style: italic;} /** comments */
.sh_number { color: #990; } /** literal numbers */
.sh_preproc { color: #449; font-weight: bold; } /** e.g., #include, import */
.sh_symbol { color: #966; } /** e.g., <, >, + */
.sh_function { color: #99c; font-weight: bold; } /** function calls and declarations */
.sh_cbracket { color: #966; } /** block brackets (e.g., {, }) */
.sh_todo { font-weight: bold; background-color: #666; } /** TODO and FIXME */
.sh_classname { color: #ff0; } /** for OOP */
.sh_linenum { color: #999; } /** line numbers (not yet implemented) */
.sh_linenum { color: #999; } /** line numbers (not yet implemented) */
.sh_url { color: #090; text-decoration: underline; } /** Internet related */
.sh_variable { color: darkgreen; } /** for Prolog, Perl... */
.sh_variable { color: #696; } /** for Prolog, Perl... */

/** for ChangeLog and Log files */
.sh_date { color: #669; font-weight: bold; }
.sh_time, pre.sh_sourceCode .sh_file { color: #449; font-weight: bold; }
.sh_ip, .sh_name { color: darkgreen; }
.sh_ip, .sh_name { color: #996; }

/** for LaTeX */
.sh_italics { color: darkgreen; font-style: italic; }
.sh_bold { color: darkgreen; font-weight: bold; }
.sh_underline { color: darkgreen; text-decoration: underline; }
.sh_fixed { color: green; }
.sh_argument { color: darkgreen; }
.sh_italics { color: #996; font-style: italic; }
.sh_bold { color: #996; font-weight: bold; }
.sh_underline { color: #996; text-decoration: underline; }
.sh_fixed { color: #696; }
.sh_argument { color: #996; }
.sh_optionalargument { color: purple; }
.sh_math { color: orange; }
.sh_bibtex { color: #669; }

/** for diffs */
pre.sh_sourceCode .sh_oldfile { color: orange; }
pre.sh_sourceCode .sh_newfile { color: darkgreen; }
pre.sh_sourceCode .sh_newfile { color: #996; }
pre.sh_sourceCode .sh_difflines { color: #669; }

/** for css */
pre.sh_sourceCode .sh_selector { color: purple; }
pre.sh_sourceCode .sh_selector { color: #996; }
pre.sh_sourceCode .sh_property { color: #669; }
pre.sh_sourceCode .sh_value { color: darkgreen; font-style: italic; }
pre.sh_sourceCode .sh_value { color: #363; }

/** other */
pre.sh_sourceCode .sh_section { color: #999; font-weight: bold; }
pre.sh_sourceCode .sh_paren { color: #900; }
pre.sh_sourceCode .sh_attribute { color: darkgreen; }
pre.sh_sourceCode .sh_attribute { color: #669; }



Expand Down
4 changes: 2 additions & 2 deletions .wiki/themes/default/screen.css
Expand Up @@ -325,7 +325,7 @@ pre:before {
.sh_string { color: red; } /** strings and chars */
.sh_regexp { color: orange; } /** regular expressions */
.sh_specialchar { color: pink; } /** e.g., \n, \t, \\ */
.sh_comment { color: brown; font-style: italic; } /** comments */
.sh_comment { color: #666; font-style: italic; } /** comments */
.sh_number { color: purple; } /** literal numbers */
.sh_preproc { color: darkblue; font-weight: bold; } /** e.g., #include, import */
.sh_symbol { color: darkred; } /** e.g., <, >, + */
Expand Down Expand Up @@ -360,7 +360,7 @@ pre.sh_sourceCode .sh_difflines { color: blue; }
/** for css */
pre.sh_sourceCode .sh_selector { color: purple; }
pre.sh_sourceCode .sh_property { color: blue; }
pre.sh_sourceCode .sh_value { color: darkgreen; font-style: italic; }
pre.sh_sourceCode .sh_value { color: darkgreen; }

/** other */
pre.sh_sourceCode .sh_section { color: black; font-weight: bold; }
Expand Down
145 changes: 144 additions & 1 deletion syntax/code.wiki
@@ -1,6 +1,6 @@
h1. Code

Available languages : textile, bash, bison, c, changelog, cpp, css, diff, haxe, html, java, javascript, latex, log, makefile, pascal, perl, php, prolog, properties, python, ruby, scala, sh, sql, xml, xorg
Available languages : @textile@, @bash@, @bison@, @c@, @changelog@, @cpp@, @css@, @diff@, @haxe@, @html@, @java@, @javascript@, @latex@, @log@, @makefile@, @pascal@, @perl@, @php@, @prolog@, @properties@, @python@, @ruby@, @scala@, @sh@, @sql@, @xml@, @xorg@

h2. Default

Expand Down Expand Up @@ -63,3 +63,146 @@ bc(html). <!DOCTYPE html>
<p>roin velit est, hendrerit vitae, aliquet tincidunt, accumsan eu, pede.</p>
</body>
</html>


h2. PHP

bc(textile).. bc(php).. /**
* Example
*/
class Foo extends Bar implements Plop
{
const CONSTANT_DEFAULT = 'default';
const CONSTANT_CASE1 = 'case1';

/**
* Property
*
* @var string
*/
private $_prop;
/**
* Constructor
*
* @param string $arg1 Argument 1
*/
public function __construct($arg1)
{
$this->_prop = $arg1;
}
/**
* My function
*
* @param int $arg1 Argument 1
* @param string $arg2 Argument 2
*/
public function myFunction($arg1 = 42, $arg2 = 'default')
{
if ($arg2 === self::CONSTANT_DEFAULT) {
// comment 1
echo "ok";
} else {
// comment 2
die('failed');
}
}
}

bc(php).. /**
* Example
*/
class Foo extends Bar implements Plop
{
const CONSTANT_DEFAULT = 'default';
const CONSTANT_CASE1 = 'case1';

/**
* Property
*
* @var string
*/
private $_prop;
/**
* Constructor
*
* @param string $arg1 Argument 1
*/
public function __construct($arg1)
{
$this->_prop = $arg1;
}
/**
* My function
*
* @param int $arg1 Argument 1
* @param string $arg2 Argument 2
*/
public function myFunction($arg1 = 42, $arg2 = 'default')
{
if ($arg2 === self::CONSTANT_DEFAULT) {
// comment 1
echo "ok";
} else {
// comment 2
die('failed');
}
}
}



h2. CSS

bc(textile).. bc(css).. .test {
display: none;
}

h6 {
margin: 1em 0;
color: #363;
clear: both;
font-family: Ostrich;
font-weight: normal;
font-size: 1.2em;
}

/* LINKS */
a {
color: #090;
font-size: 1em;
}
a:hover {
color: #0f0;
}
a:active {
color: #060;
}

bc(css).. .test {
display: none;
}

h6 {
margin: 1em 0;
color: #363;
clear: both;
font-family: Ostrich;
font-weight: normal;
font-size: 1.2em;
}

/* LINKS */
a {
color: #090;
font-size: 1em;
}
a:hover {
color: #0f0;
}
a:active {
color: #060;
}

0 comments on commit a147509

Please sign in to comment.