Browse files

rearrange README

  • Loading branch information...
1 parent 6ea59f3 commit 49f13e358e37c4de975180e4fc46f7197a3e26c4 @fb55 committed Feb 13, 2014
Showing with 16 additions and 19 deletions.
  1. +16 −19 README.md
View
35 README.md
@@ -8,22 +8,6 @@ CSSselect turns CSS selectors into functions that tests if elements match them.
In its default configuration, CSSselect queries the DOM structure of the [`domhandler`](https://github.com/fb55/domhandler) module.
-##Why?
-
-The common approach of executing CSS selectors (used eg. by [`Sizzle`](https://github.com/jquery/sizzle), [`nwmatcher`](https://github.com/dperini/nwmatcher/) and [`qwery`](https://github.com/ded/qwery)) is to execute every component of the selector in order, from left to right. The selector `a b` for example will first look for `a` elements, then search these for `b` elements.
-
-While this works, it has some downsides: Children of `a`s will be checked multiple times, first, to check if they are also `a`s, then, for every superior `a` once, if they are `b`s. Using [Big O notation](http://en.wikipedia.org/wiki/Big_O_notation), that would be `O(n^2)`.
-
-The far more efficient approach is to first look for `b` elements, then check if they have superior `a` elements: Using big O notation again, that would be `O(n)`.
-
-And that's exactly what CSSselect does.
-
-##How?
-
-By stacking functions!
-
-_//TODO: Better explanation. For now, if you're interested, have a look at the source code._
-
##API
```js
@@ -51,10 +35,23 @@ Tests whether or not an element is matched by `query`. `query` can be either a C
Arguments are the same as for `CSSselect(query, elems)`. Only returns the first match, or `null` if there was no match.
----
+##Why?
+
+The common approach of executing CSS selectors (used eg. by [`Sizzle`](https://github.com/jquery/sizzle), [`nwmatcher`](https://github.com/dperini/nwmatcher/) and [`qwery`](https://github.com/ded/qwery)) is to execute every component of the selector in order, from left to right. The selector `a b` for example will first look for `a` elements, then search these for `b` elements.
+
+While this works, it has some downsides: Children of `a`s will be checked multiple times, first, to check if they are also `a`s, then, for every superior `a` once, if they are `b`s. Using [Big O notation](http://en.wikipedia.org/wiki/Big_O_notation), that would be `O(n^2)`.
+
+The far more efficient approach is to first look for `b` elements, then check if they have superior `a` elements: Using big O notation again, that would be `O(n)`.
-License: BSD-like
+And that's exactly what CSSselect does.
+
+##How?
+
+By stacking functions!
+
+_//TODO: Better explanation. For now, if you're interested, have a look at the source code._
-[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/fb55/cssselect/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+---
+License: BSD-like

0 comments on commit 49f13e3

Please sign in to comment.