File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
components_guide_web/lib/components_guide_web/controllers
components_guide/lib/components_guide/research Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,16 @@ defmodule ComponentsGuide.Research.Spec do
4646 |> Floki . raw_html ( )
4747 end
4848
49+ def search_for ( :wai_aria_practices , query ) when is_binary ( query ) do
50+ url = "https://www.w3.org/TR/wai-aria-practices/"
51+ { :ok , document } = Source . html_document_at ( url )
52+
53+ document
54+ |> Floki . find ( "#toc li a" )
55+ # |> Floki.find("#id-#{query}")
56+ |> Floki . raw_html ( )
57+ end
58+
4959 def search_for ( :bundlephobia , query ) when is_binary ( query ) do
5060 { :ok , data } = Source . json_at ( "https://bundlephobia.com/api/size?package=#{ query } " )
5161
Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ defmodule ComponentsGuideWeb.ResearchController do
5151 h2 ( "HTML spec" ) ,
5252 Spec . search_for ( :whatwg_html_spec , query ) |> present_results ( )
5353 ] ) ,
54+ content_tag ( :article , [
55+ h2 ( "ARIA Practices" ) ,
56+ Spec . search_for ( :wai_aria_practices , query ) |> present_results ( )
57+ ] ) ,
5458 content_tag ( :article , [
5559 h2 ( "HTML ARIA" ) ,
5660 Spec . search_for ( :html_aria_spec , query ) |> present_results ( )
You can’t perform that action at this time.
0 commit comments