From 00134eb8b672c24f6291fbecab5a0c1ef87d9233 Mon Sep 17 00:00:00 2001 From: "Daniel St. Jules" Date: Sat, 27 Jul 2013 22:09:44 -0700 Subject: [PATCH] Create gh-pages branch via GitHub --- index.html | 847 +++++++++++++++++++++++++++++++++++ javascripts/scale.fix.js | 17 + params.json | 1 + stylesheets/pygment_trac.css | 69 +++ stylesheets/styles.css | 255 +++++++++++ 5 files changed, 1189 insertions(+) create mode 100644 index.html create mode 100644 javascripts/scale.fix.js create mode 100644 params.json create mode 100644 stylesheets/pygment_trac.css create mode 100644 stylesheets/styles.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..094c75a --- /dev/null +++ b/index.html @@ -0,0 +1,847 @@ + + + + + + Stringy by danielstjules + + + + + + + +
+
+

Stringy

+

A PHP string manipulation library with multibyte support

+ +

View the Project on GitHub danielstjules/Stringy

+ + + +
+
+

+Stringy

+ +

A PHP library with a variety of string manipulation functions with multibyte support. Offers both OO method chaining and a procedural-style static wrapper. Inspired by underscore.string.js.

+ +

Note: The methods listed below are subject to change until we reach a 1.0.0 release.

+ +

+Requiring/Loading

+ +

If you're using Composer to manage dependencies, you can include the following in your composer.json file:

+ +
"require": {
+    "danielstjules/stringy": "dev-master"
+}
+
+ +

Then, after running composer update or php composer.phar update, you can load the class using Composer's autoloading:

+ +
require 'vendor/autoload.php';
+
+ +

Otherwise, you can simply require the file directly:

+ +
require_once 'path/to/Stringy/src/Stringy/Stringy.php';
+// or
+require_once 'path/to/Stringy/src/Stringy/StaticStringy.php';
+
+ +

And in either case, I'd suggest using an alias.

+ +
use Stringy\Stringy as S;
+// or
+use Stringy\StaticStringy as S;
+
+ +

+OO and Procedural

+ +

The library offers both OO method chaining with Stringy\Stringy, as well as +procedural-style static method calls with Stringy\StaticStringy. An example +of the former is the following:

+ +
use Stringy\Stringy as S;
+echo S::create("Fòô     Bàř", 'UTF-8')->collapseWhitespace()->swapCase();  // 'fÒÔ bÀŘ'
+
+ +

Stringy\Stringy contains a __toString() method, which returns the current +string when the object is used in a string context. Its $str property is also +public, and can be accessed directly if required, ie: S::create('foo')->str // 'foo'

+ +

Using the static wrapper, an alternative is the following:

+ +
use Stringy\StaticStringy as S;
+$string = S::collapseWhitespace("Fòô     Bàř", 'UTF-8');
+echo S::swapCase($string, 'UTF-8');  // 'fÒÔ bÀŘ''
+
+ +

+Methods

+ +

In the list below, any static method other than S::create refers to a +method in Stringy\StaticStringy. For all others, they're found in Stringy\Stringy.

+ +

Note: If $encoding is not given, it defaults to mb_internal_encoding().

+ +
+at
+ +

$stringy->at(int $index)

+ +

S::substr(int $index [, string $encoding ])

+ +

Gets the character of $str at $index, with indexes starting at 0.

+ +
S::create('fòô bàř', 'UTF-8')->at(6);
+S::at('fòô bàř', 6, 'UTF-8');  // 'ř'
+
+ +
+camelize
+ +

$stringy->camelize();

+ +

S::camelize(string $str [, string $encoding ])

+ +

Returns a camelCase version of a supplied string, with multibyte support. +Trims surrounding spaces, capitalizes letters following digits, spaces, +dashes and underscores, and removes spaces, dashes, underscores.

+ +
S::create('Camel-Case')->camelize();
+S::camelize('Camel-Case');  // 'camelCase'
+
+ +
+collapseWhitespace
+ +

$stringy->collapseWhitespace()

+ +

S::collapseWhitespace(string $str)

+ +

Trims the string and replaces consecutive whitespace characters with a +single space. This inclues tabs and newline characters.

+ +
S::create('   Ο     συγγραφέας  ')->collapseWhitespace();
+S::collapseWhitespace('   Ο     συγγραφέας  ');  // 'Ο συγγραφέας'
+
+ +
+contains
+ +

$stringy->contains(string $needle)

+ +

S::contains(string $haystack, string $needle [, string $encoding ])

+ +

Returns true if $haystack contains $needle, false otherwise.

+ +
S::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφέας');
+S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8')  // true
+
+ +
+create
+ +

$stringy = S::create(string $str, [, $encoding ])

+ +

Creates a Stringy object and assigns both str and encoding properties +the supplied values. If $encoding is not specified, it defaults to +mb_internal_encoding(). It then returns the instantiated object.

+ +
S::create('fòô bàř', 'UTF-8');  // 'fòô bàř'
+
+ +
+dasherize
+ +

$stringy->dasherize();

+ +

S::dasherize(string $str [, string $encoding ])

+ +

Returns a lowercase and trimmed string seperated by dashes, with +multibyte support. Dashes are inserted before uppercase characters +(with the exception of the first character of the string), and in place +of spaces as well as underscores.

+ +
S::create('TestDCase')->dasherize();
+S::dasherize('TestDCase');  // 'test-d-case'
+
+ +
+endsWith
+ +

$stringy->endsWith(string $substring [, boolean $caseSensitive = true ])

+ +

S::endsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])

+ +

Returns true if the string $str ends with $substring, false otherwise. +By default, the comparison is case-sensitive, but can be made insensitive +by setting $caseSensitive to false.

+ +
S::create('FÒÔ bàřs', 'UTF-8')->endsWith('àřs', true);
+S::endsWith('FÒÔ bàřs', 'àřs', true, 'UTF-8');  // true
+
+ +
+ensureLeft
+ +

$stringy->ensureLeft(string $substring)

+ +

S::ensureLeft(string $substring [, string $encoding ])

