+ atward is TVL's search
+ service. It can be configured as a browser search engine for easy
+ access to TVL bugs, code reviews, code paths and more.
+
+
+
Setting up atward
+
+ To configure atward, add a search engine to your browser with the
+ following search string:
+
https://at.tvl.fyi/?q=%s
+ Consider setting a shortcut, for example t or tvl.
+ You can now quickly access TVL resources by typing something
+ like t b/42 in your URL bar to get to the bug with ID
+ 42.
+
+
+
Supported queries
+
+ The following query types are supported in atward:
+
+
b/42 - access bugs with ID 42
+
cl/3087 - access changelist with ID 3087
+
//web/atward - open the //web/atward path in TVLs monorepo
+
+
+
+
Configuration
+
+ Some behaviour of atward can be configured by adding query
+ parameters to the search string:
+
+
cs=true - use Sourcegraph instead of cgit to view code
+
+
+
+ In Firefox, configuring query parameters is difficult as
+ users can not edit search engines directly. There are browser
+ extensions and other workarounds for this issue, but we do not
+ recommend any particular one.
+
+
+
+
+
diff --git a/web/atward/src/main.rs b/web/atward/src/main.rs
index 49e23dde7..44ab4d29c 100644
--- a/web/atward/src/main.rs
+++ b/web/atward/src/main.rs
@@ -113,6 +113,14 @@ fn dispatch(handlers: &[Handler], query: &Query) -> Option {
None
}
+/// Render the atward index page which gives users some information
+/// about how to use the service.
+fn index() -> Response {
+ Response::html(include_str!("index.html"))
+}
+
+/// Render the fallback page which informs users that their query is
+/// unsupported.
fn fallback() -> Response {
Response::text("error for emphasis that i am angery and the query whimchst i angery atward")
.with_status_code(404)
@@ -127,7 +135,7 @@ fn main() {
rouille::log(&request, std::io::stderr(), || {
let query = match Query::from_request(&request) {
Some(q) => q,
- None => return fallback(),
+ None => return index(),
};
match dispatch(&queries, &query) {