1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
24 pub root_path: &'a str,
27 pub fn render<T: fmt::Show, S: fmt::Show>(
28 dst: &mut io::Writer, layout: &Layout, page: &Page, sidebar: &S, t: &T)
35 <meta charset="utf-8">
36 <meta name="viewport" content="width=device-width, initial-scale=1.0">
37 <meta name="description" content="The {krate} library documentation.">
39 <title>{title}</title>
41 <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'
42 rel='stylesheet' type='text/css'>
43 <link rel="stylesheet" type="text/css" href="{root_path}main.css">
45 {favicon, select, none{} other{<link rel="shortcut icon" href="#" />}}
50 This old browser is unsupported and will most likely display funky
55 <section class="sidebar">
56 {logo, select, none{} other{
57 <a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100'></a>
64 <form class="search-form js-only">
65 <div class="search-container">
66 <input class="search-input" name="search"
68 placeholder="Search documentation..."
74 <section id='main' class="content {ty}">{content}</section>
75 <section id='search' class="content hidden"></section>
77 <section class="footer"></section>
79 <div id="help" class="hidden">
80 <div class="shortcuts">
81 <h1>Keyboard shortcuts</h1>
84 <dd>Show this help dialog</dd>
86 <dd>Focus the search field</dd>
88 <dd>Move up in search results</dd>
90 <dd>Move down in search results</dd>
92 <dd>Go to active search result</dd>
96 <h1>Search tricks</h1>
98 Prefix searches with a type followed by a colon (e.g.
99 <code>fn:</code>) to restrict the search to a given type.
102 Accepted types are: <code>fn</code>, <code>mod</code>,
103 <code>struct</code> (or <code>str</code>), <code>enum</code>,
104 <code>trait</code>, <code>typedef</code> (or
111 var rootPath = "{root_path}";
112 var currentCrate = "{krate}";
114 <script src="{root_path}jquery.js"></script>
115 <script src="{root_path}main.js"></script>
116 <script async src="{root_path}search-index.js"></script>
120 root_path = page.root_path,
122 logo = nonestr(layout.logo),
124 favicon = nonestr(layout.favicon),
126 krate = layout.krate,
130 fn nonestr<'a>(s: &'a str) -> &'a str {
131 if s == "" { "none" } else { s }