+ +

Ensures that $str begins with $substring.

+ +
S::create('foobar')->ensureLeft('http://');
+S::ensureLeft('foobar', 'http://');  // 'http://foobar'
+
+ +
+ensureRight
+ +

$stringy->ensureRight(string $substring)

+ +

S::ensureRight(string $substring [, string $encoding ])

+ +

Ensures that $str ends with $substring.

+ +
S::create('foobar')->ensureRight('.com');
+S::ensureRight('foobar', '.com');  // 'foobar.com'
+
+ +
+first
+ +

$stringy->first(int $n)

+ +

S::first(int $n [, string $encoding ])

+ +

Gets the first $n characters of $str.

+ +
S::create('fòô bàř', 'UTF-8')->first(3);
+S::first('fòô bàř', 3, 'UTF-8');  // 'fòô'
+
+ +
+humanize
+ +

$stringy->humanize()

+ +

S::humanize(string $str [, string $encoding ])

+ +

Capitalizes the first word of a string, replaces underscores with spaces, +and strips '_id'.

+ +
S::create('author_id')->humanize();
+S::humanize('author_id');  // 'Author'
+
+ +
+insert
+ +

$stringy->insert(int $index, string $substring)

+ +

S::insert(string $str, int $index, string $substring [, string $encoding ])

+ +

Inserts $substring into $str at the $index provided.

+ +
S::create('fòô bà', 'UTF-8')->insert('ř', 6);
+S::insert('fòô bà', 'ř', 6, 'UTF-8');  // 'fòô bàř'
+
+ +
+isAlpha
+ +

$stringy->isAlpha()

+ +

S::isAlpha(string $str [, string $encoding ])

+ +

Returns true if $str contains only alphabetic chars, false otherwise.

+ +
S::create('丹尼爾', 'UTF-8')->isAlpha();
+S::isAlpha('丹尼爾', 'UTF-8');  // true
+
+ +
+isAlphanumeric
+ +

$stringy->isAlphanumeric()

+ +

S::isAlphanumeric(string $str [, string $encoding ])

+ +

Returns true if $str contains only alphabetic and numeric chars, false +otherwise.

+ +
S::create('دانيال1', 'UTF-8')->isAlphanumeric();
+S::isAlphanumeric('دانيال1', 'UTF-8');  // true
+
+ +
+isBlank
+ +

$stringy->isBlank()

+ +

S::isBlank(string $str [, string $encoding ])

+ +

Returns true if $str contains only whitespace chars, false otherwise.

+ +
S::create("\n\t  \v\f")->isBlank();
+S::isBlank("\n\t  \v\f");  // true
+
+ +
+isLowerCase
+ +

$stringy->isLowerCase()

+ +

S::isLowerCase(string $str [, string $encoding ])

+ +

Returns true if $str contains only lower case chars, false otherwise.

+ +
S::create('fòô bàř', 'UTF-8')->isLowerCase();
+S::isLowerCase('fòô bàř', 'UTF-8');  // true
+
+ +
+isUpperCase
+ +

$stringy->isUpperCase()

+ +

S::isUpperCase(string $str [, string $encoding ])

+ +

Returns true if $str contains only upper case chars, false otherwise.

+ +
S::create('FÒÔBÀŘ',, 'UTF-8')->isUpperCase();
+S::isUpperCase('FÒÔBÀŘ',, 'UTF-8');  // true
+
+ +
+last
+ +

$stringy->last(int $n)

+ +

S::last(int $n [, string $encoding ])

+ +

Gets the last $n characters of $str.

+ +
S::create('fòô bàř', 'UTF-8')->last(3);
+S::last('fòô bàř', 3, 'UTF-8');  // 'bàř'
+
+ +
+length
+ +

$stringy->length()

+ +

S::length(string $str [, string $encoding ])

+ +

Returns the length of $str. An alias for PHP's mb_strlen() function.

+ +
S::create('fòô bàř', 'UTF-8')->length();
+S::length('fòô bàř', 'UTF-8');  // 7
+
+ +
+longestCommonPrefix
+ +

$stringy->longestCommonPrefix(string $otherStr)

+ +

S::longestCommonPrefix(string $str, string $otherStr [, $encoding ])

+ +

Finds the longest common prefix between $str and $otherStr.

+ +
S::create('fòô bar', 'UTF-8')->longestCommonPrefix('fòr bar');
+S::longestCommonPrefix('fòô bar', 'fòr bar', 'UTF-8');  // 'fò'
+
+ +
+longestCommonSuffix
+ +

$stringy->longestCommonSuffix(string $otherStr)

+ +

S::longestCommonSuffix(string $str, string $otherStr [, $encoding ])

+ +

Finds the longest common suffix between $str and $otherStr.

+ +
S::create('fòô bàř', 'UTF-8')->longestCommonSuffix('fòr bàř');
+S::longestCommonSuffix('fòô bàř', 'fòr bàř', 'UTF-8');  // ' bàř'
+
+ +
+longestCommonSubstring
+ +

$stringy->longestCommonSubstring(string $otherStr)

+ +

S::longestCommonSubstring(string $str, string $otherStr [, $encoding ])

+ +

Finds the longest common substring between $str and $otherStr. In the +case of ties, returns that which occurs first.

+ +
S::create('foo bar')->longestCommonSubstring('boo far');
+S::longestCommonSubstring('foo bar', 'boo far');  // 'oo '
+
+ +
+lowerCaseFirst
+ +

$stringy->lowerCaseFirst();

+ +

S::lowerCaseFirst(string $str [, string $encoding ])

+ +

Converts the first character of the supplied string to lower case, with +support for multibyte strings.

+ +
S::create('Σ test', 'UTF-8')->lowerCaseFirst();
+S::lowerCaseFirst('Σ test', 'UTF-8');  // 'σ test'
+
+ +
+pad
+ +

$stringy->pad(int $length [, string $padStr = ' ' [, string $padType = 'right' ]])

+ +

S::pad(string $str , int $length [, string $padStr = ' ' [, string $padType = 'right' [, string $encoding ]]])

+ +

