File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed
components_guide_web/lib/components_guide_web
components_guide/lib/components_guide/research Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -25,27 +25,24 @@ defmodule ComponentsGuide.Research.Spec do
25
25
end
26
26
27
27
def search_for ( :whatwg_html_spec , query ) when is_binary ( query ) do
28
- IO . puts ( "searching whatwg html spec" )
29
-
30
28
# url = "https://html.spec.whatwg.org/"
31
29
url = "https://html.spec.whatwg.org/dev/"
32
30
33
- # {:ok, html} = body({:fetch, url})
34
- # {:ok, html} = read({:fetch, url})
35
31
{ :ok , document } = Source . html_document_at ( url )
36
32
37
- # IO.puts("document size #{:erts_debug.flat_size(document)}")
38
-
39
- # selector = css("#contents")
40
- # selector = xpath("//*[@id='contents']/following-sibling::ol[1]")
41
- # result = Meeseeks.one(document, selector)
42
- # Meeseeks.html(result)
43
-
44
33
document
45
34
|> Floki . find ( "body" )
46
35
|> Floki . find ( "a:fl-contains('#{ query } ')" )
47
36
|> Floki . raw_html ( )
37
+ end
48
38
49
- # html
39
+ def search_for ( :html_aria_spec , query ) when is_binary ( query ) do
40
+ url = "https://www.w3.org/TR/html-aria/"
41
+ { :ok , document } = Source . html_document_at ( url )
42
+
43
+ document
44
+ |> Floki . find ( "#document-conformance-requirements-for-use-of-aria-attributes-in-html table tbody tr" )
45
+ # |> Floki.find("#id-#{query}")
46
+ |> Floki . raw_html ( )
50
47
end
51
48
end
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ defmodule ComponentsGuideWeb.ResearchController do
46
46
content_tag ( :article , [
47
47
h2 ( "Can I Use" ) ,
48
48
Spec . search_for ( :caniuse , query ) |> present_results ( )
49
+ ] ) ,
50
+ content_tag ( :article , [
51
+ h2 ( "HTML ARIA" ) ,
52
+ Spec . search_for ( :html_aria_spec , query ) |> present_results ( )
49
53
] )
50
54
]
51
55
end
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ defmodule ComponentsGuideWeb.LayoutView do
18
18
~E"""
19
19
<li>
20
20
<form role=search action="/research" class="flex h-full px-2 items-center">
21
- <input type=text name=q placeholder="Search" class="w-full py-1 px-2 bg-white text-black">
21
+ <input type=text name=q placeholder="Search specs " class="w-full py-1 px-2 bg-white text-black">
22
22
</form>
23
23
"""
24
24
end
You can’t perform that action at this time.
0 commit comments