authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-30 01:06:20-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-01-30 01:06:20-05:00
logd6b7d9090ef8ed4f8672b03c6c7c0c11c3c02316
tree063a3a8ff9dbb1d1f31e76edac7d925bc327a56d
parent7eea20bc50bd769b78dc74ded1257733814e8254
parent5e9f87c3bd968d6186a3bc1ad9c58c919d49ab15
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #729 from zig-lang/www-changes

Improve documentation styling for mobile devices

1 files changed, 40 insertions(+), 4 deletions(-)

doc/langref.html.in+40-4
...@@ -36,25 +36,53 @@...@@ -36,25 +36,53 @@
36 code {36 code {
37 font-size: 12pt;37 font-size: 12pt;
38 }38 }
39 @media screen and (min-width: 28.75em) {39 pre > code {
40 display: block;
41 overflow: auto;
42 }
43 .table-wrapper {
44 width: 100%;
45 overflow-y: auto;
46 }
47 /* Desktop */
48 @media screen and (min-width: 56.25em) {
40 #nav {49 #nav {
41 width: 20em;50 width: 20em;
42 height: 100%;51 height: 100%;
43 overflow-y: scroll;
44 position: fixed;52 position: fixed;
53 overflow-y: scroll;
45 left: 0;54 left: 0;
46 top: 0;55 top: 0;
56 padding-left: 1em;
47 }57 }
48 #contents {58 #contents {
49 max-width: 50em;59 max-width: 60em;
50 padding-left: 22em;60 padding-left: 22em;
61 padding: 1em;
62 padding-left: 24em;
63 }
64 .page-title {
65 /* half-size since h1 */
66 padding-left: 12em;
67 margin-bottom: 2em;
68 }
69 }
70 /* Mobile */
71 @media screen and (max-width: 56.25em) {
72 body, code {
73 font-size: small;
74 }
75 #nav {
76 border-bottom: 1px solid grey;
51 }77 }
52 }78 }
53 </style>79 </style>
54 </head>80 </head>
55 <body>81 <body>
82 <h1 class="page-title">Zig Documentation</h1>
56 <div id="nav">83 <div id="nav">
57 {#nav#}84 <h3>Index</h3>
85 {#nav#}
58 </div>86 </div>
59 <div id="contents">87 <div id="contents">
60 {#header_open|Introduction#}88 {#header_open|Introduction#}
...@@ -173,6 +201,7 @@ pub fn main() %void {...@@ -173,6 +201,7 @@ pub fn main() %void {
173}201}
174 {#code_end#}202 {#code_end#}
175 {#header_open|Primitive Types#}203 {#header_open|Primitive Types#}
204 <div class="table-wrapper">
176 <table>205 <table>
177 <tr>206 <tr>
178 <th>207 <th>
...@@ -398,9 +427,11 @@ pub fn main() %void {...@@ -398,9 +427,11 @@ pub fn main() %void {
398 <td>an error code</td>427 <td>an error code</td>
399 </tr>428 </tr>
400 </table>429 </table>
430 </div>
401 {#see_also|Integers|Floats|void|Errors#}431 {#see_also|Integers|Floats|void|Errors#}
402 {#header_close#}432 {#header_close#}
403 {#header_open|Primitive Values#}433 {#header_open|Primitive Values#}
434 <div class="table-wrapper">
404 <table>435 <table>
405 <tr>436 <tr>
406 <th>437 <th>
...@@ -427,6 +458,7 @@ pub fn main() %void {...@@ -427,6 +458,7 @@ pub fn main() %void {
427 <td>refers to the thing in immediate scope</td>458 <td>refers to the thing in immediate scope</td>
428 </tr>459 </tr>
429 </table>460 </table>
461 </div>
430 {#see_also|Nullables|this#}462 {#see_also|Nullables|this#}
431 {#header_close#}463 {#header_close#}
432 {#header_open|String Literals#}464 {#header_open|String Literals#}
...@@ -451,6 +483,7 @@ test "string literals" {...@@ -451,6 +483,7 @@ test "string literals" {
451 {#code_end#}483 {#code_end#}
452 {#see_also|Arrays|Zig Test#}484 {#see_also|Arrays|Zig Test#}
453 {#header_open|Escape Sequences#}485 {#header_open|Escape Sequences#}
486 <div class="table-wrapper">
454 <table>487 <table>
455 <tr>488 <tr>
456 <th>489 <th>
...@@ -497,6 +530,7 @@ test "string literals" {...@@ -497,6 +530,7 @@ test "string literals" {
497 <td>hexadecimal 24-bit Unicode character code UTF-8 encoded (6 digits)</td>530 <td>hexadecimal 24-bit Unicode character code UTF-8 encoded (6 digits)</td>
498 </tr>531 </tr>
499 </table>532 </table>
533 </div>
500 <p>Note that the maximum valid Unicode point is <code>0x10ffff</code>.</p>534 <p>Note that the maximum valid Unicode point is <code>0x10ffff</code>.</p>
501 {#header_close#}535 {#header_close#}
502 {#header_open|Multiline String Literals#}536 {#header_open|Multiline String Literals#}
...@@ -674,6 +708,7 @@ pub fn main() %void {...@@ -674,6 +708,7 @@ pub fn main() %void {
674 {#header_close#}708 {#header_close#}
675 {#header_open|Operators#}709 {#header_open|Operators#}
676 {#header_open|Table of Operators#}710 {#header_open|Table of Operators#}
711 <div class="table-wrapper">
677 <table>712 <table>
678 <tr>713 <tr>
679 <th>714 <th>
...@@ -1246,6 +1281,7 @@ const ptr = &amp;x;...@@ -1246,6 +1281,7 @@ const ptr = &amp;x;
1246 </td>1281 </td>
1247 </tr>1282 </tr>
1248 </table>1283 </table>
1284 </div>
1249 {#header_close#}1285 {#header_close#}
1250 {#header_open|Precedence#}1286 {#header_open|Precedence#}
1251 <pre><code>x() x[] x.y1287 <pre><code>x() x[] x.y