Pads a string to a given length with another string. If length is less +than or equal to the length of $str, then no padding takes places. The +default string used for padding is a space, and the default type (one of +'left', 'right', 'both') is 'right'. Throws an exception if $padType +isn't one of those 3 values.

+ +
S::create('fòô bàř', 'UTF-8')->pad( 10, '¬ø', 'left',);
+S::pad('fòô bàř', 10, '¬ø', 'left', 'UTF-8');  // '¬ø¬fòô bàř'
+
+ +
+padBoth
+ +

$stringy->padBoth(int $length [, string $padStr = ' ' ])

+ +

S::padBoth(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])

+ +

Returns a new string of a given length such that both sides of the string +string are padded. Alias for pad($str, $length, $padStr, 'both', $encoding)

+ +
S::create('foo bar')->padBoth(9, ' ');
+S::padBoth('foo bar', 9, ' ');  // ' foo bar '
+
+ +
+padLeft
+ +

$stringy->padLeft(int $length [, string $padStr = ' ' ])

+ +

S::padLeft(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])

+ +

Returns a new string of a given length such that the beginning of the +string is padded. Alias for pad($str, $length, $padStr, 'left', $encoding)

+ +
S::create($str, $encoding)->padLeft($length, $padStr);
+S::padLeft('foo bar', 9, ' ');  // '  foo bar'
+
+ +
+padRight
+ +

$stringy->padRight(int $length [, string $padStr = ' ' ])

+ +

S::padRight(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])

+ +

Returns a new string of a given length such that the end of the string is +padded. Alias for pad($str, $length, $padStr, 'right', $encoding)

+ +
S::create('foo bar')->padRight(10, '_*');
+S::padRight('foo bar', 10, '_*');  // 'foo bar_*_'
+
+ +
+removeLeft
+ +

$stringy->removeLeft(string $substring)

+ +

S::removeLeft(string $str, string $substring [, string $encoding ])

+ +

Removes the prefix $substring if present.

+ +
S::create('fòô bàř', 'UTF-8')->removeLeft('fòô ');
+S::removeLeft('fòô bàř', 'fòô ', 'UTF-8');  // 'bàř'
+
+ +
+removeRight
+ +

$stringy->removeRight(string $substring)

+ +

S::removeRight(string $str, string $substring [, string $encoding ])

+ +

Removes the suffix $substring if present.

+ +
S::create('fòô bàř', 'UTF-8')->removeRight(' bàř');
+S::removeRight('fòô bàř', ' bàř', 'UTF-8');  // 'fòô'
+
+ +
+reverse
+ +

$stringy->reverse()

+ +

S::reverse(string $str, [, string $encoding ])

+ +

Reverses a string. A multibyte version of strrev.

+ +
S::create('fòô bàř', 'UTF-8')->reverse();
+S::reverse('fòô bàř', 'UTF-8');  // 'řàb ôòf'
+
+ +
+safeTruncate
+ +

$stringy->safeTruncate(int $length, [, string $substring = '' ])

+ +

S::safeTruncate(string $str, int $length, [, string $substring = '' [, string $encoding ]])

+ +

Truncates the string to a given length, while ensuring that it does not +chop words. If $substring is provided, and truncating occurs, the string +is further truncated so that the substring may be appended without +exceeding the desired length.

+ +
S::create('What are your plans today?')->safeTruncate(22, '...');
+S::safeTruncate('What are your plans today?', 22, '...');  // 'What are your plans...'
+
+ +
+shuffle
+ +

$stringy->shuffle()

+ +

S::shuffle(string $str [, string $encoding ])

+ +

A multibyte str_shuffle function. It randomizes the order of characters +in a string.

+ +
S::create('fòô bàř', 'UTF-8')->shuffle();
+S::shuffle('fòô bàř', 'UTF-8')  // 'àôřb òf'
+
+ +
+slugify
+ +

$stringy->slugify()

+ +

S::slugify(string $str)

+ +

Converts the supplied text into an URL slug. This includes replacing +non-ASCII characters with their closest ASCII equivalents, removing +non-alphanumeric and non-ASCII characters, and replacing whitespace with +dashes. The string is also converted to lowercase.

+ +
S::create('Using strings like fòô bàř')->slugify();
+S::slugify('Using strings like fòô bàř')  // 'using-strings-like-foo-bar'
+
+ +
+standardize
+ +

$stringy->standardize()

+ +

S::standardize(string $str)

+ +

Converts some non-ASCII characters to their closest ASCII counterparts.

+ +
S::create('fòô bàř')->standardize();
+S::standardize('fòô bàř');  // 'foo bar'
+
+ +
+startsWith
+ +

$stringy->startsWith(string $substring [, boolean $caseSensitive = true ])

+ +

S::startsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])

+ +

Returns true if the string $str begins with $substring, false otherwise. +By default, the comparison is case-sensitive, but can be made insensitive +by setting $caseSensitive to false.

+ +
S::create('FÒÔ bàřs', 'UTF-8')->startsWith('fòô bàř', false);
+S::startsWith('FÒÔ bàřs', 'fòô bàř', false, 'UTF-8');  // true
+
+ +
+substr
+ +

$stringy->substr(int $start [, int $length ])

+ +

S::substr(string $str, int $start [, int $length [, string $encoding ]])

+ +

Gets the substring of $str beginning at $start with the specified $length. +It differs from the mb_substr() function in that providing a $length of +null will return the rest of the string, rather than an empty string.

+ +
S::create('fòô bàř', 'UTF-8')->substr(2, 3);
+S::substr('fòô bàř', 2, 3, 'UTF-8');  // 'ô b'
+
+ +
+surround
+ +

$stringy->surround(string $substring)

+ +

S::surround(string $str, string $substring)

+ +

Surrounds a string with the given substring.

+ +
S::create(' ͜ ')->surround('ʘ');
+S::surround(' ͜ ', 'ʘ');  // 'ʘ ͜ ʘ'
+
+ +
+swapCase
+ +

$stringy->swapCase();

+ +

S::swapCase(string $str [, string $encoding ])

+ +

Returns a case swapped version of a string.

