Current section

86 Versions

Jump to

Compare versions

19 files changed
+428 additions
-232 deletions
  @@ -172,6 +172,10 @@ Floki.find(html, ".headline")
172 172 # => "Floki"
173 173 ```
174 174
175 + ## References
176 +
177 + - https://www.w3.org/community/webed/wiki/CSS/Selectors
178 +
175 179 ## License
176 180
177 181 Floki is under MIT license. Check the `LICENSE` file for more details.
  @@ -2,13 +2,16 @@
2 2 {<<"build_tools">>,[<<"mix">>]}.
3 3 {<<"description">>,
4 4 <<"Floki is a simple HTML parser that enables search for nodes using CSS selectors.">>}.
5 - {<<"elixir">>,<<">= 1.1.0">>}.
5 + {<<"elixir">>,<<">= 1.2.0">>}.
6 6 {<<"files">>,
7 7 [<<"lib/floki.ex">>,<<"lib/floki/attribute_selector.ex">>,
8 8 <<"lib/floki/combinator.ex">>,<<"lib/floki/deep_text.ex">>,
9 9 <<"lib/floki/filter_out.ex">>,<<"lib/floki/finder.ex">>,
10 - <<"lib/floki/flat_text.ex">>,<<"lib/floki/parser.ex">>,
11 - <<"lib/floki/selector.ex">>,<<"lib/floki/selector_parser.ex">>,
10 + <<"lib/floki/flat_text.ex">>,<<"lib/floki/html_tree.ex">>,
11 + <<"lib/floki/html_tree/html_node.ex">>,
12 + <<"lib/floki/html_tree/id_seeder.ex">>,<<"lib/floki/html_tree/text.ex">>,
13 + <<"lib/floki/parser.ex">>,<<"lib/floki/selector.ex">>,
14 + <<"lib/floki/selector/pseudo_class.ex">>,<<"lib/floki/selector_parser.ex">>,
12 15 <<"lib/floki/selector_tokenizer.ex">>,<<"src/floki_selector_lexer.xrl">>,
13 16 <<"mix.exs">>,<<"README.md">>,<<"LICENSE">>]}.
14 17 {<<"licenses">>,[<<"MIT">>]}.
  @@ -22,4 +25,4 @@
22 25 {<<"name">>,<<"mochiweb">>},
23 26 {<<"optional">>,false},
24 27 {<<"requirement">>,<<"~> 2.15">>}]]}.
25 - {<<"version">>,<<"0.11.0">>}.
28 + {<<"version">>,<<"0.12.0">>}.
  @@ -1,7 +1,5 @@
1 1 defmodule Floki do
2 - alias Floki.Finder
3 - alias Floki.Parser
4 - alias Floki.FilterOut
2 + alias Floki.{Finder, Parser, FilterOut}
5 3
6 4 @moduledoc """
7 5 Floki is a simple HTML parser that enables search for nodes using CSS selectors.
  @@ -1,16 +1,14 @@
1 1 defmodule Floki.AttributeSelector do
2 - @moduledoc """
3 - It is very similar to the `Selector` module, but is specialized in attributes
4 - and attribute selectors.
5 - """
2 + @moduledoc false
3 +
4 + # It is very similar to the `Selector` module, but is specialized in attributes
5 + # and attribute selectors.
6 6
7 7 alias Floki.AttributeSelector
8 8
9 9 defstruct match_type: nil, attribute: nil, value: nil
10 10
11 - @doc """
12 - Returns if attributes of a node matches with a given attribute selector.
13 - """
11 + # Returns if attributes of a node matches with a given attribute selector.
14 12 def match?(attributes, s = %AttributeSelector{match_type: nil, value: nil}) do
15 13 attribute_present?(s.attribute, attributes)
16 14 end
  @@ -1,19 +1,18 @@
1 1 defmodule Floki.Combinator do
2 - @moduledoc """
3 - Represents the conjunction of a combinator with its selector.
2 + @moduledoc false
4 3
5 - Combinators can have the following match types:
6 -
7 - - descendant;
8 - e.g.: "a b"
9 - - child;
10 - e.g.: "a > b"
11 - - adjacent sibling;
12 - e.g.: "a + b"
13 - - general sibling;
14 - e.g.: "a ~ b"
15 -
16 - """
4 + # Represents the conjunction of a combinator with its selector.
5 + #
6 + # Combinators can have the following match types:
7 + #
8 + # - descendant;
9 + # e.g.: "a b"
10 + # - child;
11 + # e.g.: "a > b"
12 + # - adjacent sibling;
13 + # e.g.: "a + b"
14 + # - general sibling;
15 + # e.g.: "a ~ b"
17 16
18 17 defstruct match_type: nil, selector: nil
19 18 end
Loading more files…