Packages
floki
0.12.0
0.38.4
0.38.3
0.38.2
0.38.1
0.38.0
0.37.1
0.37.0
0.36.3
0.36.2
0.36.1
0.36.0
0.35.4
0.35.3
0.35.2
0.35.1
0.35.0
0.34.3
0.34.2
0.34.1
0.34.0
0.33.1
0.33.0
0.32.1
0.32.0
0.31.0
0.30.1
0.30.0
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.1
0.23.0
0.22.0
0.21.0
0.20.4
0.20.3
0.20.2
0.20.1
0.20.0
0.19.3
0.19.2
0.19.1
0.19.0
0.18.1
0.18.0
0.17.2
0.17.1
0.17.0
0.16.0
0.15.0
0.14.0
0.13.2
0.13.1
0.13.0
0.12.1
0.12.0
0.11.0
0.10.1
0.10.0
0.9.0
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.0
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Floki is a simple HTML parser that enables search for nodes using CSS selectors.
Current section
86 Versions
Jump to
Current section
86 Versions
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…