diff --git a/fonts/copse-regular-webfont.eot b/fonts/copse-regular-webfont.eot new file mode 100644 index 0000000..af1f5e6 Binary files /dev/null and b/fonts/copse-regular-webfont.eot differ diff --git a/fonts/copse-regular-webfont.svg b/fonts/copse-regular-webfont.svg new file mode 100644 index 0000000..1e920b5 --- /dev/null +++ b/fonts/copse-regular-webfont.svg @@ -0,0 +1,247 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Copyright c 2010 Daniel Rhatigansparkyultrasparkyorg with Reserved Font Name Copse +Designer : Daniel Rhatigan +Foundry : Daniel Rhatigan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/copse-regular-webfont.ttf b/fonts/copse-regular-webfont.ttf new file mode 100644 index 0000000..434b208 Binary files /dev/null and b/fonts/copse-regular-webfont.ttf differ diff --git a/fonts/copse-regular-webfont.woff b/fonts/copse-regular-webfont.woff new file mode 100644 index 0000000..a9a0450 Binary files /dev/null and b/fonts/copse-regular-webfont.woff differ diff --git a/fonts/quattrocentosans-bold-webfont.eot b/fonts/quattrocentosans-bold-webfont.eot new file mode 100644 index 0000000..c041ed9 Binary files /dev/null and b/fonts/quattrocentosans-bold-webfont.eot differ diff --git a/fonts/quattrocentosans-bold-webfont.svg b/fonts/quattrocentosans-bold-webfont.svg new file mode 100644 index 0000000..fb162e9 --- /dev/null +++ b/fonts/quattrocentosans-bold-webfont.svg @@ -0,0 +1,247 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Copyright c 2011 Pablo Impallari wwwimpallaricomimpallarigmailcomCopyright c 2011 Igino Marini wwwikerncommailiginomarinicomCopyright c 2011 Brenda Gallo gbrenda1987gmailcomwith Reserved Font Name Quattrocento Sans +Designer : Pablo Impallari +Foundry : Pablo Impallari Igino Marini Brenda Gallo +Foundry URL : wwwimpallaricom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/quattrocentosans-bold-webfont.ttf b/fonts/quattrocentosans-bold-webfont.ttf new file mode 100644 index 0000000..7389c87 Binary files /dev/null and b/fonts/quattrocentosans-bold-webfont.ttf differ diff --git a/fonts/quattrocentosans-bold-webfont.woff b/fonts/quattrocentosans-bold-webfont.woff new file mode 100644 index 0000000..fc14168 Binary files /dev/null and b/fonts/quattrocentosans-bold-webfont.woff differ diff --git a/fonts/quattrocentosans-bolditalic-webfont.eot b/fonts/quattrocentosans-bolditalic-webfont.eot new file mode 100644 index 0000000..7c1aa7a Binary files /dev/null and b/fonts/quattrocentosans-bolditalic-webfont.eot differ diff --git a/fonts/quattrocentosans-bolditalic-webfont.svg b/fonts/quattrocentosans-bolditalic-webfont.svg new file mode 100644 index 0000000..9070a8b --- /dev/null +++ b/fonts/quattrocentosans-bolditalic-webfont.svg @@ -0,0 +1,248 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Copyright c 2011 Pablo Impallari wwwimpallaricomimpallarigmailcomCopyright c 2011 Igino Marini wwwikerncommailiginomarinicomCopyright c 2011 Brenda Gallo gbrenda1987gmailcomwith Reserved Font Name Quattrocento Sans +Designer : Pablo Impallari +Foundry : Pablo Impallari Igino Marini Brenda Gallo +Foundry URL : wwwimpallaricom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/quattrocentosans-bolditalic-webfont.ttf b/fonts/quattrocentosans-bolditalic-webfont.ttf new file mode 100644 index 0000000..9766a17 Binary files /dev/null and b/fonts/quattrocentosans-bolditalic-webfont.ttf differ diff --git a/fonts/quattrocentosans-bolditalic-webfont.woff b/fonts/quattrocentosans-bolditalic-webfont.woff new file mode 100644 index 0000000..c436da0 Binary files /dev/null and b/fonts/quattrocentosans-bolditalic-webfont.woff differ diff --git a/fonts/quattrocentosans-italic-webfont.eot b/fonts/quattrocentosans-italic-webfont.eot new file mode 100644 index 0000000..379b383 Binary files /dev/null and b/fonts/quattrocentosans-italic-webfont.eot differ diff --git a/fonts/quattrocentosans-italic-webfont.svg b/fonts/quattrocentosans-italic-webfont.svg new file mode 100644 index 0000000..b613779 --- /dev/null +++ b/fonts/quattrocentosans-italic-webfont.svg @@ -0,0 +1,247 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Copyright c 2011 Pablo Impallari wwwimpallaricomimpallarigmailcomCopyright c 2011 Igino Marini wwwikerncommailiginomarinicomCopyright c 2011 Brenda Gallo gbrenda1987gmailcomwith Reserved Font Name Quattrocento Sans +Designer : Pablo Impallari +Foundry : Pablo Impallari Igino Marini Brenda Gallo +Foundry URL : wwwimpallaricom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/quattrocentosans-italic-webfont.ttf b/fonts/quattrocentosans-italic-webfont.ttf new file mode 100644 index 0000000..c7ba47a Binary files /dev/null and b/fonts/quattrocentosans-italic-webfont.ttf differ diff --git a/fonts/quattrocentosans-italic-webfont.woff b/fonts/quattrocentosans-italic-webfont.woff new file mode 100644 index 0000000..3798881 Binary files /dev/null and b/fonts/quattrocentosans-italic-webfont.woff differ diff --git a/fonts/quattrocentosans-regular-webfont.eot b/fonts/quattrocentosans-regular-webfont.eot new file mode 100644 index 0000000..346db6f Binary files /dev/null and b/fonts/quattrocentosans-regular-webfont.eot differ diff --git a/fonts/quattrocentosans-regular-webfont.svg b/fonts/quattrocentosans-regular-webfont.svg new file mode 100644 index 0000000..3470924 --- /dev/null +++ b/fonts/quattrocentosans-regular-webfont.svg @@ -0,0 +1,247 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Copyright c 2011 Pablo Impallari wwwimpallaricomimpallarigmailcomCopyright c 2011 Igino Marini wwwikerncommailiginomarinicomCopyright c 2011 Brenda Gallo gbrenda1987gmailcomwith Reserved Font Name Quattrocento Sans +Designer : Pablo Impallari +Foundry : Pablo Impallari Igino Marini Brenda Gallo +Foundry URL : wwwimpallaricom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/quattrocentosans-regular-webfont.ttf b/fonts/quattrocentosans-regular-webfont.ttf new file mode 100644 index 0000000..e414670 Binary files /dev/null and b/fonts/quattrocentosans-regular-webfont.ttf differ diff --git a/fonts/quattrocentosans-regular-webfont.woff b/fonts/quattrocentosans-regular-webfont.woff new file mode 100644 index 0000000..09ed324 Binary files /dev/null and b/fonts/quattrocentosans-regular-webfont.woff differ diff --git a/images/background.png b/images/background.png new file mode 100644 index 0000000..b63b420 Binary files /dev/null and b/images/background.png differ diff --git a/images/body-background.png b/images/body-background.png new file mode 100644 index 0000000..d6a152f Binary files /dev/null and b/images/body-background.png differ diff --git a/images/bullet.png b/images/bullet.png new file mode 100644 index 0000000..2b7dc9a Binary files /dev/null and b/images/bullet.png differ diff --git a/images/hr.gif b/images/hr.gif new file mode 100644 index 0000000..a64b56c Binary files /dev/null and b/images/hr.gif differ diff --git a/images/octocat-logo.png b/images/octocat-logo.png new file mode 100644 index 0000000..28a3ad1 Binary files /dev/null and b/images/octocat-logo.png differ diff --git a/index.html b/index.html index 314d9c6..ede9068 100644 --- a/index.html +++ b/index.html @@ -4,38 +4,47 @@ 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. Compatible with PHP 5.3+. Inspired by underscore.string.js.

