authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-05 20:43:10-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2019-12-05 20:43:10-05:00
log105ef560b3584d34ac3bdbb24b878f8e1ca97e50
tree364f41d5e408b827a73f73d86ed42c39b7b7b6a4
parentbfb15f1c9f1b4a33cfd8e58cdefc3a0d98a015d2
parentcb96a096cbbecb655e98aadc77a881b544886cd2
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #3853 from xackus/doc-fixes

Docs: assembly example printing garbage and minor html fixes

3 files changed, 12 insertions(+), 19 deletions(-)

doc/docgen.zig+1-4
...@@ -1427,10 +1427,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1427,10 +1427,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1427 }1427 }
1428 const escaped_stderr = try escapeHtml(allocator, result.stderr);1428 const escaped_stderr = try escapeHtml(allocator, result.stderr);
1429 const colored_stderr = try termColor(allocator, escaped_stderr);1429 const colored_stderr = try termColor(allocator, escaped_stderr);
1430 try out.print("\n{}\n", colored_stderr);1430 try out.print("\n{}", colored_stderr);
1431 if (!code.is_inline) {
1432 try out.print("</code></pre>\n");
1433 }
1434 } else {1431 } else {
1435 _ = exec(allocator, &env_map, build_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "example failed to compile");1432 _ = exec(allocator, &env_map, build_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "example failed to compile");
1436 }1433 }
doc/langref.html.in+9-13
...@@ -1,10 +1,10 @@...@@ -1,10 +1,10 @@
1<!doctype html>1<!doctype html>
2<html>2<html lang="en">
3 <head>3 <head>
4 <meta charset="utf-8">4 <meta charset="utf-8">
5 <title>Documentation - The Zig Programming Language</title>5 <title>Documentation - The Zig Programming Language</title>
6 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg=="/>6 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg=="/>
7 <style type="text/css">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 }10 }
...@@ -511,7 +511,7 @@ pub fn main() void {...@@ -511,7 +511,7 @@ pub fn main() void {
511 </div>511 </div>
512 <p>512 <p>
513 In addition to the integer types above, arbitrary bit-width integers can be referenced by using513 In addition to the integer types above, arbitrary bit-width integers can be referenced by using
514 an identifier of <code>i</code> or </code>u</code> followed by digits. For example, the identifier514 an identifier of <code>i</code> or <code>u</code> followed by digits. For example, the identifier
515 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an515 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an
516 integer type is {#syntax#}65535{#endsyntax#}.516 integer type is {#syntax#}65535{#endsyntax#}.
517 </p>517 </p>
...@@ -878,7 +878,7 @@ fn divide(a: i32, b: i32) i32 {...@@ -878,7 +878,7 @@ fn divide(a: i32, b: i32) i32 {
878 </p>878 </p>
879 <p>879 <p>
880 Zig supports arbitrary bit-width integers, referenced by using880 Zig supports arbitrary bit-width integers, referenced by using
881 an identifier of <code>i</code> or </code>u</code> followed by digits. For example, the identifier881 an identifier of <code>i</code> or <code>u</code> followed by digits. For example, the identifier
882 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an882 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an
883 integer type is {#syntax#}65535{#endsyntax#}.883 integer type is {#syntax#}65535{#endsyntax#}.
884 </p>884 </p>
...@@ -5445,8 +5445,6 @@ fn gimmeTheBiggerInteger(a: u64, b: u64) u64 {...@@ -5445,8 +5445,6 @@ fn gimmeTheBiggerInteger(a: u64, b: u64) u64 {
5445 <li>In the function definition, the value is known at compile-time.</li>5445 <li>In the function definition, the value is known at compile-time.</li>
5446 </ul>5446 </ul>
5447 <p>5447 <p>
5448 </p>
5449 <p>
5450 For example, if we were to introduce another function to the above snippet:5448 For example, if we were to introduce another function to the above snippet:
5451 </p>5449 </p>
5452 {#code_begin|test_err|values of type 'type' must be comptime known#}5450 {#code_begin|test_err|values of type 'type' must be comptime known#}
...@@ -6006,7 +6004,7 @@ pub fn main() void {...@@ -6006,7 +6004,7 @@ pub fn main() void {
6006 {#target_linux_x86_64#}6004 {#target_linux_x86_64#}
6007pub fn main() noreturn {6005pub fn main() noreturn {
6008 const msg = "hello world\n";6006 const msg = "hello world\n";
6009 _ = syscall3(SYS_write, STDOUT_FILENO, @ptrToInt(&msg), msg.len);6007 _ = syscall3(SYS_write, STDOUT_FILENO, @ptrToInt(msg), msg.len);
6010 _ = syscall1(SYS_exit, 0);6008 _ = syscall1(SYS_exit, 0);
6011 unreachable;6009 unreachable;
6012}6010}
...@@ -6891,7 +6889,7 @@ async fn func(y: *i32) void {...@@ -6891,7 +6889,7 @@ async fn func(y: *i32) void {
6891 This function can only occur inside {#syntax#}@cImport{#endsyntax#}.6889 This function can only occur inside {#syntax#}@cImport{#endsyntax#}.
6892 </p>6890 </p>
6893 <p>6891 <p>
6894 This appends <code>#include <$path>\n</code> to the {#syntax#}c_import{#endsyntax#}6892 This appends <code>#include &lt;$path&gt;\n</code> to the {#syntax#}c_import{#endsyntax#}
6895 temporary buffer.6893 temporary buffer.
6896 </p>6894 </p>
6897 {#see_also|Import from C Header File|@cImport|@cDefine|@cUndef#}6895 {#see_also|Import from C Header File|@cImport|@cDefine|@cUndef#}
...@@ -7015,7 +7013,6 @@ test "main" {...@@ -7015,7 +7013,6 @@ test "main" {
7015 warn("Runtime in main, num1 = {}.\n", num1);7013 warn("Runtime in main, num1 = {}.\n", num1);
7016}7014}
7017 {#code_end#}7015 {#code_end#}
7018 </p>
7019 <p>7016 <p>
7020 will ouput:7017 will ouput:
7021 </p>7018 </p>
...@@ -8226,7 +8223,7 @@ test "integer truncation" {...@@ -8226,7 +8223,7 @@ test "integer truncation" {
8226 <li>{#syntax#}noreturn{#endsyntax#}</li>8223 <li>{#syntax#}noreturn{#endsyntax#}</li>
8227 <li>{#syntax#}void{#endsyntax#}</li>8224 <li>{#syntax#}void{#endsyntax#}</li>
8228 <li>{#syntax#}bool{#endsyntax#}</li>8225 <li>{#syntax#}bool{#endsyntax#}</li>
8229 <li>{#link|Integers#}</li> - The maximum bit count for an integer type is {#syntax#}65535{#endsyntax#}.8226 <li>{#link|Integers#} - The maximum bit count for an integer type is {#syntax#}65535{#endsyntax#}.</li>
8230 <li>{#link|Floats#}</li>8227 <li>{#link|Floats#}</li>
8231 <li>{#link|Pointers#}</li>8228 <li>{#link|Pointers#}</li>
8232 <li>{#syntax#}comptime_int{#endsyntax#}</li>8229 <li>{#syntax#}comptime_int{#endsyntax#}</li>
...@@ -8620,7 +8617,7 @@ pub fn build(b: *Builder) void {...@@ -8620,7 +8617,7 @@ pub fn build(b: *Builder) void {
8620 {#header_close#}8617 {#header_close#}
86218618
8622 {#header_open|Single Threaded Builds#}8619 {#header_open|Single Threaded Builds#}
8623 <p>Zig has a compile option <code>--single-threaded</code> which has the following effects:8620 <p>Zig has a compile option <code>--single-threaded</code> which has the following effects:</p>
8624 <ul>8621 <ul>
8625 <li>All {#link|Thread Local Variables#} are treated as {#link|Global Variables#}.</li>8622 <li>All {#link|Thread Local Variables#} are treated as {#link|Global Variables#}.</li>
8626 <li>The overhead of {#link|Async Functions#} becomes equivalent to function call overhead.</li>8623 <li>The overhead of {#link|Async Functions#} becomes equivalent to function call overhead.</li>
...@@ -8629,7 +8626,6 @@ pub fn build(b: *Builder) void {...@@ -8629,7 +8626,6 @@ pub fn build(b: *Builder) void {
8629 For example {#syntax#}std.Mutex{#endsyntax#} becomes8626 For example {#syntax#}std.Mutex{#endsyntax#} becomes
8630 an empty data structure and all of its functions become no-ops.</li>8627 an empty data structure and all of its functions become no-ops.</li>
8631 </ul>8628 </ul>
8632 </p>
8633 {#header_close#}8629 {#header_close#}
86348630
8635 {#header_open|Undefined Behavior#}8631 {#header_open|Undefined Behavior#}
...@@ -9410,7 +9406,7 @@ test "string literal to constant slice" {...@@ -9410,7 +9406,7 @@ test "string literal to constant slice" {
9410 The location of memory allocated with {#syntax#}allocator.alloc{#endsyntax#} or9406 The location of memory allocated with {#syntax#}allocator.alloc{#endsyntax#} or
9411 {#syntax#}allocator.create{#endsyntax#} is determined by the allocator's implementation.9407 {#syntax#}allocator.create{#endsyntax#} is determined by the allocator's implementation.
9412 </p>9408 </p>
9413 </p>TODO: thread local variables</p>9409 <p>TODO: thread local variables</p>
9414 {#header_close#}9410 {#header_close#}
94159411
9416 {#header_open|Implementing an Allocator#}9412 {#header_open|Implementing an Allocator#}
lib/std/special/docs/index.html+2-2
...@@ -1,10 +1,10 @@...@@ -1,10 +1,10 @@
1<!doctype html>1<!doctype html>
2<html>2<html lang="en">
3 <head>3 <head>
4 <meta charset="utf-8">4 <meta charset="utf-8">
5 <title>Documentation - Zig</title>5 <title>Documentation - Zig</title>
6 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg==">6 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg==">
7 <style type="text/css">7 <style>
8 :root {8 :root {
9 font-size: 1em;9 font-size: 1em;
10 --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";10 --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";