+ +
S::create('Ντανιλ', 'UTF-8')->swapCase();
+S::swapCase('Ντανιλ', 'UTF-8');  // 'νΤΑΝΙΛ'
+
+ +
+tidy
+ +

$stringy->tidy()

+ +

S::tidy(string $str)

+ +

Replaces smart quotes, ellipsis characters, and dashes from Windows-1252 +(and commonly used in Word documents) with their ASCII equivalents.

+ +
S::create('“I see…”')->tidy();
+S::tidy('“I see…”');  // '"I see..."'
+
+ +
+titleize
+ +

$stringy->titleize([ string $encoding ])

+ +

S::titleize(string $str [, array $ignore [, string $encoding ]])

+ +

Capitalizes the first letter of each word in a string, after trimming. +Ignores the case of other letters, allowing for the use of acronyms. +Also accepts an array, $ignore, allowing you to list words not to be +capitalized.

+ +
$ignore = array('at', 'by', 'for', 'in', 'of', 'on', 'out', 'to', 'the');
+S::create('i like to watch DVDs at home', 'UTF-8')->titleize($ignore);
+S::titleize('i like to watch DVDs at home', $ignore, 'UTF-8');
+// 'I Like to Watch DVDs at Home'
+
+ +
+toSpaces
+ +

$stringy->toSpaces([ tabLength = 4 ])

+ +

S::toSpaces(string $str, [, int $tabLength = 4 ])

+ +

Converts each tab in a string to some number of spaces, as defined by +$tabLength. By default, each tab is converted to 4 consecutive spaces.

+ +
S::create(' String speech = "Hi"')->toSpaces();
+S::toSpaces('   String speech = "Hi"')  // '    String speech = "Hi"'
+
+ +
+toTabs
+ +

$stringy->toTabs([ tabLength = 4 ])

+ +

S::toTabs(string $str, [, int $tabLength = 4 ])

+ +

Converts each occurence of some consecutive number of spaces, as defined +by $tabLength, to a tab. By default, each 4 consecutive spaces are +converted to a tab.

+ +
S::create('    fòô    bàř')->toTabs();
+S::toTabs('    fòô    bàř')  // '   fòô bàř'
+
+ +
+trim
+ +

$stringy->trim()

+ +

S::trim(string $str)

+ +

Trims $str. An alias for PHP's trim() function.

+ +
S::create('fòô bàř', 'UTF-8')->trim();
+S::trim(' fòô bàř ')  // 'fòô bàř'
+
+ +
+truncate
+ +

$stringy->truncate(int $length, [, string $substring = '' ])

+ +

S::truncate(string $str, int $length, [, string $substring = '' [, string $encoding ]])

+ +

Truncates $str to a given length. If $substring is provided, and +truncating occurs, the string is further truncated so that the substring +may be appended without exceeding the desired length.

+ +
S::create('What are your plans today?')->safeTruncate(19, '...');
+S::safeTruncate('What are your plans today?', 19, '...');  // 'What are your pl...'
+
+ +
+underscored
+ +

$stringy->underscored();

+ +

S::underscored(string $str [, string $encoding ])

+ +

Returns a lowercase and trimmed string seperated by underscores, with +multibyte support. Underscores are inserted before uppercase characters +(with the exception of the first character of the string), and in place +of spaces as well as dashes.

+ +
S::create('TestUCase')->underscored();
+S::underscored('TestUCase');  // 'test_u_case'
+
+ +
+upperCamelize
+ +

$stringy->upperCamelize();

+ +

S::upperCamelize(string $str [, string $encoding ])

+ +

Returns an UpperCamelCase version of a supplied string, with multibyte +support. Trims surrounding spaces, capitalizes letters following digits, +spaces, dashes and underscores, and removes spaces, dashes, underscores.

+ +
S::create('Upper Camel-Case')->upperCamelize();
+S::upperCamelize('Upper Camel-Case');  // 'UpperCamelCase'
+
+ +
+upperCaseFirst
+ +

$stringy->upperCaseFirst();

+ +

S::upperCaseFirst(string $str [, string $encoding ])

+ +

Converts the first character of the supplied string to upper case, with +support for multibyte strings.

+ +
S::create('σ test', 'UTF-8')->upperCaseFirst();
+S::upperCaseFirst('σ test', 'UTF-8');  // 'Σ test'
+
+ +

+TODO

+ +

count => substr_count

+ +

wordCount => str_word_count

+ +

wordWrap

+ +

excerpt ($str, $substring, $radius)

+ +

pluralize ($count, $singular, $plural = null)

+ +

toBoolean

+ +

+Tests

+ +

Build Status

+ +

From the project directory, tests can be ran using phpunit

+ +

+License

+ +

Released under the MIT License - see LICENSE.txt for details.

