Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mk/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*.rs)

# Rustdoc, the documentation tool
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
RUSTDOC_INPUTS := $(wildcard $(addprefix $(S)src/librustdoc/, \
*.rs */*.rs */*/*.rs))

# Rusti, the JIT REPL
RUSTI_LIB := $(S)src/librusti/rusti.rs
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>(

<link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400'
rel='stylesheet' type='text/css'>
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}main.css\">
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}{crate}/main.css\">

{favicon, select, none{} other{
<link rel=\"icon\" href=\"#\" sizes=\"16x16\"
Expand All @@ -52,7 +52,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>(

<section class=\"sidebar\">
{logo, select, none{} other{
<a href='{root_path}index.html'><img src='#' alt=''/></a>
<a href='{root_path}{crate}/index.html'><img src='#' alt=''/></a>
}}

{sidebar}
Expand All @@ -73,9 +73,9 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
<script>
var rootPath = \"{root_path}\";
</script>
<script src=\"{root_path}jquery.js\"></script>
<script src=\"{root_path}{crate}/jquery.js\"></script>
<script src=\"{root_path}{crate}/search-index.js\"></script>
<script src=\"{root_path}main.js\"></script>
<script src=\"{root_path}{crate}/main.js\"></script>

<div id=\"help\" class=\"hidden\">
<div class=\"shortcuts\">
Expand Down
19 changes: 7 additions & 12 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,15 @@ pub fn run(mut crate: clean::Crate, dst: Path) {
crate = cache.fold_crate(crate);

// Add all the static files
write(cx.dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js"));
write(cx.dst.push("main.js"), include_str!("static/main.js"));
write(cx.dst.push("main.css"), include_str!("static/main.css"));
write(cx.dst.push("normalize.css"), include_str!("static/normalize.css"));
write(cx.dst.push("index.html"), format!("
<DOCTYPE html><html><head>
<meta http-equiv='refresh'
content=\"0; url={}/index.html\">
</head><body></body></html>
", crate.name));
let dst = cx.dst.push(crate.name);
mkdir(&dst);
write(dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js"));
write(dst.push("main.js"), include_str!("static/main.js"));
write(dst.push("main.css"), include_str!("static/main.css"));
write(dst.push("normalize.css"), include_str!("static/normalize.css"));

{
mkdir(&cx.dst.push(crate.name));
let dst = cx.dst.push(crate.name).push("search-index.js");
let dst = dst.push("search-index.js");
let mut w = BufferedWriter::new(dst.open_writer(io::CreateOrTruncate));
let w = &mut w as &mut io::Writer;
write!(w, "var searchIndex = [");
Expand Down