File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,53 @@ Looks like you've taken a wrong turn.
11
11
12
12
Some things that might be helpful to you though:
13
13
14
+ ## Search
15
+ * <form action =" https://duckduckgo.com/ " >
16
+ <input type =" text " id =" site-search " name =" q " size =" 80 " ></input >
17
+ <input type =" submit " value =" Search DuckDuckGo " >
18
+ </form >
19
+ * Rust doc search: <span id =" core-search " ></span >
20
+
14
21
## Reference
15
22
* [ The Rust official site] ( http://rust-lang.org )
16
23
* [ The Rust reference] ( http://doc.rust-lang.org/reference.html ) (* [ PDF] ( http://doc.rust-lang.org/reference.pdf ) )
17
24
18
25
## Docs
19
26
* [ The standard library] ( http://doc.rust-lang.org/std/ )
27
+
28
+ <script >
29
+ function get_url_fragments () {
30
+ var last = document .URL .split (" /" ).pop ();
31
+ var tokens = last .split (" ." );
32
+ var op = [];
33
+ for (var i= 0 ; i < tokens .length ; i++ ) {
34
+ var t = tokens[i];
35
+ if (t == ' html' || t .indexOf (" #" ) != - 1 ) {
36
+ // no html or anchors
37
+ } else {
38
+ op .push (t);
39
+ }
40
+ }
41
+ return op;
42
+ }
43
+
44
+ function populate_site_search () {
45
+ var op = get_url_fragments ();
46
+
47
+ var search = document .getElementById (' site-search' );
48
+ search .value = op .join (' ' ) + " site:doc.rust-lang.org" ;
49
+ }
50
+
51
+ function populate_rust_search () {
52
+ var op = get_url_fragments ();
53
+ var lt = op .pop ();
54
+
55
+ // #18540, use a single token
56
+
57
+ var search = document .getElementById (' core-search' );
58
+ search .innerHTML = " <a href=\" http://doc.rust-lang.org/core/?search=" + lt + " \" >" + lt + " </a>" ;
59
+ }
60
+ populate_site_search ();
61
+ populate_rust_search ();
62
+ </script >
63
+
You can’t perform that action at this time.
0 commit comments