-

Build Status -Total Downloads -Latest Stable Version

+

Build Status

  • Requiring/Loading
  • @@ -79,13 +88,13 @@
  • safeTruncate
  • shuffle
  • slugify
  • -
  • standardize
  • startsWith
  • substr
  • surround
  • swapCase
  • tidy
  • titleize
  • +
  • toAscii
  • toSpaces
  • toTabs
  • trim
  • @@ -152,7 +161,7 @@ public, and can be accessed directly if required, ie: S::create('foo')-> 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. Furthermore, all methods that return an object of type Stringy return a new object, and do not modify the original.

    +method in Stringy\StaticStringy. For all others, they're found in Stringy\Stringy. Furthermore, all methods that return a Stringy object or string do not modify the original.

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

    @@ -163,7 +172,7 @@ method in Stringy\StaticStringy. For all others, they're found in Stringy\String

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

    -

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

    +

    Returns the character of the string at $index, with indexes starting at 0.

    S::create('fòô bàř', 'UTF-8')->at(6);
     S::at('fòô bàř', 6, 'UTF-8');  // 'ř'
    @@ -176,9 +185,9 @@ method in Stringy\StaticStringy. For all others, they're found in Stringy\String
     
     

    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.

    +

    Returns a camelCase version of the supplied string. 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'
    @@ -192,7 +201,7 @@ dashes and underscores, and removes spaces, dashes, underscores.

    S::collapseWhitespace(string $str)

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

    +single space. This includes tabs and newline characters.

    S::create('   Ο     συγγραφέας  ')->collapseWhitespace();
     S::collapseWhitespace('   Ο     συγγραφέας  ');  // 'Ο συγγραφέας'
    @@ -205,7 +214,7 @@ single space. This inclues tabs and newline characters.

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

    -

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

    +

    Returns true if the string contains $needle, false otherwise.

    S::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφέας');
     S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8');  // true
    @@ -218,7 +227,7 @@ single space. This inclues tabs and newline characters.

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

    -

    Returns the number of occurences of $substring in $str. An alias for +

    Returns the number of occurrences of $substring in the given string. An alias for mb_substr_count()

    S::create('Ο συγγραφέας είπε', 'UTF-8')->count('α');
    @@ -228,13 +237,13 @@ mb_substr_count()

    create

    -

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

    +

    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.

    +mb_internal_encoding(). It then returns the initialized object.

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

    @@ -244,10 +253,9 @@ mb_internal_encoding(). It then returns the instantiated object.

    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.

    +

    Returns a lowercase and trimmed string separated by dashes. 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'
    @@ -260,9 +268,9 @@ of spaces as well as underscores.

    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.

    +

    Returns true if the string 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
    @@ -275,7 +283,7 @@ by setting $caseSensitive to false.

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

    -

    Ensures that $str begins with $substring.

    +

    Ensures that the string begins with $substring. If it doesn't, it's prepended.

    S::create('foobar')->ensureLeft('http://');
     S::ensureLeft('foobar', 'http://');  // 'http://foobar'
    @@ -288,7 +296,7 @@ by setting $caseSensitive to false.

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

    -

    Ensures that $str ends with $substring.

    +

    Ensures that the string begins with $substring. If it doesn't, it's appended.

    S::create('foobar')->ensureRight('.com');
     S::ensureRight('foobar', '.com');  // 'foobar.com'
    @@ -301,7 +309,7 @@ by setting $caseSensitive to false.

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

    -

    Gets the first $n characters of $str.

    +

    Returns the first $n characters of the string.

    S::create('fòô bàř', 'UTF-8')->first(3);
     S::first('fòô bàř', 3, 'UTF-8');  // 'fòô'
    @@ -314,8 +322,8 @@ by setting $caseSensitive to false.

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

    -

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

    +

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

    S::create('author_id')->humanize();
     S::humanize('author_id');  // 'Author'
    @@ -328,7 +336,7 @@ and strips '_id'.

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

    -

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

    +

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

    S::create('fòô bà', 'UTF-8')->insert('ř', 6);
     S::insert('fòô bà', 'ř', 6, 'UTF-8');  // 'fòô bàř'
    @@ -341,7 +349,7 @@ and strips '_id'.

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

    -

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

    +

    Returns true if the string contains only alphabetic chars, false otherwise.

    S::create('丹尼爾', 'UTF-8')->isAlpha();
     S::isAlpha('丹尼爾', 'UTF-8');  // true
    @@ -354,7 +362,7 @@ and strips '_id'.

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

    -

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

    Returns true if the string contains only alphabetic and numeric chars, false otherwise.

    S::create('دانيال1', 'UTF-8')->isAlphanumeric();
    @@ -368,7 +376,7 @@ otherwise.

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

    -

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

    +

    Returns true if the string contains only whitespace chars, false otherwise.

    S::create("\n\t  \v\f")->isBlank();
     S::isBlank("\n\t  \v\f");  // true
    @@ -381,7 +389,7 @@ otherwise.

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

    -

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

    +

    Returns true if the string contains only lower case chars, false otherwise.

    S::create('fòô bàř', 'UTF-8')->isLowerCase();
     S::isLowerCase('fòô bàř', 'UTF-8');  // true
    @@ -394,7 +402,7 @@ otherwise.

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

    -

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

    +

    Returns true if the string contains only upper case chars, false otherwise.

    S::create('FÒÔBÀŘ',, 'UTF-8')->isUpperCase();
     S::isUpperCase('FÒÔBÀŘ',, 'UTF-8');  // true
    @@ -407,7 +415,7 @@ otherwise.

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

    -

    Gets the last $n characters of $str.

    +

    Returns the last $n characters of the string.

    S::create('fòô bàř', 'UTF-8')->last(3);
     S::last('fòô bàř', 3, 'UTF-8');  // 'bàř'
    @@ -420,7 +428,7 @@ otherwise.

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

    -

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

    +

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

    S::create('fòô bàř', 'UTF-8')->length();
     S::length('fòô bàř', 'UTF-8');  // 7
    @@ -433,7 +441,7 @@ otherwise.

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

    -

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

    +

    Returns the longest common prefix between the string and $otherStr.

    S::create('fòô bar', 'UTF-8')->longestCommonPrefix('fòr bar');
     S::longestCommonPrefix('fòô bar', 'fòr bar', 'UTF-8');  // 'fò'
    @@ -446,7 +454,7 @@ otherwise.

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

    -

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

    +

    Returns the longest common suffix between the string and $otherStr.

    S::create('fòô bàř', 'UTF-8')->longestCommonSuffix('fòr bàř');
     S::longestCommonSuffix('fòô bàř', 'fòr bàř', 'UTF-8');  // ' bàř'
    @@ -459,8 +467,8 @@ otherwise.

    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.

    +

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

    S::create('foo bar')->longestCommonSubstring('boo far');
     S::longestCommonSubstring('foo bar', 'boo far');  // 'oo '
    @@ -473,8 +481,7 @@ case of ties, returns that which occurs first.

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

    -

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

    +

    Converts the first character of the supplied string to lower case.

    S::create('Σ test', 'UTF-8')->lowerCaseFirst();
     S::lowerCaseFirst('Σ test', 'UTF-8');  // 'σ test'
    @@ -487,11 +494,11 @@ support for multibyte strings.

    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.

    +

    Pads the string to a given length with $padStr. If length is less than +or equal to the length of the string, 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 InvalidArgumentException 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àř'
    @@ -505,7 +512,7 @@ isn't one of those 3 values.

    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)

    +string are padded. Alias for pad() with a $padType of 'both'.

    S::create('foo bar')->padBoth(9, ' ');
     S::padBoth('foo bar', 9, ' ');  // ' foo bar '
    @@ -519,7 +526,7 @@ string are padded. Alias for pad($str, $length, $padStr, 'both', $encoding)

    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)

    +string is padded. Alias for pad() with a $padType of 'left'.

    S::create($str, $encoding)->padLeft($length, $padStr);
     S::padLeft('foo bar', 9, ' ');  // '  foo bar'
    @@ -533,7 +540,7 @@ string is padded. Alias for pad($str, $length, $padStr, 'left', $encoding)

    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)

    +padded. Alias for pad() with a $padType of 'right'.

    S::create('foo bar')->padRight(10, '_*');
     S::padRight('foo bar', 10, '_*');  // 'foo bar_*_'
    @@ -546,7 +553,7 @@ padded. Alias for pad($str, $length, $padStr, 'right', $encoding)

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

    -

    Removes the prefix $substring if present.

    +

    Returns a new string with the prefix $substring removed, if it was present.

    S::create('fòô bàř', 'UTF-8')->removeLeft('fòô ');
     S::removeLeft('fòô bàř', 'fòô ', 'UTF-8');  // 'bàř'
    @@ -559,7 +566,7 @@ padded. Alias for pad($str, $length, $padStr, 'right', $encoding)

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

    -

    Removes the suffix $substring if present.

    +

    Returns a new string with the suffix $substring removed, if it was present.

    S::create('fòô bàř', 'UTF-8')->removeRight(' bàř');
     S::removeRight('fòô bàř', ' bàř', 'UTF-8');  // 'fòô'
    @@ -572,7 +579,7 @@ padded. Alias for pad($str, $length, $padStr, 'right', $encoding)

    S::replace(string $str, string $search, string $replace [, string $encoding ])

    -

    Replaces all occurrences of $search with $replace in $str.

    +

    Returns a string with all occurrences of $search replaced with $replace.

    S::create('fòô bàř fòô bàř', 'UTF-8')->replace('fòô ', '');
     S::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8');  // 'bàř bàř'
    @@ -585,7 +592,7 @@ padded. Alias for pad($str, $length, $padStr, 'right', $encoding)

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

    -

    Reverses a string. A multibyte version of strrev.

    +

    Returns a reversed string. A multibyte version of strrev().

    S::create('fòô bàř', 'UTF-8')->reverse();
     S::reverse('fòô bàř', 'UTF-8');  // 'řàb ôòf'
    @@ -614,8 +621,7 @@ exceeding the desired length.

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

    -

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

    +

    A multibyte str_shuffle() function. It returns a string with its characters in random order.

    S::create('fòô bàř', 'UTF-8')->shuffle();
     S::shuffle('fòô bàř', 'UTF-8');  // 'àôřb òf'
    @@ -628,28 +634,15 @@ in a string.

    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.

    +

    Converts the string 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

    @@ -657,7 +650,7 @@ dashes. The string is also converted to lowercase.

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

    -

    Returns true if the string $str begins with $substring, false otherwise. +

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

    @@ -672,7 +665,7 @@ by setting $caseSensitive to false.

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

    -

    Gets the substring of $str beginning at $start with the specified $length. +

    Returns the substring 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.

    @@ -700,7 +693,7 @@ null will return the rest of the string, rather than an empty string.

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

    -

    Returns a case swapped version of a string.

    +

    Returns a case swapped version of the string.

    S::create('Ντανιλ', 'UTF-8')->swapCase();
     S::swapCase('Ντανιλ', 'UTF-8');  // 'νΤΑΝΙΛ'
    @@ -713,8 +706,8 @@ null will return the rest of the string, rather than an empty string.

    S::tidy(string $str)

    -

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

    +

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

    S::create('“I see…”')->tidy();
     S::tidy('“I see…”');  // '"I see..."'
    @@ -727,7 +720,7 @@ null will return the rest of the string, rather than an empty string.

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

    -

    Capitalizes the first letter of each word in a string, after trimming. +

    Returns a trimmed string with the first letter of each word capitalized. 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.

    @@ -738,6 +731,20 @@ capitalized.

    // 'I Like to Watch DVDs at Home'
    +

    +toAscii

    + +

    $stringy->toAscii()

    + +

    S::toAscii(string $str)

    + +

    Returns an ASCII version of the string. A set of non-ASCII characters are +replaced with their closest ASCII counterparts, and the rest are removed.

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

    toSpaces

    @@ -745,7 +752,7 @@ capitalized.

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

    -

    Converts each tab in a string to some number of spaces, as defined by +

    Converts each tab in the 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();
    @@ -759,7 +766,7 @@ $tabLength. By default, each tab is converted to 4 consecutive spaces.

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

    -

    Converts each occurence of some consecutive number of spaces, as defined +

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

    @@ -774,7 +781,7 @@ converted to a tab.

    S::trim(string $str)

    -

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

    +

    Returns the trimmed string. An alias for PHP's trim() function.

    S::create('fòô bàř', 'UTF-8')->trim();
     S::trim(' fòô bàř ');  // 'fòô bàř'
    @@ -787,7 +794,7 @@ converted to a tab.

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

    -

    Truncates $str to a given length. If $substring is provided, and +

    Truncates the string 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.

    @@ -802,10 +809,9 @@ may be appended without exceeding the desired length.

    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.

    +

    Returns a lowercase and trimmed string separated by underscores. +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'
    @@ -818,9 +824,9 @@ of spaces as well as dashes.

    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.

    +

    Returns an UpperCamelCase version of the supplied string. It 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'
    @@ -833,8 +839,7 @@ spaces, dashes and underscores, and removes spaces, dashes, underscores.

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

    -

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

    +

    Converts the first character of the supplied string to upper case.

    S::create('σ test', 'UTF-8')->upperCaseFirst();
     S::upperCaseFirst('σ test', 'UTF-8');  // 'Σ test'
    @@ -851,11 +856,11 @@ support for multibyte strings.

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

