Skip to content

Commit 5a16ceb

Browse files
committed
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.
1 parent 170c439 commit 5a16ceb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/doc/rust.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ h5 a:hover {text-decoration: none;}
195195

196196
pre, code {
197197
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
198+
word-wrap: break-word;
198199
}
199200
pre {
200201
border-left: 2px solid #eee;
@@ -204,7 +205,6 @@ pre {
204205
margin: 20px 0;
205206
font-size: 13px;
206207
word-break: break-all;
207-
word-wrap: break-word;
208208
}
209209
code {
210210
padding: 0 2px;
@@ -315,6 +315,8 @@ hr {
315315
table {
316316
border-collapse: collapse;
317317
border-spacing: 0;
318+
overflow-x: auto;
319+
display: block;
318320
}
319321

320322
table tr.odd {

src/librustdoc/markdown.rs

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches,
9191
<html lang="en">
9292
<head>
9393
<meta charset="utf-8">
94+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9495
<meta name="generator" content="rustdoc">
9596
<title>{title}</title>
9697

0 commit comments

Comments
 (0)