Skip to content

Commit

Permalink
Temporarly disable navigation in rustdoc pages
Browse files Browse the repository at this point in the history
New single line docs did break docs.rs navigation. We need a better way
to inject our navigation.
  • Loading branch information
onur committed Jun 5, 2018
1 parent 86e0aea commit 4a9cb42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
4 changes: 4 additions & 0 deletions src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct RustdocPage {
pub head: String,
pub body: String,
pub name: String,
pub full: String,
pub version: String,
pub description: Option<String>,
pub crate_details: Option<CrateDetails>,
Expand All @@ -36,6 +37,7 @@ impl Default for RustdocPage {
head: String::new(),
body: String::new(),
name: String::new(),
full: String::new(),
version: String::new(),
description: None,
crate_details: None,
Expand All @@ -49,6 +51,7 @@ impl ToJson for RustdocPage {
let mut m: BTreeMap<String, Json> = BTreeMap::new();
m.insert("rustdoc_head".to_string(), self.head.to_json());
m.insert("rustdoc_body".to_string(), self.body.to_json());
m.insert("rustdoc_full".to_string(), self.full.to_json());
m.insert("rustdoc_status".to_string(), true.to_json());
m.insert("name".to_string(), self.name.to_json());
m.insert("version".to_string(), self.version.to_json());
Expand Down Expand Up @@ -177,6 +180,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
}
}

content.full = file_content;
let crate_details = cexpect!(CrateDetails::new(&conn, &name, &version));
let latest_version = latest_version(&crate_details.versions, &version);

Expand Down
18 changes: 1 addition & 17 deletions templates/rustdoc.hbs
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{{content.rustdoc_head}}}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-min.css" type="text/css" media="all" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="/style.css?{{cratesfyi_version_safe}}" type="text/css" media="all" />
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs">
</head>
<body>
{{> navigation_rustdoc}}
<div class="rustdoc container-rustdoc">
{{{content.rustdoc_body}}}
</div>
</body>
</html>
{{{content.rustdoc_full}}}

0 comments on commit 4a9cb42

Please sign in to comment.