- + \ No newline at end of file diff --git a/javascripts/main.js b/javascripts/main.js new file mode 100644 index 0000000..c57e54c --- /dev/null +++ b/javascripts/main.js @@ -0,0 +1,53 @@ +var sectionHeight = function() { + var total = $(window).height(), + $section = $('section').css('height','auto'); + + if ($section.outerHeight(true) < total) { + var margin = $section.outerHeight(true) - $section.height(); + $section.height(total - margin - 20); + } else { + $section.css('height','auto'); + } +} + +$(window).resize(sectionHeight); + +$(document).ready(function(){ + $("section h1, section h2").each(function(){ + $("nav ul").append("
  • " + $(this).text() + "
  • "); + $(this).attr("id",$(this).text().toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g,'')); + $("nav ul li:first-child a").parent().addClass("active"); + }); + + $("nav ul li").on("click", "a", function(event) { + var position = $($(this).attr("href")).offset().top - 190; + $("html, body").animate({scrollTop: position}, 400); + $("nav ul li a").parent().removeClass("active"); + $(this).parent().addClass("active"); + event.preventDefault(); + }); + + sectionHeight(); + + $('img').load(sectionHeight); +}); + +fixScale = function(doc) { + + var addEvent = 'addEventListener', + type = 'gesturestart', + qsa = 'querySelectorAll', + scales = [1, 1], + meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; + + function fix() { + meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; + doc.removeEventListener(type, fix, true); + } + + if ((meta = meta[meta.length - 1]) && addEvent in doc) { + fix(); + scales = [.25, 1.6]; + doc[addEvent](type, fix, true); + } +}; \ No newline at end of file diff --git a/params.json b/params.json index dc2759f..2c26c9e 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"name":"Stringy","tagline":"A PHP string manipulation library with multibyte support","body":"# Stringy\r\n\r\nA PHP library with a variety of string manipulation functions with multibyte support. Offers both OO method chaining and a procedural-style static wrapper. Compatible with PHP 5.3+. Inspired by underscore.string.js.\r\n\r\n[![Build Status](https://travis-ci.org/danielstjules/Stringy.png)](https://travis-ci.org/danielstjules/Stringy)\r\n[![Total Downloads](https://poser.pugx.org/danielstjules/Stringy/downloads.png)](https://packagist.org/packages/danielstjules/stringy)\r\n[![Latest Stable Version](https://poser.pugx.org/danielstjules/Stringy/v/stable.png)](https://packagist.org/packages/danielstjules/stringy)\r\n\r\n* [Requiring/Loading](#requiringloading)\r\n* [OO and Procedural](#oo-and-procedural)\r\n* [Methods](#methods)\r\n * [at](#at)\r\n * [camelize](#camelize)\r\n * [collapseWhitespace](#collapsewhitespace)\r\n * [contains](#contains)\r\n * [count](#count)\r\n * [create](#create)\r\n * [dasherize](#dasherize)\r\n * [endsWith](#endswith)\r\n * [ensureLeft](#ensureleft)\r\n * [ensureRight](#ensureright)\r\n * [first](#first)\r\n * [humanize](#humanize)\r\n * [insert](#insert)\r\n * [isAlpha](#isalpha)\r\n * [isAlphanumeric](#isalphanumeric)\r\n * [isBlank](#isblank)\r\n * [isLowerCase](#islowercase)\r\n * [isUpperCase](#isuppercase)\r\n * [last](#last)\r\n * [length](#length)\r\n * [longestCommonPrefix](#longestcommonprefix)\r\n * [longestCommonSuffix](#longestcommonsuffix)\r\n * [longestCommonSubstring](#longestcommonsubstring)\r\n * [lowerCaseFirst](#lowercasefirst)\r\n * [pad](#pad)\r\n * [padBoth](#padboth)\r\n * [padLeft](#padleft)\r\n * [padRight](#padright)\r\n * [removeLeft](#removeleft)\r\n * [removeRight](#removeright)\r\n * [replace](#replace)\r\n * [reverse](#reverse)\r\n * [safeTruncate](#safetruncate)\r\n * [shuffle](#shuffle)\r\n * [slugify](#slugify)\r\n * [standardize](#standardize)\r\n * [startsWith](#startswith)\r\n * [substr](#substr)\r\n * [surround](#surround)\r\n * [swapCase](#swapcase)\r\n * [tidy](#tidy)\r\n * [titleize](#titleize)\r\n * [toSpaces](#tospaces)\r\n * [toTabs](#totabs)\r\n * [trim](#trim)\r\n * [truncate](#truncate)\r\n * [underscored](#underscored)\r\n * [upperCamelize](#uppercamelize)\r\n * [upperCaseFirst](#uppercasefirst)\r\n* [Tests](#tests)\r\n* [License](#license)\r\n\r\n## Requiring/Loading\r\n\r\nIf you're using Composer to manage dependencies, you can include the following in your composer.json file:\r\n\r\n \"require\": {\r\n \"danielstjules/stringy\": \"dev-master\"\r\n }\r\n\r\nThen, after running `composer update` or `php composer.phar update`, you can load the class using Composer's autoloading:\r\n\r\n```php\r\nrequire 'vendor/autoload.php';\r\n```\r\n\r\nOtherwise, you can simply require the file directly:\r\n\r\n```php\r\nrequire_once 'path/to/Stringy/src/Stringy/Stringy.php';\r\n// or\r\nrequire_once 'path/to/Stringy/src/Stringy/StaticStringy.php';\r\n```\r\n\r\nAnd in either case, I'd suggest using an alias.\r\n\r\n```php\r\nuse Stringy\\Stringy as S;\r\n// or\r\nuse Stringy\\StaticStringy as S;\r\n```\r\n\r\n## OO and Procedural\r\n\r\nThe library offers both OO method chaining with `Stringy\\Stringy`, as well as\r\nprocedural-style static method calls with `Stringy\\StaticStringy`. An example\r\nof the former is the following:\r\n\r\n```php\r\nuse Stringy\\Stringy as S;\r\necho S::create(\"Fòô Bàř\", 'UTF-8')->collapseWhitespace()->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. Furthermore, all methods that return an object of type Stringy return a new object, and do not modify the original.\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#### count\r\n\r\n$stringy->count(string $substring)\r\n\r\nS::count(string $str, string $substring [, string $encoding ])\r\n\r\nReturns the number of occurences of $substring in $str. An alias for\r\nmb_substr_count()\r\n\r\n```php\r\nS::create('Ο συγγραφέας είπε', 'UTF-8')->count('α');\r\nS::count('Ο συγγραφέας είπε', 'α', 'UTF-8'); // 2\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#### replace\r\n\r\n$stringy->replace(string $search, string $replace)\r\n\r\nS::replace(string $str, string $search, string $replace [, string $encoding ])\r\n\r\nReplaces all occurrences of $search with $replace in $str.\r\n\r\n```php\r\nS::create('fòô bàř fòô bàř', 'UTF-8')->replace('fòô ', '');\r\nS::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8'); // 'bàř bàř'\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## Tests\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 +{"name":"Stringy","tagline":"A PHP string manipulation library with multibyte support","body":"# Stringy\r\n\r\nA PHP library with a variety of string manipulation functions with multibyte support. Offers both OO method chaining and a procedural-style static wrapper. Compatible with PHP 5.3+. Inspired by underscore.string.js.\r\n\r\n[![Build Status](https://travis-ci.org/danielstjules/Stringy.png)](https://travis-ci.org/danielstjules/Stringy)\r\n\r\n* [Requiring/Loading](#requiringloading)\r\n* [OO and Procedural](#oo-and-procedural)\r\n* [Methods](#methods)\r\n * [at](#at)\r\n * [camelize](#camelize)\r\n * [collapseWhitespace](#collapsewhitespace)\r\n * [contains](#contains)\r\n * [count](#count)\r\n * [create](#create)\r\n * [dasherize](#dasherize)\r\n * [endsWith](#endswith)\r\n * [ensureLeft](#ensureleft)\r\n * [ensureRight](#ensureright)\r\n * [first](#first)\r\n * [humanize](#humanize)\r\n * [insert](#insert)\r\n * [isAlpha](#isalpha)\r\n * [isAlphanumeric](#isalphanumeric)\r\n * [isBlank](#isblank)\r\n * [isLowerCase](#islowercase)\r\n * [isUpperCase](#isuppercase)\r\n * [last](#last)\r\n * [length](#length)\r\n * [longestCommonPrefix](#longestcommonprefix)\r\n * [longestCommonSuffix](#longestcommonsuffix)\r\n * [longestCommonSubstring](#longestcommonsubstring)\r\n * [lowerCaseFirst](#lowercasefirst)\r\n * [pad](#pad)\r\n * [padBoth](#padboth)\r\n * [padLeft](#padleft)\r\n * [padRight](#padright)\r\n * [removeLeft](#removeleft)\r\n * [removeRight](#removeright)\r\n * [replace](#replace)\r\n * [reverse](#reverse)\r\n * [safeTruncate](#safetruncate)\r\n * [shuffle](#shuffle)\r\n * [slugify](#slugify)\r\n * [startsWith](#startswith)\r\n * [substr](#substr)\r\n * [surround](#surround)\r\n * [swapCase](#swapcase)\r\n * [tidy](#tidy)\r\n * [titleize](#titleize)\r\n * [toAscii](#toascii)\r\n * [toSpaces](#tospaces)\r\n * [toTabs](#totabs)\r\n * [trim](#trim)\r\n * [truncate](#truncate)\r\n * [underscored](#underscored)\r\n * [upperCamelize](#uppercamelize)\r\n * [upperCaseFirst](#uppercasefirst)\r\n* [Tests](#tests)\r\n* [License](#license)\r\n\r\n## Requiring/Loading\r\n\r\nIf you're using Composer to manage dependencies, you can include the following in your composer.json file:\r\n\r\n \"require\": {\r\n \"danielstjules/stringy\": \"dev-master\"\r\n }\r\n\r\nThen, after running `composer update` or `php composer.phar update`, you can load the class using Composer's autoloading:\r\n\r\n```php\r\nrequire 'vendor/autoload.php';\r\n```\r\n\r\nOtherwise, you can simply require the file directly:\r\n\r\n```php\r\nrequire_once 'path/to/Stringy/src/Stringy/Stringy.php';\r\n// or\r\nrequire_once 'path/to/Stringy/src/Stringy/StaticStringy.php';\r\n```\r\n\r\nAnd in either case, I'd suggest using an alias.\r\n\r\n```php\r\nuse Stringy\\Stringy as S;\r\n// or\r\nuse Stringy\\StaticStringy as S;\r\n```\r\n\r\n## OO and Procedural\r\n\r\nThe library offers both OO method chaining with `Stringy\\Stringy`, as well as\r\nprocedural-style static method calls with `Stringy\\StaticStringy`. An example\r\nof the former is the following:\r\n\r\n```php\r\nuse Stringy\\Stringy as S;\r\necho S::create(\"Fòô Bàř\", 'UTF-8')->collapseWhitespace()->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. Furthermore, all methods that return a Stringy object or string do not modify the original.\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\nReturns the character of the string 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 the supplied string. Trims surrounding\r\nspaces, capitalizes letters following digits, spaces, dashes and\r\nunderscores, 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 includes 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 the string 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#### count\r\n\r\n$stringy->count(string $substring)\r\n\r\nS::count(string $str, string $substring [, string $encoding ])\r\n\r\nReturns the number of occurrences of $substring in the given string. An alias for\r\nmb_substr_count()\r\n\r\n```php\r\nS::create('Ο συγγραφέας είπε', 'UTF-8')->count('α');\r\nS::count('Ο συγγραφέας είπε', 'α', 'UTF-8'); // 2\r\n```\r\n\r\n#### create\r\n\r\nS::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 initialized object.\r\n\r\n```php\r\n$stringy = S::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 separated by dashes. Dashes are\r\ninserted before uppercase characters (with the exception of the first\r\ncharacter of the string), and in place of 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 ends with $substring, false otherwise. By\r\ndefault, the comparison is case-sensitive, but can be made insensitive by\r\nsetting $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 the string begins with $substring. If it doesn't, it's prepended.\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 the string begins with $substring. If it doesn't, it's appended.\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\nReturns the first $n characters of the string.\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 the string, replaces underscores with\r\nspaces, and 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 the string 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 the string 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 the string 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 the string 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 the string 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 the string 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\nReturns the last $n characters of the string.\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 the string. 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\nReturns the longest common prefix between the string 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\nReturns the longest common suffix between the string 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\nReturns the longest common substring between the string and $otherStr. In the\r\ncase of ties, it 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.\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 the string to a given length with $padStr. If length is less than\r\nor equal to the length of the string, no padding takes places. The default\r\nstring used for padding is a space, and the default type (one of 'left',\r\n'right', 'both') is 'right'. Throws an InvalidArgumentException if\r\n$padType isn'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() with a $padType of 'both'.\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() with a $padType of 'left'.\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() with a $padType of 'right'.\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\nReturns a new string with the prefix $substring removed, if it was 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\nReturns a new string with the suffix $substring removed, if it was 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#### replace\r\n\r\n$stringy->replace(string $search, string $replace)\r\n\r\nS::replace(string $str, string $search, string $replace [, string $encoding ])\r\n\r\nReturns a string with all occurrences of $search replaced with $replace.\r\n\r\n```php\r\nS::create('fòô bàř fòô bàř', 'UTF-8')->replace('fòô ', '');\r\nS::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8'); // 'bàř bàř'\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\nReturns a reversed 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 returns a string with its characters in random order.\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 string into an URL slug. This includes replacing non-ASCII\r\ncharacters with their closest ASCII equivalents, removing non-alphanumeric\r\nand non-ASCII characters, and replacing whitespace with dashes. The string\r\nis 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#### 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 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\nReturns the substring 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 the 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\nReturns a string with smart quotes, ellipsis characters, and dashes from\r\nWindows-1252 (commonly used in Word documents) replaced by 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\nReturns a trimmed string with the first letter of each word capitalized.\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#### toAscii\r\n\r\n$stringy->toAscii()\r\n\r\nS::toAscii(string $str)\r\n\r\nReturns an ASCII version of the string. A set of non-ASCII characters are\r\nreplaced with their closest ASCII counterparts, and the rest are removed.\r\n\r\n```php\r\nS::create('fòô bàř')->toAscii();\r\nS::toAscii('fòô bàř'); // 'foo bar'\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 the 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 occurrence 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\nReturns the trimmed string. 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 the string 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 separated by underscores.\r\nUnderscores are inserted before uppercase characters (with the exception\r\nof the first character of the string), and in place of 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 the supplied string. It trims\r\nsurrounding spaces, capitalizes letters following digits, spaces, dashes\r\nand 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.\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## Tests\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/normalize.css b/stylesheets/normalize.css new file mode 100644 index 0000000..bc2ba93 --- /dev/null +++ b/stylesheets/normalize.css @@ -0,0 +1,459 @@ +/* normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */ +/* ============================================================================= + HTML5 display definitions + ========================================================================== */ +/* + * Corrects block display not defined in IE6/7/8/9 & FF3 + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects inline-block display not defined in IE6/7/8/9 & FF3 + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying 'audio' without controls + */ +audio:not([controls]) { + display: none; +} + +/* + * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 + * Known issue: no IE6 support + */ +[hidden] { + display: none; +} + +/* ============================================================================= + Base + ========================================================================== */ +/* + * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units + * http://clagnut.com/blog/348/#c790 + * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom + * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ + */ +html { + font-size: 100%; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 2 */ +} + +/* + * Addresses font-family inconsistency between 'textarea' and other form elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE6/7 + */ +body { + margin: 0; +} + +/* ============================================================================= + Links + ========================================================================== */ +/* + * Addresses outline displayed oddly in Chrome + */ +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers + * people.opera.com/patrickl/experiments/keyboard/test + */ +a:hover, +a:active { + outline: 0; +} + +/* ============================================================================= + Typography + ========================================================================== */ +/* + * Addresses font sizes and margins set differently in IE6/7 + * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE7/8/9, S5, Chrome + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to 'bolder' in FF3+, S4/5, Chrome +*/ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Addresses styling not present in S5, Chrome + */ +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE6/7/8/9 + */ +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE6/7 + */ +p, +pre { + margin: 1em 0; +} + +/* + * Corrects font family set oddly in IE6, S4/5, Chrome + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ +pre, +code, +kbd, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * 1. Addresses CSS quotes not supported in IE6/7 + * 2. Addresses quote property not supported in S4 + */ +/* 1 */ +q { + quotes: none; +} + +/* 2 */ +q:before, +q:after { + content: ''; + content: none; +} + +small { + font-size: 75%; +} + +/* + * Prevents sub and sup affecting line-height in all browsers + * gist.github.com/413930 + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ============================================================================= + Lists + ========================================================================== */ +/* + * Addresses margins set differently in IE6/7 + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE6/7 + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE7 + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ============================================================================= + Embedded content + ========================================================================== */ +/* + * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 + * 2. Improves image quality when scaled in IE7 + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE9 + */ +svg:not(:root) { + overflow: hidden; +} + +/* ============================================================================= + Figures + ========================================================================== */ +/* + * Addresses margin not present in IE6/7/8/9, S5, O11 + */ +figure { + margin: 0; +} + +/* ============================================================================= + Forms + ========================================================================== */ +/* + * Corrects margin displayed oddly in IE6/7 + */ +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE6/7/8/9 + * 2. Corrects text not wrapping in FF3 + * 3. Corrects alignment displayed oddly in IE6/7 + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers + * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome + * 3. Improves appearance and consistency in all browsers + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/* + * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet + */ +button, +input { + line-height: normal; + /* 1 */ +} + +/* + * 1. Improves usability and consistency of cursor style between image-type 'input' and others + * 2. Corrects inability to style clickable 'input' types in iOS + * 3. Removes inner spacing in IE7 without affecting normal text inputs + * Known issue: inner spacing remains in IE6 + */ +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + /* 1 */ + -webkit-appearance: button; + /* 2 */ + *overflow: visible; + /* 3 */ +} + +/* + * Re-set default cursor for disabled elements + */ +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE8/9 + * 2. Removes excess padding in IE8/9 + * 3. Removes excess padding in IE7 + Known issue: excess padding remains in IE6 + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/* + * 1. Addresses appearance set to searchfield in S5, Chrome + * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in S5, Chrome on OS X + */ +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in FF3+ + * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE6/7/8/9 + * 2. Improves readability and alignment in all browsers + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ============================================================================= + Tables + ========================================================================== */ +/* + * Remove most spacing between table cells + */ +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css index c6a6452..62fd970 100644 --- a/stylesheets/pygment_trac.css +++ b/stylesheets/pygment_trac.css @@ -1,69 +1,70 @@ -.highlight { background: #ffffff; } -.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .hll { background-color: #404040 } +.highlight { color: #d0d0d0 } +.highlight .c { color: #999999; 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 } +.highlight .g { color: #d0d0d0 } /* Generic */ +.highlight .k { color: #6ab825; font-weight: normal } /* Keyword */ +.highlight .l { color: #d0d0d0 } /* Literal */ +.highlight .n { color: #d0d0d0 } /* Name */ +.highlight .o { color: #d0d0d0 } /* Operator */ +.highlight .x { color: #d0d0d0 } /* Other */ +.highlight .p { color: #d0d0d0 } /* Punctuation */ +.highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #cd2828; font-weight: normal } /* Comment.Preproc */ +.highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #e50808; font-weight: normal; background-color: #520000 } /* Comment.Special */ +.highlight .gd { color: #d22323 } /* Generic.Deleted */ +.highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #d22323 } /* Generic.Error */ +.highlight .gh { color: #ffffff; font-weight: normal } /* Generic.Heading */ +.highlight .gi { color: #589819 } /* Generic.Inserted */ +.highlight .go { color: #cccccc } /* Generic.Output */ +.highlight .gp { color: #aaaaaa } /* Generic.Prompt */ +.highlight .gs { color: #d0d0d0; font-weight: normal } /* Generic.Strong */ +.highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */ +.highlight .gt { color: #d22323 } /* Generic.Traceback */ +.highlight .kc { color: #6ab825; font-weight: normal } /* Keyword.Constant */ +.highlight .kd { color: #6ab825; font-weight: normal } /* Keyword.Declaration */ +.highlight .kn { color: #6ab825; font-weight: normal } /* Keyword.Namespace */ +.highlight .kp { color: #6ab825 } /* Keyword.Pseudo */ +.highlight .kr { color: #6ab825; font-weight: normal } /* Keyword.Reserved */ +.highlight .kt { color: #6ab825; font-weight: normal } /* Keyword.Type */ +.highlight .ld { color: #d0d0d0 } /* Literal.Date */ +.highlight .m { color: #3677a9 } /* Literal.Number */ +.highlight .s { color: #ff8 } /* Literal.String */ +.highlight .na { color: #bbbbbb } /* Name.Attribute */ +.highlight .nb { color: #24909d } /* Name.Builtin */ +.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */ +.highlight .no { color: #40ffff } /* Name.Constant */ +.highlight .nd { color: #ffa500 } /* Name.Decorator */ +.highlight .ni { color: #d0d0d0 } /* Name.Entity */ +.highlight .ne { color: #bbbbbb } /* Name.Exception */ +.highlight .nf { color: #447fcf } /* Name.Function */ +.highlight .nl { color: #d0d0d0 } /* Name.Label */ +.highlight .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */ +.highlight .nx { color: #d0d0d0 } /* Name.Other */ +.highlight .py { color: #d0d0d0 } /* Name.Property */ +.highlight .nt { color: #6ab825;} /* Name.Tag */ +.highlight .nv { color: #40ffff } /* Name.Variable */ +.highlight .ow { color: #6ab825; font-weight: normal } /* Operator.Word */ +.highlight .w { color: #666666 } /* Text.Whitespace */ +.highlight .mf { color: #3677a9 } /* Literal.Number.Float */ +.highlight .mh { color: #3677a9 } /* Literal.Number.Hex */ +.highlight .mi { color: #3677a9 } /* Literal.Number.Integer */ +.highlight .mo { color: #3677a9 } /* Literal.Number.Oct */ +.highlight .sb { color: #ff8 } /* Literal.String.Backtick */ +.highlight .sc { color: #ff8 } /* Literal.String.Char */ +.highlight .sd { color: #ff8 } /* Literal.String.Doc */ +.highlight .s2 { color: #ff8 } /* Literal.String.Double */ +.highlight .se { color: #ff8 } /* Literal.String.Escape */ +.highlight .sh { color: #ff8 } /* Literal.String.Heredoc */ +.highlight .si { color: #ff8 } /* Literal.String.Interpol */ +.highlight .sx { color: #ffa500 } /* Literal.String.Other */ +.highlight .sr { color: #ff8 } /* Literal.String.Regex */ +.highlight .s1 { color: #ff8 } /* Literal.String.Single */ +.highlight .ss { color: #ff8 } /* Literal.String.Symbol */ +.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #40ffff } /* Name.Variable.Class */ +.highlight .vg { color: #40ffff } /* Name.Variable.Global */ +.highlight .vi { color: #40ffff } /* Name.Variable.Instance */ +.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/stylesheets/styles.css b/stylesheets/styles.css index dacf2e1..980ee2b 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -1,255 +1,1010 @@ -@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); +/* +Leap Day for GitHub Pages +by Matt Graham +*/ +@font-face { + font-family: 'Quattrocento Sans'; + src: url("../fonts/quattrocentosans-bold-webfont.eot"); + src: url("../fonts/quattrocentosans-bold-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/quattrocentosans-bold-webfont.woff") format("woff"), url("../fonts/quattrocentosans-bold-webfont.ttf") format("truetype"), url("../fonts/quattrocentosans-bold-webfont.svg#QuattrocentoSansBold") format("svg"); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'Quattrocento Sans'; + src: url("../fonts/quattrocentosans-bolditalic-webfont.eot"); + src: url("../fonts/quattrocentosans-bolditalic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/quattrocentosans-bolditalic-webfont.woff") format("woff"), url("../fonts/quattrocentosans-bolditalic-webfont.ttf") format("truetype"), url("../fonts/quattrocentosans-bolditalic-webfont.svg#QuattrocentoSansBoldItalic") format("svg"); + font-weight: bold; + font-style: italic; +} + +@font-face { + font-family: 'Quattrocento Sans'; + src: url("../fonts/quattrocentosans-italic-webfont.eot"); + src: url("../fonts/quattrocentosans-italic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/quattrocentosans-italic-webfont.woff") format("woff"), url("../fonts/quattrocentosans-italic-webfont.ttf") format("truetype"), url("../fonts/quattrocentosans-italic-webfont.svg#QuattrocentoSansItalic") format("svg"); + font-weight: normal; + font-style: italic; +} + +@font-face { + font-family: 'Quattrocento Sans'; + src: url("../fonts/quattrocentosans-regular-webfont.eot"); + src: url("../fonts/quattrocentosans-regular-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/quattrocentosans-regular-webfont.woff") format("woff"), url("../fonts/quattrocentosans-regular-webfont.ttf") format("truetype"), url("../fonts/quattrocentosans-regular-webfont.svg#QuattrocentoSansRegular") format("svg"); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Copse'; + src: url("../fonts/copse-regular-webfont.eot"); + src: url("../fonts/copse-regular-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/copse-regular-webfont.woff") format("woff"), url("../fonts/copse-regular-webfont.ttf") format("truetype"), url("../fonts/copse-regular-webfont.svg#CopseRegular") format("svg"); + font-weight: normal; + font-style: normal; +} + +/* normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */ +/* ============================================================================= + HTML5 display definitions + ========================================================================== */ +/* + * Corrects block display not defined in IE6/7/8/9 & FF3 + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects inline-block display not defined in IE6/7/8/9 & FF3 + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying 'audio' without controls + */ +audio:not([controls]) { + display: none; +} + +/* + * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 + * Known issue: no IE6 support + */ +[hidden] { + display: none; +} + +/* ============================================================================= + Base + ========================================================================== */ +/* + * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units + * http://clagnut.com/blog/348/#c790 + * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom + * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ + */ +html { + font-size: 100%; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 2 */ +} + +/* + * Addresses font-family inconsistency between 'textarea' and other form elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE6/7 + */ body { - padding:50px; - font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; - color:#777; - font-weight:300; + margin: 0; } -h1, h2, h3, h4, h5, h6 { - color:#222; - margin:0 0 20px; +/* ============================================================================= + Links + ========================================================================== */ +/* + * Addresses outline displayed oddly in Chrome + */ +a:focus { + outline: thin dotted; } -p, ul, ol, table, pre, dl { - margin:0 0 20px; -} - -h1, h2, h3 { - line-height:1.1; +/* + * Improves readability when focused and also mouse hovered in all browsers + * people.opera.com/patrickl/experiments/keyboard/test + */ +a:hover, +a:active { + outline: 0; } +/* ============================================================================= + Typography + ========================================================================== */ +/* + * Addresses font sizes and margins set differently in IE6/7 + * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 + */ h1 { - font-size:28px; + font-size: 2em; + margin: 0.67em 0; } h2 { - color:#393939; + font-size: 1.5em; + margin: 0.83em 0; } -h3, h4, h5, h6 { - color:#494949; +h3 { + font-size: 1.17em; + margin: 1em 0; } -a { - color:#39c; - font-weight:400; - text-decoration:none; +h4 { + font-size: 1em; + margin: 1.33em 0; } -a small { - font-size:11px; - color:#777; - margin-top:-0.6em; - display:block; +h5 { + font-size: 0.83em; + margin: 1.67em 0; } -.wrapper { - width:860px; - margin:0 auto; +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE7/8/9, S5, Chrome + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to 'bolder' in FF3+, S4/5, Chrome +*/ +b, +strong { + font-weight: bold; } blockquote { - border-left:1px solid #e5e5e5; - margin:0; - padding:0 0 0 20px; - font-style:italic; + margin: 1em 40px; } -code, pre { - font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; - color:#333; - font-size:12px; +/* + * Addresses styling not present in S5, Chrome + */ +dfn { + font-style: italic; } +/* + * Addresses styling not present in IE6/7/8/9 + */ +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE6/7 + */ +p, pre { - padding:8px 15px; - background: #f8f8f8; - border-radius:5px; - border:1px solid #e5e5e5; - overflow-x: auto; + margin: 1em 0; } -table { - width:100%; - border-collapse:collapse; +/* + * Corrects font family set oddly in IE6, S4/5, Chrome + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ +pre, +code, +kbd, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; } -th, td { - text-align:left; - padding:5px 10px; - border-bottom:1px solid #e5e5e5; +/* + * 1. Addresses CSS quotes not supported in IE6/7 + * 2. Addresses quote property not supported in S4 + */ +/* 1 */ +q { + quotes: none; } -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; +/* 2 */ +q:before, +q:after { + content: ''; + content: none; } small { - font-size:11px; + font-size: 75%; +} + +/* + * Prevents sub and sup affecting line-height in all browsers + * gist.github.com/413930 + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ============================================================================= + Lists + ========================================================================== */ +/* + * Addresses margins set differently in IE6/7 + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE6/7 + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE7 + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ============================================================================= + Embedded content + ========================================================================== */ +/* + * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 + * 2. Improves image quality when scaled in IE7 + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE9 + */ +svg:not(:root) { + overflow: hidden; +} + +/* ============================================================================= + Figures + ========================================================================== */ +/* + * Addresses margin not present in IE6/7/8/9, S5, O11 + */ +figure { + margin: 0; +} + +/* ============================================================================= + Forms + ========================================================================== */ +/* + * Corrects margin displayed oddly in IE6/7 + */ +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE6/7/8/9 + * 2. Corrects text not wrapping in FF3 + * 3. Corrects alignment displayed oddly in IE6/7 + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers + * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome + * 3. Improves appearance and consistency in all browsers + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/* + * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet + */ +button, +input { + line-height: normal; + /* 1 */ +} + +/* + * 1. Improves usability and consistency of cursor style between image-type 'input' and others + * 2. Corrects inability to style clickable 'input' types in iOS + * 3. Removes inner spacing in IE7 without affecting normal text inputs + * Known issue: inner spacing remains in IE6 + */ +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + /* 1 */ + -webkit-appearance: button; + /* 2 */ + *overflow: visible; + /* 3 */ +} + +/* + * Re-set default cursor for disabled elements + */ +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE8/9 + * 2. Removes excess padding in IE8/9 + * 3. Removes excess padding in IE7 + Known issue: excess padding remains in IE6 + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/* + * 1. Addresses appearance set to searchfield in S5, Chrome + * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in S5, Chrome on OS X + */ +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in FF3+ + * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE6/7/8/9 + * 2. Improves readability and alignment in all browsers + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ============================================================================= + Tables + ========================================================================== */ +/* + * Remove most spacing between table cells + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +body { + font: 14px/22px "Quattrocento Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #666; + font-weight: 300; + margin: 0px; + padding: 0px 0 20px 0px; + background: url(../images/body-background.png) #eae6d1; +} + +h1, h2, h3, h4, h5, h6 { + color: #333; + margin: 0 0 10px; +} + +p, ul, ol, table, pre, dl { + margin: 0 0 20px; +} + +h1, h2, h3 { + line-height: 1.1; +} + +h1 { + font-size: 28px; +} + +h2 { + font-size: 24px; + color: #393939; +} + +h3, h4, h5, h6 { + color: #666666; +} + +h3 { + font-size: 18px; + line-height: 24px; +} + +a { + color: #3399cc; + font-weight: 400; + text-decoration: none; +} + +a small { + font-size: 11px; + color: #666; + margin-top: -0.6em; + display: block; +} + +ul { + list-style-image: url("../images/bullet.png"); +} + +strong { + font-weight: bold; + color: #333; +} + +.wrapper { + width: 650px; + margin: 0 auto; + position: relative; +} + +section img { + max-width: 100%; +} + +blockquote { + border-left: 1px solid #ffcc00; + margin: 0; + padding: 0 0 0 20px; + font-style: italic; +} + +code { + font-family: "Lucida Sans", Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + font-size: 13px; + color: #efefef; + text-shadow: 0px 1px 0px #000; + margin: 0 4px; + padding: 2px 6px; + background: #333; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} + +pre { + padding: 8px 15px; + background: #333333; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; + border: 1px solid #c7c7c7; + overflow: auto; + overflow-y: hidden; +} +pre code { + margin: 0px; + padding: 0px; +} + +table { + width: 100%; + border-collapse: collapse; +} + +th { + text-align: left; + padding: 5px 10px; + border-bottom: 1px solid #e5e5e5; + color: #444; +} + +td { + text-align: left; + padding: 5px 10px; + border-bottom: 1px solid #e5e5e5; + border-right: 1px solid #ffcc00; +} +td:first-child { + border-left: 1px solid #ffcc00; } hr { - border:0; - background:#e5e5e5; - height:1px; - margin:0 0 20px; + border: 0; + outline: none; + height: 11px; + background: transparent url("../images/hr.gif") center center repeat-x; + margin: 0 0 20px; +} + +dt { + color: #444; + font-weight: 700; +} + +header { + padding: 25px 20px 40px 20px; + margin: 0; + position: fixed; + top: 0; + left: 0; + right: 0; + width: 100%; + text-align: center; + background: url(../images/background.png) #4276b6; + -moz-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + -webkit-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + -o-box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.75); + z-index: 99; + -webkit-font-smoothing: antialiased; + min-height: 76px; +} +header h1 { + font: 40px/48px "Copse", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #f3f3f3; + text-shadow: 0px 2px 0px #235796; + margin: 0px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; +} +header p { + color: #d8d8d8; + text-shadow: rgba(0, 0, 0, 0.2) 0 1px 0; + font-size: 18px; + margin: 0px; +} + +#banner { + z-index: 100; + left: 0; + right: 50%; + height: 50px; + margin-right: -382px; + position: fixed; + top: 115px; + background: #ffcc00; + border: 1px solid #f0b500; + -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -o-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -moz-border-radius: 0px 2px 2px 0px; + -webkit-border-radius: 0px 2px 2px 0px; + -o-border-radius: 0px 2px 2px 0px; + -ms-border-radius: 0px 2px 2px 0px; + -khtml-border-radius: 0px 2px 2px 0px; + border-radius: 0px 2px 2px 0px; + padding-right: 10px; +} +#banner .button { + border: 1px solid #dba500; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffe788), color-stop(100%, #ffce38)); + background: -webkit-linear-gradient(#ffe788, #ffce38); + background: -moz-linear-gradient(#ffe788, #ffce38); + background: -o-linear-gradient(#ffe788, #ffce38); + background: -ms-linear-gradient(#ffe788, #ffce38); + background: linear-gradient(#ffe788, #ffce38); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + -o-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.4), 0px 1px 1px rgba(0, 0, 0, 0.1); + background-color: #FFE788; + margin-left: 5px; + padding: 10px 12px; + margin-top: 6px; + line-height: 14px; + font-size: 14px; + color: #333; + font-weight: bold; + display: inline-block; + text-align: center; +} +#banner .button:hover { + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffe788), color-stop(100%, #ffe788)); + background: -webkit-linear-gradient(#ffe788, #ffe788); + background: -moz-linear-gradient(#ffe788, #ffe788); + background: -o-linear-gradient(#ffe788, #ffe788); + background: -ms-linear-gradient(#ffe788, #ffe788); + background: linear-gradient(#ffe788, #ffe788); + background-color: #ffeca0; +} +#banner .fork { + position: fixed; + left: 50%; + margin-left: -325px; + padding: 10px 12px; + margin-top: 6px; + line-height: 14px; + font-size: 14px; + background-color: #FFE788; +} +#banner .downloads { + float: right; + margin: 0 45px 0 0; +} +#banner .downloads span { + float: left; + line-height: 52px; + font-size: 90%; + color: #9d7f0d; + text-transform: uppercase; + text-shadow: rgba(255, 255, 255, 0.2) 0 1px 0; +} +#banner ul { + list-style: none; + height: 40px; + padding: 0; + float: left; + margin-left: 10px; +} +#banner ul li { + display: inline; +} +#banner ul li a.button { + background-color: #FFE788; +} +#banner #logo { + position: absolute; + height: 36px; + width: 36px; + right: 7px; + top: 7px; + display: block; + background: url(../images/octocat-logo.png); +} + +section { + width: 590px; + padding: 30px 30px 50px 30px; + margin: 20px 0; + margin-top: 190px; + position: relative; + background: #fbfbfb; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; + border: 1px solid #cbcbcb; + -moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + -o-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.09), inset 0px 0px 2px 2px rgba(255, 255, 255, 0.5), inset 0 0 5px 5px rgba(255, 255, 255, 0.4); +} + +small { + font-size: 12px; +} + +nav { + width: 230px; + position: fixed; + top: 220px; + left: 50%; + margin-left: -580px; + text-align: right; +} +nav ul { + list-style: none; + list-style-image: none; + font-size: 14px; + line-height: 24px; +} +nav ul li { + padding: 5px 0px; + line-height: 16px; +} +nav ul li.tag-h1 { + font-size: 1.2em; +} +nav ul li.tag-h1 a { + font-weight: bold; + color: #333; +} +nav ul li.tag-h2 + .tag-h1 { + margin-top: 10px; +} +nav ul a { + color: #666; +} +nav ul a:hover { + color: #999; } footer { - width:270px; - float:left; - position:fixed; - bottom:50px; + width: 180px; + position: fixed; + left: 50%; + margin-left: -530px; + bottom: 20px; + text-align: right; + line-height: 16px; } -@media print, screen and (max-width: 960px) { - +@media print, screen and (max-width: 1060px) { div.wrapper { - width:auto; - margin:0; + width: auto; + margin: 0; } - + + nav { + display: none; + } + header, section, footer { - float:none; - position:static; - width:auto; + float: none; } - - header { - padding-right:320px; + header h1, section h1, footer h1 { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; } - + + #banner { + width: 100%; + } + #banner .downloads { + margin-right: 60px; + } + #banner #logo { + margin-right: 15px; + } + section { - border:1px solid #e5e5e5; - border-width:1px 0; - padding:20px 0; - margin:0 0 20px; + border: 1px solid #e5e5e5; + border-width: 1px 0; + padding: 20px auto; + margin: 190px auto 20px; + max-width: 600px; } - - header a small { - display:inline; - } - - header ul { - position:absolute; - right:50px; - top:52px; + + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; } } - @media print, screen and (max-width: 720px) { body { - word-wrap:break-word; + word-wrap: break-word; } - + header { - padding:0; + padding: 20px 20px; + margin: 0; } - + header h1 { + font-size: 32px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + } + header p { + display: none; + } + + #banner { + top: 80px; + } + #banner .fork { + float: left; + display: inline-block; + margin-left: 0px; + position: fixed; + left: 20px; + } + + section { + margin-top: 130px; + margin-bottom: 0px; + width: auto; + } + header ul, header p.view { - position:static; - } - - pre, code { - word-wrap:normal; + position: static; } } - @media print, screen and (max-width: 480px) { - body { - padding:15px; + header { + position: relative; + padding: 5px 0px; + min-height: 0px; } - + header h1 { + font-size: 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + } + + section { + margin-top: 5px; + } + + #banner { + display: none; + } + header ul { - display:none; + display: none; } } - @media print { body { - padding:0.4in; - font-size:12pt; - color:#444; + padding: 0.4in; + font-size: 12pt; + color: #444; + } +} +@media print, screen and (max-height: 680px) { + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; + } +} +@media print, screen and (max-height: 480px) { + nav { + display: none; + } + + footer { + text-align: center; + margin: 20px auto; + position: relative; + left: auto; + bottom: auto; + width: auto; } }