authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2019-10-23 12:55:20+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-16 12:25:56-05:00
logcb5a5ebb200c6e7f87178e26dac453e8c91948d7
tree80e57a91129d3a31f53e6f9fe4293e7b4e606507
parentb3cbf290c8b6c052b3753d0f9635cdf758c16484

langref table of contents in a separate column on large displays


2 files changed, 41 insertions(+), 14 deletions(-)

doc/docgen.zig+2-2
...@@ -371,8 +371,8 @@ fn genToc(allocator: *mem.Allocator, tokenizer: *Tokenizer) !Toc {...@@ -371,8 +371,8 @@ fn genToc(allocator: *mem.Allocator, tokenizer: *Tokenizer) !Toc {
371 .Separator => continue,371 .Separator => continue,
372 .TagContent => {372 .TagContent => {
373 const param = tokenizer.buffer[bracket_tok.start..bracket_tok.end];373 const param = tokenizer.buffer[bracket_tok.start..bracket_tok.end];
374 if (mem.eql(u8, param, "3col")) {374 if (mem.eql(u8, param, "2col")) {
375 columns = 3;375 columns = 2;
376 } else {376 } else {
377 return parseError(377 return parseError(
378 tokenizer,378 tokenizer,
doc/langref.html.in+39-12
...@@ -7,6 +7,7 @@...@@ -7,6 +7,7 @@
7 <style>7 <style>
8 body{8 body{
9 font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;9 font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
10 margin: 0;
10 }11 }
11 a:not(:hover) {12 a:not(:hover) {
12 text-decoration: none;13 text-decoration: none;
...@@ -80,11 +81,35 @@...@@ -80,11 +81,35 @@
80 font-weight: bold;81 font-weight: bold;
81 }82 }
8283
84 #main-wrapper {
85 display: flex;
86 flex-direction: column;
87 height: 100vh;
88 }
89
90 #contents-wrapper {
91 flex-grow: 1;
92 padding: 0 2em;
93 }
94
83 #contents {95 #contents {
84 max-width: 60em;96 max-width: 60em;
85 margin: auto;97 margin: auto;
86 }98 }
8799
100 #index {
101 padding: 0 1em;
102 }
103
104 @media screen and (min-width: 1025px) {
105 #main-wrapper {
106 flex-direction: row;
107 }
108 #contents-wrapper, #index {
109 overflow: auto;
110 }
111 }
112
88 h1 a, h2 a, h3 a, h4 a, h5 a {113 h1 a, h2 a, h3 a, h4 a, h5 a {
89 text-decoration: none;114 text-decoration: none;
90 color: #333;115 color: #333;
...@@ -155,13 +180,18 @@...@@ -155,13 +180,18 @@
155 </style>180 </style>
156 </head>181 </head>
157 <body>182 <body>
158 <a href="https://ziglang.org/documentation/0.1.1">0.1.1</a> |183 <div id="main-wrapper">
159 <a href="https://ziglang.org/documentation/0.2.0">0.2.0</a> |184 <div id="index">
160 <a href="https://ziglang.org/documentation/0.3.0">0.3.0</a> |185 <a href="https://ziglang.org/documentation/0.1.1">0.1.1</a> |
161 <a href="https://ziglang.org/documentation/0.4.0">0.4.0</a> |186 <a href="https://ziglang.org/documentation/0.2.0">0.2.0</a> |
162 <a href="https://ziglang.org/documentation/0.5.0">0.5.0</a> |187 <a href="https://ziglang.org/documentation/0.3.0">0.3.0</a> |
163 master188 <a href="https://ziglang.org/documentation/0.4.0">0.4.0</a> |
164 <div id="contents">189 <a href="https://ziglang.org/documentation/0.5.0">0.5.0</a> |
190 master
191 <h1>Index</h1>
192 {#nav#}
193 </div>
194 <div id="contents-wrapper"><div id="contents">
165 {#header_open|Introduction#}195 {#header_open|Introduction#}
166 <p>196 <p>
167 Zig is a general-purpose programming language for maintaining <strong>robust</strong>,197 Zig is a general-purpose programming language for maintaining <strong>robust</strong>,
...@@ -194,10 +224,6 @@...@@ -194,10 +224,6 @@
194 </p>224 </p>
195 {#header_close#}225 {#header_close#}
196226
197 {#header_open|Index#}
198 {#nav#}
199 {#header_close#}
200
201 {#header_open|Hello World#}227 {#header_open|Hello World#}
202228
203 {#code_begin|exe|hello#}229 {#code_begin|exe|hello#}
...@@ -6556,7 +6582,7 @@ fn readFile(allocator: *Allocator, filename: []const u8) ![]u8 {...@@ -6556,7 +6582,7 @@ fn readFile(allocator: *Allocator, filename: []const u8) ![]u8 {
6556 {#header_close#}6582 {#header_close#}
65576583
6558 {#header_close#}6584 {#header_close#}
6559 {#header_open|Builtin Functions|3col#}6585 {#header_open|Builtin Functions|2col#}
6560 <p>6586 <p>
6561 Builtin functions are provided by the compiler and are prefixed with <code>@</code>.6587 Builtin functions are provided by the compiler and are prefixed with <code>@</code>.
6562 The {#syntax#}comptime{#endsyntax#} keyword on a parameter means that the parameter must be known6588 The {#syntax#}comptime{#endsyntax#} keyword on a parameter means that the parameter must be known
...@@ -10621,6 +10647,7 @@ keyword &lt;- KEYWORD_align / KEYWORD_and / KEYWORD_allowzero / KEYWORD_asm...@@ -10621,6 +10647,7 @@ keyword &lt;- KEYWORD_align / KEYWORD_and / KEYWORD_allowzero / KEYWORD_asm
10621 <li>Together we serve end users.</li>10647 <li>Together we serve end users.</li>
10622 </ul>10648 </ul>
10623 {#header_close#}10649 {#header_close#}
10650 </div></div>
10624 </div>10651 </div>
10625 </body>10652 </body>
10626</html>10653</html>