Skip to content

Commit 4a9cb42

Browse files
committed
Temporarly disable navigation in rustdoc pages
New single line docs did break docs.rs navigation. We need a better way to inject our navigation.
1 parent 86e0aea commit 4a9cb42

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

src/web/rustdoc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct RustdocPage {
2424
pub head: String,
2525
pub body: String,
2626
pub name: String,
27+
pub full: String,
2728
pub version: String,
2829
pub description: Option<String>,
2930
pub crate_details: Option<CrateDetails>,
@@ -36,6 +37,7 @@ impl Default for RustdocPage {
3637
head: String::new(),
3738
body: String::new(),
3839
name: String::new(),
40+
full: String::new(),
3941
version: String::new(),
4042
description: None,
4143
crate_details: None,
@@ -49,6 +51,7 @@ impl ToJson for RustdocPage {
4951
let mut m: BTreeMap<String, Json> = BTreeMap::new();
5052
m.insert("rustdoc_head".to_string(), self.head.to_json());
5153
m.insert("rustdoc_body".to_string(), self.body.to_json());
54+
m.insert("rustdoc_full".to_string(), self.full.to_json());
5255
m.insert("rustdoc_status".to_string(), true.to_json());
5356
m.insert("name".to_string(), self.name.to_json());
5457
m.insert("version".to_string(), self.version.to_json());
@@ -177,6 +180,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
177180
}
178181
}
179182

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

templates/rustdoc.hbs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
{{{content.rustdoc_head}}}
5-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" />
6-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-min.css" type="text/css" media="all" />
7-
<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" />
8-
<link rel="stylesheet" href="/style.css?{{cratesfyi_version_safe}}" type="text/css" media="all" />
9-
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs">
10-
</head>
11-
<body>
12-
{{> navigation_rustdoc}}
13-
<div class="rustdoc container-rustdoc">
14-
{{{content.rustdoc_body}}}
15-
</div>
16-
</body>
17-
</html>
1+
{{{content.rustdoc_full}}}

0 commit comments

Comments
 (0)