]> git.lizzy.rs Git - rust.git/blobdiff - src/doc/index.md
Rollup merge of #54281 - GuillaumeGomez:search-box, r=QuietMisdreavus
[rust.git] / src / doc / index.md
index 11313ba99e1a6ea8398908ba514b96db585f8897..33ee76739c5b2c0ea7f0a55691fbcf7e3682971a 100644 (file)
@@ -4,6 +4,23 @@
 nav {
     display: none;
 }
+#search-input {
+    width: calc(100% - 58px);
+}
+#search-but {
+    cursor: pointer;
+}
+#search-but, #search-input {
+    padding: 4px;
+    border: 1px solid #ccc;
+    border-radius: 3px;
+    outline: none;
+    font-size: 0.7em;
+    background-color: #fff;
+}
+#search-but:hover, #search-input:focus {
+    border-color: #55a9ff;
+}
 </style>
 
 Welcome to an overview of the documentation provided by the Rust project.
@@ -43,6 +60,14 @@ Rust's standard library has [extensive API documentation](std/index.html),
 with explanations of how to use various things, as well as example code for
 accomplishing various tasks.
 
+<div>
+  <form action="std/index.html" method="get">
+    <input id="search-input" type="search" name="search"
+           placeholder="Search through the standard library"/>
+    <button id="search-but">Search</button>
+  </form>
+</div>
+
 ## The Rustc Book
 
 [The Rustc Book](rustc/index.html) describes the Rust compiler, `rustc`.