+
+ +
+ + + + \ No newline at end of file diff --git a/javascripts/scale.fix.js b/javascripts/scale.fix.js new file mode 100644 index 0000000..87a40ca --- /dev/null +++ b/javascripts/scale.fix.js @@ -0,0 +1,17 @@ +var metas = document.getElementsByTagName('meta'); +var i; +if (navigator.userAgent.match(/iPhone/i)) { + for (i=0; icollapseWhitespace()->swapCase(); // 'fÒÔ bÀŘ'\r\n```\r\n\r\n`Stringy\\Stringy` contains a __toString() method, which returns the current\r\nstring when the object is used in a string context. Its $str property is also\r\npublic, and can be accessed directly if required, ie: `S::create('foo')->str // 'foo'`\r\n\r\nUsing the static wrapper, an alternative is the following:\r\n\r\n```php\r\nuse Stringy\\StaticStringy as S;\r\n$string = S::collapseWhitespace(\"Fòô Bàř\", 'UTF-8');\r\necho S::swapCase($string, 'UTF-8'); // 'fÒÔ bÀŘ''\r\n```\r\n\r\n## Methods\r\n\r\nIn the list below, any static method other than S::create refers to a\r\nmethod in Stringy\\StaticStringy. For all others, they're found in Stringy\\Stringy.\r\n\r\n*Note: If $encoding is not given, it defaults to mb_internal_encoding().*\r\n\r\n##### at\r\n\r\n$stringy->at(int $index)\r\n\r\nS::substr(int $index [, string $encoding ])\r\n\r\nGets the character of $str at $index, with indexes starting at 0.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->at(6);\r\nS::at('fòô bàř', 6, 'UTF-8'); // 'ř'\r\n```\r\n\r\n##### camelize\r\n\r\n$stringy->camelize();\r\n\r\nS::camelize(string $str [, string $encoding ])\r\n\r\nReturns a camelCase version of a supplied string, with multibyte support.\r\nTrims surrounding spaces, capitalizes letters following digits, spaces,\r\ndashes and underscores, and removes spaces, dashes, underscores.\r\n\r\n```php\r\nS::create('Camel-Case')->camelize();\r\nS::camelize('Camel-Case'); // 'camelCase'\r\n```\r\n\r\n##### collapseWhitespace\r\n\r\n$stringy->collapseWhitespace()\r\n\r\nS::collapseWhitespace(string $str)\r\n\r\nTrims the string and replaces consecutive whitespace characters with a\r\nsingle space. This inclues tabs and newline characters.\r\n\r\n```php\r\nS::create(' Ο συγγραφέας ')->collapseWhitespace();\r\nS::collapseWhitespace(' Ο συγγραφέας '); // 'Ο συγγραφέας'\r\n```\r\n\r\n##### contains\r\n\r\n$stringy->contains(string $needle)\r\n\r\nS::contains(string $haystack, string $needle [, string $encoding ])\r\n\r\nReturns true if $haystack contains $needle, false otherwise.\r\n\r\n```php\r\nS::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφέας');\r\nS::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8') // true\r\n```\r\n\r\n##### create\r\n\r\n$stringy = S::create(string $str, [, $encoding ])\r\n\r\nCreates a Stringy object and assigns both str and encoding properties\r\nthe supplied values. If $encoding is not specified, it defaults to\r\nmb_internal_encoding(). It then returns the instantiated object.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8'); // 'fòô bàř'\r\n```\r\n\r\n##### dasherize\r\n\r\n$stringy->dasherize();\r\n\r\nS::dasherize(string $str [, string $encoding ])\r\n\r\nReturns a lowercase and trimmed string seperated by dashes, with\r\nmultibyte support. Dashes are inserted before uppercase characters\r\n(with the exception of the first character of the string), and in place\r\nof spaces as well as underscores.\r\n\r\n```php\r\nS::create('TestDCase')->dasherize();\r\nS::dasherize('TestDCase'); // 'test-d-case'\r\n```\r\n\r\n##### endsWith\r\n\r\n$stringy->endsWith(string $substring [, boolean $caseSensitive = true ])\r\n\r\nS::endsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])\r\n\r\nReturns true if the string $str ends with $substring, false otherwise.\r\nBy default, the comparison is case-sensitive, but can be made insensitive\r\nby setting $caseSensitive to false.\r\n\r\n```php\r\nS::create('FÒÔ bàřs', 'UTF-8')->endsWith('àřs', true);\r\nS::endsWith('FÒÔ bàřs', 'àřs', true, 'UTF-8'); // true\r\n```\r\n\r\n##### ensureLeft\r\n\r\n$stringy->ensureLeft(string $substring)\r\n\r\nS::ensureLeft(string $substring [, string $encoding ])\r\n\r\nEnsures that $str begins with $substring.\r\n\r\n```php\r\nS::create('foobar')->ensureLeft('http://');\r\nS::ensureLeft('foobar', 'http://'); // 'http://foobar'\r\n```\r\n\r\n##### ensureRight\r\n\r\n$stringy->ensureRight(string $substring)\r\n\r\nS::ensureRight(string $substring [, string $encoding ])\r\n\r\nEnsures that $str ends with $substring.\r\n\r\n```php\r\nS::create('foobar')->ensureRight('.com');\r\nS::ensureRight('foobar', '.com'); // 'foobar.com'\r\n```\r\n\r\n##### first\r\n\r\n$stringy->first(int $n)\r\n\r\nS::first(int $n [, string $encoding ])\r\n\r\nGets the first $n characters of $str.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->first(3);\r\nS::first('fòô bàř', 3, 'UTF-8'); // 'fòô'\r\n```\r\n\r\n##### humanize\r\n\r\n$stringy->humanize()\r\n\r\nS::humanize(string $str [, string $encoding ])\r\n\r\nCapitalizes the first word of a string, replaces underscores with spaces,\r\nand strips '_id'.\r\n\r\n```php\r\nS::create('author_id')->humanize();\r\nS::humanize('author_id'); // 'Author'\r\n```\r\n\r\n##### insert\r\n\r\n$stringy->insert(int $index, string $substring)\r\n\r\nS::insert(string $str, int $index, string $substring [, string $encoding ])\r\n\r\nInserts $substring into $str at the $index provided.\r\n\r\n```php\r\nS::create('fòô bà', 'UTF-8')->insert('ř', 6);\r\nS::insert('fòô bà', 'ř', 6, 'UTF-8'); // 'fòô bàř'\r\n```\r\n\r\n##### isAlpha\r\n\r\n$stringy->isAlpha()\r\n\r\nS::isAlpha(string $str [, string $encoding ])\r\n\r\nReturns true if $str contains only alphabetic chars, false otherwise.\r\n\r\n```php\r\nS::create('丹尼爾', 'UTF-8')->isAlpha();\r\nS::isAlpha('丹尼爾', 'UTF-8'); // true\r\n```\r\n\r\n##### isAlphanumeric\r\n\r\n$stringy->isAlphanumeric()\r\n\r\nS::isAlphanumeric(string $str [, string $encoding ])\r\n\r\nReturns true if $str contains only alphabetic and numeric chars, false\r\notherwise.\r\n\r\n```php\r\nS::create('دانيال1', 'UTF-8')->isAlphanumeric();\r\nS::isAlphanumeric('دانيال1', 'UTF-8'); // true\r\n```\r\n\r\n##### isBlank\r\n\r\n$stringy->isBlank()\r\n\r\nS::isBlank(string $str [, string $encoding ])\r\n\r\nReturns true if $str contains only whitespace chars, false otherwise.\r\n\r\n```php\r\nS::create(\"\\n\\t \\v\\f\")->isBlank();\r\nS::isBlank(\"\\n\\t \\v\\f\"); // true\r\n```\r\n\r\n##### isLowerCase\r\n\r\n$stringy->isLowerCase()\r\n\r\nS::isLowerCase(string $str [, string $encoding ])\r\n\r\nReturns true if $str contains only lower case chars, false otherwise.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->isLowerCase();\r\nS::isLowerCase('fòô bàř', 'UTF-8'); // true\r\n```\r\n\r\n##### isUpperCase\r\n\r\n$stringy->isUpperCase()\r\n\r\nS::isUpperCase(string $str [, string $encoding ])\r\n\r\nReturns true if $str contains only upper case chars, false otherwise.\r\n\r\n```php\r\nS::create('FÒÔBÀŘ',, 'UTF-8')->isUpperCase();\r\nS::isUpperCase('FÒÔBÀŘ',, 'UTF-8'); // true\r\n```\r\n\r\n##### last\r\n\r\n$stringy->last(int $n)\r\n\r\nS::last(int $n [, string $encoding ])\r\n\r\nGets the last $n characters of $str.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->last(3);\r\nS::last('fòô bàř', 3, 'UTF-8'); // 'bàř'\r\n```\r\n\r\n##### length\r\n\r\n$stringy->length()\r\n\r\nS::length(string $str [, string $encoding ])\r\n\r\nReturns the length of $str. An alias for PHP's mb_strlen() function.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->length();\r\nS::length('fòô bàř', 'UTF-8'); // 7\r\n```\r\n\r\n##### longestCommonPrefix\r\n\r\n$stringy->longestCommonPrefix(string $otherStr)\r\n\r\nS::longestCommonPrefix(string $str, string $otherStr [, $encoding ])\r\n\r\nFinds the longest common prefix between $str and $otherStr.\r\n\r\n```php\r\nS::create('fòô bar', 'UTF-8')->longestCommonPrefix('fòr bar');\r\nS::longestCommonPrefix('fòô bar', 'fòr bar', 'UTF-8'); // 'fò'\r\n```\r\n\r\n##### longestCommonSuffix\r\n\r\n$stringy->longestCommonSuffix(string $otherStr)\r\n\r\nS::longestCommonSuffix(string $str, string $otherStr [, $encoding ])\r\n\r\nFinds the longest common suffix between $str and $otherStr.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->longestCommonSuffix('fòr bàř');\r\nS::longestCommonSuffix('fòô bàř', 'fòr bàř', 'UTF-8'); // ' bàř'\r\n```\r\n\r\n##### longestCommonSubstring\r\n\r\n$stringy->longestCommonSubstring(string $otherStr)\r\n\r\nS::longestCommonSubstring(string $str, string $otherStr [, $encoding ])\r\n\r\nFinds the longest common substring between $str and $otherStr. In the\r\ncase of ties, returns that which occurs first.\r\n\r\n```php\r\nS::create('foo bar')->longestCommonSubstring('boo far');\r\nS::longestCommonSubstring('foo bar', 'boo far'); // 'oo '\r\n```\r\n\r\n##### lowerCaseFirst\r\n\r\n$stringy->lowerCaseFirst();\r\n\r\nS::lowerCaseFirst(string $str [, string $encoding ])\r\n\r\nConverts the first character of the supplied string to lower case, with\r\nsupport for multibyte strings.\r\n\r\n```php\r\nS::create('Σ test', 'UTF-8')->lowerCaseFirst();\r\nS::lowerCaseFirst('Σ test', 'UTF-8'); // 'σ test'\r\n```\r\n\r\n##### pad\r\n\r\n$stringy->pad(int $length [, string $padStr = ' ' [, string $padType = 'right' ]])\r\n\r\nS::pad(string $str , int $length [, string $padStr = ' ' [, string $padType = 'right' [, string $encoding ]]])\r\n\r\nPads a string to a given length with another string. If length is less\r\nthan or equal to the length of $str, then no padding takes places. The\r\ndefault string used for padding is a space, and the default type (one of\r\n'left', 'right', 'both') is 'right'. Throws an exception if $padType\r\nisn't one of those 3 values.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->pad( 10, '¬ø', 'left',);\r\nS::pad('fòô bàř', 10, '¬ø', 'left', 'UTF-8'); // '¬ø¬fòô bàř'\r\n```\r\n\r\n##### padBoth\r\n\r\n$stringy->padBoth(int $length [, string $padStr = ' ' ])\r\n\r\nS::padBoth(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])\r\n\r\nReturns a new string of a given length such that both sides of the string\r\nstring are padded. Alias for pad($str, $length, $padStr, 'both', $encoding)\r\n\r\n```php\r\nS::create('foo bar')->padBoth(9, ' ');\r\nS::padBoth('foo bar', 9, ' '); // ' foo bar '\r\n```\r\n\r\n##### padLeft\r\n\r\n$stringy->padLeft(int $length [, string $padStr = ' ' ])\r\n\r\nS::padLeft(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])\r\n\r\nReturns a new string of a given length such that the beginning of the\r\nstring is padded. Alias for pad($str, $length, $padStr, 'left', $encoding)\r\n\r\n```php\r\nS::create($str, $encoding)->padLeft($length, $padStr);\r\nS::padLeft('foo bar', 9, ' '); // ' foo bar'\r\n```\r\n\r\n##### padRight\r\n\r\n$stringy->padRight(int $length [, string $padStr = ' ' ])\r\n\r\nS::padRight(string $str , int $length [, string $padStr = ' ' [, string $encoding ]])\r\n\r\nReturns a new string of a given length such that the end of the string is\r\npadded. Alias for pad($str, $length, $padStr, 'right', $encoding)\r\n\r\n```php\r\nS::create('foo bar')->padRight(10, '_*');\r\nS::padRight('foo bar', 10, '_*'); // 'foo bar_*_'\r\n```\r\n\r\n##### removeLeft\r\n\r\n$stringy->removeLeft(string $substring)\r\n\r\nS::removeLeft(string $str, string $substring [, string $encoding ])\r\n\r\nRemoves the prefix $substring if present.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->removeLeft('fòô ');\r\nS::removeLeft('fòô bàř', 'fòô ', 'UTF-8'); // 'bàř'\r\n```\r\n\r\n##### removeRight\r\n\r\n$stringy->removeRight(string $substring)\r\n\r\nS::removeRight(string $str, string $substring [, string $encoding ])\r\n\r\nRemoves the suffix $substring if present.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->removeRight(' bàř');\r\nS::removeRight('fòô bàř', ' bàř', 'UTF-8'); // 'fòô'\r\n```\r\n\r\n##### reverse\r\n\r\n$stringy->reverse()\r\n\r\nS::reverse(string $str, [, string $encoding ])\r\n\r\nReverses a string. A multibyte version of strrev.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->reverse();\r\nS::reverse('fòô bàř', 'UTF-8'); // 'řàb ôòf'\r\n```\r\n\r\n##### safeTruncate\r\n\r\n$stringy->safeTruncate(int $length, [, string $substring = '' ])\r\n\r\nS::safeTruncate(string $str, int $length, [, string $substring = '' [, string $encoding ]])\r\n\r\nTruncates the string to a given length, while ensuring that it does not\r\nchop words. If $substring is provided, and truncating occurs, the string\r\nis further truncated so that the substring may be appended without\r\nexceeding the desired length.\r\n\r\n```php\r\nS::create('What are your plans today?')->safeTruncate(22, '...');\r\nS::safeTruncate('What are your plans today?', 22, '...'); // 'What are your plans...'\r\n```\r\n\r\n##### shuffle\r\n\r\n$stringy->shuffle()\r\n\r\nS::shuffle(string $str [, string $encoding ])\r\n\r\nA multibyte str_shuffle function. It randomizes the order of characters\r\nin a string.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->shuffle();\r\nS::shuffle('fòô bàř', 'UTF-8') // 'àôřb òf'\r\n```\r\n\r\n##### slugify\r\n\r\n$stringy->slugify()\r\n\r\nS::slugify(string $str)\r\n\r\nConverts the supplied text into an URL slug. This includes replacing\r\nnon-ASCII characters with their closest ASCII equivalents, removing\r\nnon-alphanumeric and non-ASCII characters, and replacing whitespace with\r\ndashes. The string is also converted to lowercase.\r\n\r\n```php\r\nS::create('Using strings like fòô bàř')->slugify();\r\nS::slugify('Using strings like fòô bàř') // 'using-strings-like-foo-bar'\r\n```\r\n\r\n##### standardize\r\n\r\n$stringy->standardize()\r\n\r\nS::standardize(string $str)\r\n\r\nConverts some non-ASCII characters to their closest ASCII counterparts.\r\n\r\n```php\r\nS::create('fòô bàř')->standardize();\r\nS::standardize('fòô bàř'); // 'foo bar'\r\n```\r\n\r\n##### startsWith\r\n\r\n$stringy->startsWith(string $substring [, boolean $caseSensitive = true ])\r\n\r\nS::startsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]])\r\n\r\nReturns true if the string $str begins with $substring, false otherwise.\r\nBy default, the comparison is case-sensitive, but can be made insensitive\r\nby setting $caseSensitive to false.\r\n\r\n```php\r\nS::create('FÒÔ bàřs', 'UTF-8')->startsWith('fòô bàř', false);\r\nS::startsWith('FÒÔ bàřs', 'fòô bàř', false, 'UTF-8'); // true\r\n```\r\n\r\n##### substr\r\n\r\n$stringy->substr(int $start [, int $length ])\r\n\r\nS::substr(string $str, int $start [, int $length [, string $encoding ]])\r\n\r\nGets the substring of $str beginning at $start with the specified $length.\r\nIt differs from the mb_substr() function in that providing a $length of\r\nnull will return the rest of the string, rather than an empty string.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->substr(2, 3);\r\nS::substr('fòô bàř', 2, 3, 'UTF-8'); // 'ô b'\r\n```\r\n\r\n##### surround\r\n\r\n$stringy->surround(string $substring)\r\n\r\nS::surround(string $str, string $substring)\r\n\r\nSurrounds a string with the given substring.\r\n\r\n```php\r\nS::create(' ͜ ')->surround('ʘ');\r\nS::surround(' ͜ ', 'ʘ'); // 'ʘ ͜ ʘ'\r\n```\r\n\r\n##### swapCase\r\n\r\n$stringy->swapCase();\r\n\r\nS::swapCase(string $str [, string $encoding ])\r\n\r\nReturns a case swapped version of a string.\r\n\r\n```php\r\nS::create('Ντανιλ', 'UTF-8')->swapCase();\r\nS::swapCase('Ντανιλ', 'UTF-8'); // 'νΤΑΝΙΛ'\r\n```\r\n\r\n##### tidy\r\n\r\n$stringy->tidy()\r\n\r\nS::tidy(string $str)\r\n\r\nReplaces smart quotes, ellipsis characters, and dashes from Windows-1252\r\n(and commonly used in Word documents) with their ASCII equivalents.\r\n\r\n```php\r\nS::create('“I see…”')->tidy();\r\nS::tidy('“I see…”'); // '\"I see...\"'\r\n```\r\n\r\n##### titleize\r\n\r\n$stringy->titleize([ string $encoding ])\r\n\r\nS::titleize(string $str [, array $ignore [, string $encoding ]])\r\n\r\nCapitalizes the first letter of each word in a string, after trimming.\r\nIgnores the case of other letters, allowing for the use of acronyms.\r\nAlso accepts an array, $ignore, allowing you to list words not to be\r\ncapitalized.\r\n\r\n```php\r\n$ignore = array('at', 'by', 'for', 'in', 'of', 'on', 'out', 'to', 'the');\r\nS::create('i like to watch DVDs at home', 'UTF-8')->titleize($ignore);\r\nS::titleize('i like to watch DVDs at home', $ignore, 'UTF-8');\r\n// 'I Like to Watch DVDs at Home'\r\n```\r\n\r\n##### toSpaces\r\n\r\n$stringy->toSpaces([ tabLength = 4 ])\r\n\r\nS::toSpaces(string $str, [, int $tabLength = 4 ])\r\n\r\nConverts each tab in a string to some number of spaces, as defined by\r\n$tabLength. By default, each tab is converted to 4 consecutive spaces.\r\n\r\n```php\r\nS::create(' String speech = \"Hi\"')->toSpaces();\r\nS::toSpaces(' String speech = \"Hi\"') // ' String speech = \"Hi\"'\r\n```\r\n\r\n##### toTabs\r\n\r\n$stringy->toTabs([ tabLength = 4 ])\r\n\r\nS::toTabs(string $str, [, int $tabLength = 4 ])\r\n\r\nConverts each occurence of some consecutive number of spaces, as defined\r\nby $tabLength, to a tab. By default, each 4 consecutive spaces are\r\nconverted to a tab.\r\n\r\n```php\r\nS::create(' fòô bàř')->toTabs();\r\nS::toTabs(' fòô bàř') // ' fòô bàř'\r\n```\r\n\r\n##### trim\r\n\r\n$stringy->trim()\r\n\r\nS::trim(string $str)\r\n\r\nTrims $str. An alias for PHP's trim() function.\r\n\r\n```php\r\nS::create('fòô bàř', 'UTF-8')->trim();\r\nS::trim(' fòô bàř ') // 'fòô bàř'\r\n```\r\n\r\n##### truncate\r\n\r\n$stringy->truncate(int $length, [, string $substring = '' ])\r\n\r\nS::truncate(string $str, int $length, [, string $substring = '' [, string $encoding ]])\r\n\r\nTruncates $str to a given length. If $substring is provided, and\r\ntruncating occurs, the string is further truncated so that the substring\r\nmay be appended without exceeding the desired length.\r\n\r\n```php\r\nS::create('What are your plans today?')->safeTruncate(19, '...');\r\nS::safeTruncate('What are your plans today?', 19, '...'); // 'What are your pl...'\r\n```\r\n\r\n##### underscored\r\n\r\n$stringy->underscored();\r\n\r\nS::underscored(string $str [, string $encoding ])\r\n\r\nReturns a lowercase and trimmed string seperated by underscores, with\r\nmultibyte support. Underscores are inserted before uppercase characters\r\n(with the exception of the first character of the string), and in place\r\nof spaces as well as dashes.\r\n\r\n```php\r\nS::create('TestUCase')->underscored();\r\nS::underscored('TestUCase'); // 'test_u_case'\r\n```\r\n\r\n##### upperCamelize\r\n\r\n$stringy->upperCamelize();\r\n\r\nS::upperCamelize(string $str [, string $encoding ])\r\n\r\nReturns an UpperCamelCase version of a supplied string, with multibyte\r\nsupport. Trims surrounding spaces, capitalizes letters following digits,\r\nspaces, dashes and underscores, and removes spaces, dashes, underscores.\r\n\r\n```php\r\nS::create('Upper Camel-Case')->upperCamelize();\r\nS::upperCamelize('Upper Camel-Case'); // 'UpperCamelCase'\r\n```\r\n\r\n##### upperCaseFirst\r\n\r\n$stringy->upperCaseFirst();\r\n\r\nS::upperCaseFirst(string $str [, string $encoding ])\r\n\r\nConverts the first character of the supplied string to upper case, with\r\nsupport for multibyte strings.\r\n\r\n```php\r\nS::create('σ test', 'UTF-8')->upperCaseFirst();\r\nS::upperCaseFirst('σ test', 'UTF-8'); // 'Σ test'\r\n```\r\n\r\n## TODO\r\n\r\n**count** => substr_count\r\n\r\n**wordCount** => str_word_count\r\n\r\n**wordWrap**\r\n\r\n**excerpt** ($str, $substring, $radius)\r\n\r\n**pluralize** ($count, $singular, $plural = null)\r\n\r\n**toBoolean**\r\n\r\n## Tests\r\n\r\n[![Build Status](https://travis-ci.org/danielstjules/Stringy.png)](https://travis-ci.org/danielstjules/Stringy)\r\n\r\nFrom the project directory, tests can be ran using `phpunit`\r\n\r\n## License\r\n\r\nReleased under the MIT License - see `LICENSE.txt` for details.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..c6a6452 --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/styles.css b/stylesheets/styles.css new file mode 100644 index 0000000..dacf2e1 --- /dev/null +++ b/stylesheets/styles.css @@ -0,0 +1,255 @@ +@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); + +body { + padding:50px; + font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#777; + font-weight:300; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin:0 0 20px; +} + +p, ul, ol, table, pre, dl { + margin:0 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; +} + +h3, h4, h5, h6 { + color:#494949; +} + +a { + color:#39c; + font-weight:400; + text-decoration:none; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.6em; + display:block; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + color:#333; + font-size:12px; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + width:270px; + float:left; + position:fixed; +} + +header ul { + list-style:none; + height:40px; + + padding:0; + + background: #eee; + background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); + background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + + border-radius:5px; + border:1px solid #d2d2d2; + box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0; + width:270px; +} + +header li { + width:89px; + float:left; + border-right:1px solid #d2d2d2; + height:40px; +} + +header ul a { + line-height:1; + font-size:11px; + color:#999; + display:block; + text-align:center; + padding-top:6px; + height:40px; +} + +strong { + color:#222; + font-weight:700; +} + +header ul li + li { + width:88px; + border-left:1px solid #fff; +} + +header ul li + li + li { + border-right:none; + width:89px; +} + +header ul a strong { + font-size:14px; + display:block; + color:#222; +} + +section { + width:500px; + float:right; + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +footer { + width:270px; + float:left; + position:fixed; + bottom:50px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + padding-right:320px; + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:50px; + top:52px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } + + header ul { + display:none; + } +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +}