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
signature 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
14271427 }
14281428 const escaped_stderr = try escapeHtml(allocator, result.stderr);
14291429 const colored_stderr = try termColor(allocator, escaped_stderr);
1430 try out.print("\n{}\n", colored_stderr);
1431 if (!code.is_inline) {
1432 try out.print("</code></pre>\n");
1433 }
1430 try out.print("\n{}", colored_stderr);
14341431 } else {
14351432 _ = exec(allocator, &env_map, build_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "example failed to compile");
14361433 }
doc/langref.html.in+9-13
......@@ -1,10 +1,10 @@
11<!doctype html>
2<html>
2<html lang="en">
33 <head>
44 <meta charset="utf-8">
55 <title>Documentation - The Zig Programming Language</title>
66 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg=="/>
7 <style type="text/css">
7 <style>
88 body{
99 font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
1010 }
......@@ -511,7 +511,7 @@ pub fn main() void {
511511 </div>
512512 <p>
513513 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 identifier
514 an identifier of <code>i</code> or <code>u</code> followed by digits. For example, the identifier
515515 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an
516516 integer type is {#syntax#}65535{#endsyntax#}.
517517 </p>
......@@ -878,7 +878,7 @@ fn divide(a: i32, b: i32) i32 {
878878 </p>
879879 <p>
880880 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 identifier
881 an identifier of <code>i</code> or <code>u</code> followed by digits. For example, the identifier
882882 {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an
883883 integer type is {#syntax#}65535{#endsyntax#}.
884884 </p>
......@@ -5445,8 +5445,6 @@ fn gimmeTheBiggerInteger(a: u64, b: u64) u64 {
54455445 <li>In the function definition, the value is known at compile-time.</li>
54465446 </ul>
54475447 <p>
5448 </p>
5449 <p>
54505448 For example, if we were to introduce another function to the above snippet:
54515449 </p>
54525450 {#code_begin|test_err|values of type 'type' must be comptime known#}
......@@ -6006,7 +6004,7 @@ pub fn main() void {
60066004 {#target_linux_x86_64#}
60076005pub fn main() noreturn {
60086006 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);
60106008 _ = syscall1(SYS_exit, 0);
60116009 unreachable;
60126010}
......@@ -6891,7 +6889,7 @@ async fn func(y: *i32) void {
68916889 This function can only occur inside {#syntax#}@cImport{#endsyntax#}.
68926890 </p>
68936891 <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#}
68956893 temporary buffer.
68966894 </p>
68976895 {#see_also|Import from C Header File|@cImport|@cDefine|@cUndef#}
......@@ -7015,7 +7013,6 @@ test "main" {
70157013 warn("Runtime in main, num1 = {}.\n", num1);
70167014}
70177015 {#code_end#}
7018 </p>
70197016 <p>
70207017 will ouput:
70217018 </p>
......@@ -8226,7 +8223,7 @@ test "integer truncation" {
82268223 <li>{#syntax#}noreturn{#endsyntax#}</li>
82278224 <li>{#syntax#}void{#endsyntax#}</li>
82288225 <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>
82308227 <li>{#link|Floats#}</li>
82318228 <li>{#link|Pointers#}</li>
82328229 <li>{#syntax#}comptime_int{#endsyntax#}</li>
......@@ -8620,7 +8617,7 @@ pub fn build(b: *Builder) void {
86208617 {#header_close#}
86218618
86228619 {#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>
86248621 <ul>
86258622 <li>All {#link|Thread Local Variables#} are treated as {#link|Global Variables#}.</li>
86268623 <li>The overhead of {#link|Async Functions#} becomes equivalent to function call overhead.</li>
......@@ -8629,7 +8626,6 @@ pub fn build(b: *Builder) void {
86298626 For example {#syntax#}std.Mutex{#endsyntax#} becomes
86308627 an empty data structure and all of its functions become no-ops.</li>
86318628 </ul>
8632 </p>
86338629 {#header_close#}
86348630
86358631 {#header_open|Undefined Behavior#}
......@@ -9410,7 +9406,7 @@ test "string literal to constant slice" {
94109406 The location of memory allocated with {#syntax#}allocator.alloc{#endsyntax#} or
94119407 {#syntax#}allocator.create{#endsyntax#} is determined by the allocator's implementation.
94129408 </p>
9413 </p>TODO: thread local variables</p>
9409 <p>TODO: thread local variables</p>
94149410 {#header_close#}
94159411
94169412 {#header_open|Implementing an Allocator#}
lib/std/special/docs/index.html+2-2
......@@ -1,10 +1,10 @@
11<!doctype html>
2<html>
2<html lang="en">
33 <head>
44 <meta charset="utf-8">
55 <title>Documentation - Zig</title>
66 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg==">
7 <style type="text/css">
7 <style>
88 :root {
99 font-size: 1em;
1010 --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";