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 {
371371 .Separator => continue,
372372 .TagContent => {
373373 const param = tokenizer.buffer[bracket_tok.start..bracket_tok.end];
374 if (mem.eql(u8, param, "3col")) {
375 columns = 3;
374 if (mem.eql(u8, param, "2col")) {
375 columns = 2;
376376 } else {
377377 return parseError(
378378 tokenizer,
doc/langref.html.in+39-12
......@@ -7,6 +7,7 @@
77 <style>
88 body{
99 font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
10 margin: 0;
1011 }
1112 a:not(:hover) {
1213 text-decoration: none;
......@@ -80,11 +81,35 @@
8081 font-weight: bold;
8182 }
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
8395 #contents {
8496 max-width: 60em;
8597 margin: auto;
8698 }
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
88113 h1 a, h2 a, h3 a, h4 a, h5 a {
89114 text-decoration: none;
90115 color: #333;
......@@ -155,13 +180,18 @@
155180 </style>
156181 </head>
157182 <body>
158 <a href="https://ziglang.org/documentation/0.1.1">0.1.1</a> |
159 <a href="https://ziglang.org/documentation/0.2.0">0.2.0</a> |
160 <a href="https://ziglang.org/documentation/0.3.0">0.3.0</a> |
161 <a href="https://ziglang.org/documentation/0.4.0">0.4.0</a> |
162 <a href="https://ziglang.org/documentation/0.5.0">0.5.0</a> |
163 master
164 <div id="contents">
183 <div id="main-wrapper">
184 <div id="index">
185 <a href="https://ziglang.org/documentation/0.1.1">0.1.1</a> |
186 <a href="https://ziglang.org/documentation/0.2.0">0.2.0</a> |
187 <a href="https://ziglang.org/documentation/0.3.0">0.3.0</a> |
188 <a href="https://ziglang.org/documentation/0.4.0">0.4.0</a> |
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">
165195 {#header_open|Introduction#}
166196 <p>
167197 Zig is a general-purpose programming language for maintaining <strong>robust</strong>,
......@@ -194,10 +224,6 @@
194224 </p>
195225 {#header_close#}
196226
197 {#header_open|Index#}
198 {#nav#}
199 {#header_close#}
200
201227 {#header_open|Hello World#}
202228
203229 {#code_begin|exe|hello#}
......@@ -6556,7 +6582,7 @@ fn readFile(allocator: *Allocator, filename: []const u8) ![]u8 {
65566582 {#header_close#}
65576583
65586584 {#header_close#}
6559 {#header_open|Builtin Functions|3col#}
6585 {#header_open|Builtin Functions|2col#}
65606586 <p>
65616587 Builtin functions are provided by the compiler and are prefixed with <code>@</code>.
65626588 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
1062110647 <li>Together we serve end users.</li>
1062210648 </ul>
1062310649 {#header_close#}
10650 </div></div>
1062410651 </div>
1062510652 </body>
1062610653</html>