From 5a16ceb291fd1b021efc342e3058c0f1ce534778 Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Tue, 13 Jan 2015 20:15:09 -0800 Subject: [PATCH] Improve Rust Documentation & Reference on mobile - Tables that are too wide for the screen scroll horizontally. - Inline code that would force the page to become wider than the width of the screen is broken in the middle of the word. --- src/doc/rust.css | 4 +++- src/librustdoc/markdown.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/doc/rust.css b/src/doc/rust.css index 128d75468e6..3f59f12e74c 100644 --- a/src/doc/rust.css +++ b/src/doc/rust.css @@ -195,6 +195,7 @@ h5 a:hover {text-decoration: none;} pre, code { font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace; + word-wrap: break-word; } pre { border-left: 2px solid #eee; @@ -204,7 +205,6 @@ pre { margin: 20px 0; font-size: 13px; word-break: break-all; - word-wrap: break-word; } code { padding: 0 2px; @@ -315,6 +315,8 @@ hr { table { border-collapse: collapse; border-spacing: 0; + overflow-x: auto; + display: block; } table tr.odd { diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index ab9c4ef9422..dc98a56eb1a 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -91,6 +91,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches, + {title}