diff options
author | eudoxia <uplink@distress.network> | 2022-04-01 10:31:17 -0400 |
---|---|---|
committer | eudoxia <uplink@distress.network> | 2022-04-01 10:31:17 -0400 |
commit | 175b6c47b15f2d5dc56d106ef044451ed19df4b2 (patch) | |
tree | 78add55472c71b9ce367a101580a3f728fab759f | |
parent | 3a5a61229a4fa0e7acba3f49fb4a28fa898672a3 (diff) |
software/literary: updated docs
-rwxr-xr-x | software/literary/data.html | 73 | ||||
-rwxr-xr-x | software/literary/log.html | 31 | ||||
-rwxr-xr-x | software/literary/tangle.html | 35 | ||||
-rwxr-xr-x | software/literary/weave.html | 33 |
4 files changed, 100 insertions, 72 deletions
diff --git a/software/literary/data.html b/software/literary/data.html index ccf8c3a..0019f3e 100755 --- a/software/literary/data.html +++ b/software/literary/data.html @@ -9,44 +9,51 @@ <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/favicon/site.webmanifest"> -<title>data.lp — DistressNetwork°</title> -<meta http-equiv="last-modified" content="2022-03-31 23:28:56-04:00" /> -<style>.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-style: italic;}</style> +<script src="/js/bg.js"></script> +<title></title> +<meta name="description" content="" /> +<meta http-equiv="last-modified" content="" /> </head> <body> +<header> +<div class="bomber"></div> +<hr> +<div class="identcontainer"> +<div class="ident"><time datetime=""></time>––––<a href="https://distress.network">DistressNetwork°</a></div> +<img class="headerlogo" src="/media/distressnetwork-b.svg" alt=""> +</div> +</header> <div class="contentlevel"> <main> -<div class="leading">data.lp</div> +<div class="leading"></div> <hr> -<h1 id="data.zig">data.zig</h1> - <p>This file contains the various data processing-related constants and functions referenced by the tangling and weaving processes.</p> <h3 id="section">*:</h3> -<pre><code><span class="lp-ref">(Imports)</span> +<pre><code>@= Imports =@ -<span class="lp-ref">(Processing limits)</span> +@= Processing limits =@ -<span class="lp-ref">(Formatting keywords)</span> +@= Formatting keywords =@ -<span class="lp-ref">(Configuration keywords)</span> +@= Configuration keywords =@ -<span class="lp-ref">(Data structure types)</span> +@= Data structure types =@ -<span class="lp-ref">(Error set)</span> +@= Error set =@ -<span class="lp-ref">(Line splitting function)</span> +@= Line splitting function =@ -<span class="lp-ref">(Configuration searching function)</span> +@= Configuration searching function =@ -<span class="lp-ref">(Section searching function)</span> +@= Section searching function =@ -<span class="lp-ref">(Parsing functions)</span> +@= Parsing functions =@ -<span class="lp-ref">(Code generation functions)</span> +@= Code generation functions =@ -<span class="lp-ref">(Text generation function)</span> +@= Text generation function =@ </code></pre> <h2 id="constants">Constants</h2> @@ -166,7 +173,7 @@ pub const LineRange = struct { var buffer = std.ArrayList([]const u8).init(alloc); defer buffer.deinit(); - <span class="lp-ref">(Split file at each newline)</span> + @= Split file at each newline =@ return buffer.toOwnedSlice(); } @@ -205,7 +212,7 @@ while (iterator.next()) |line| { return error.NotFound; } -<span class="lp-ref">(Auxiliary formatting function)</span> +@= Auxiliary formatting function =@ </code></pre> <p>If the declaration is found, its contained format string is split along instances of the section name escape sequence, and each substring has its instances of the newline escape sequence replaced with a literal newline.</p> @@ -249,7 +256,7 @@ while (iterator.next()) |line| { var sections = std.ArrayList(Section).init(alloc); defer sections.deinit(); - <span class="lp-ref">(Main parsing routine)</span> + @= Main parsing routine =@ return sections.toOwnedSlice(); } @@ -258,7 +265,7 @@ fn parse_code(lines: [][]const u8, index: u32, alloc: Allocator) !CodeReturn { var content = std.ArrayList(Content).init(alloc); defer content.deinit(); - <span class="lp-ref">(Code parsing subroutine)</span> + @= Code parsing subroutine =@ return CodeReturn{ .content = content.toOwnedSlice(), .index = i + 1 }; } @@ -282,9 +289,9 @@ fn parse_code(lines: [][]const u8, index: u32, alloc: Allocator) !CodeReturn { while (i < lines.len) { const line = lines[i]; if (std.mem.startsWith(u8, line, k_start)) { - <span class="lp-ref">(Add new section)</span> + @= Add new section =@ } else if (std.mem.startsWith(u8, line, k_add)) { - <span class="lp-ref">(Append to section)</span> + @= Append to section =@ } else if (std.mem.eql(u8, line, k_end)) { log(.err, "line {d}: unexpected section end", .{i + 1}); return error.UnexpectedEnd; @@ -336,11 +343,11 @@ while (i < lines.len) { log(.err, "line {d}: unexpected section start", .{i + 1}); return error.UnexpectedStart; } else if (std.mem.startsWith(u8, std.mem.trimLeft(u8, line, " \t"), k_ref)) { - <span class="lp-ref">(Add reference)</span> + @= Add reference =@ } else if (std.mem.eql(u8, line, k_end)) { break; } else { - <span class="lp-ref">(Add literal range)</span> + @= Add literal range =@ } } </code></pre> @@ -395,10 +402,10 @@ fn codegen_main(lines: [][]const u8, list: []Section, index: usize, depth: u8, a log(.debug, "generating section '{s}'", .{section.name}); for (section.content) |content| switch (content) { .literal => |range| { - <span class="lp-ref">(Append literal range)</span> + @= Append literal range =@ }, .reference => |name| { - <span class="lp-ref">(Resolve reference)</span> + @= Resolve reference =@ }, }; @@ -438,7 +445,7 @@ try buffer.appendSlice(code); var buffer = std.ArrayList([]const u8).init(alloc); defer buffer.deinit(); - <span class="lp-ref">(Process configuration declarations)</span> + @= Process configuration declarations =@ var current_name: []const u8 = undefined; for (lines) |line| { @@ -448,13 +455,13 @@ try buffer.appendSlice(code); or std.mem.startsWith(u8, line, kc_ref)) { continue; } else if (std.mem.startsWith(u8, line, k_start)) { - <span class="lp-ref">(Format starting command)</span> + @= Format starting command =@ } else if (std.mem.startsWith(u8, line, k_add)) { - <span class="lp-ref">(Format appending command)</span> + @= Format appending command =@ } else if (std.mem.startsWith(u8, line, k_end)) { - <span class="lp-ref">(Format ending command)</span> + @= Format ending command =@ } else if (std.mem.startsWith(u8, std.mem.trimLeft(u8, line, " \t"), k_ref)) { - <span class="lp-ref">(Format reference command)</span> + @= Format reference command =@ } else { try buffer.append(line); } diff --git a/software/literary/log.html b/software/literary/log.html index 5a538c3..c2bffff 100755 --- a/software/literary/log.html +++ b/software/literary/log.html @@ -9,26 +9,33 @@ <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/favicon/site.webmanifest"> -<title>log.lp — DistressNetwork°</title> -<meta http-equiv="last-modified" content="2022-03-31 23:28:57-04:00" /> -<style>.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-style: italic;}</style> +<script src="/js/bg.js"></script> +<title></title> +<meta name="description" content="" /> +<meta http-equiv="last-modified" content="" /> </head> <body> +<header> +<div class="bomber"></div> +<hr> +<div class="identcontainer"> +<div class="ident"><time datetime=""></time>––––<a href="https://distress.network">DistressNetwork°</a></div> +<img class="headerlogo" src="/media/distressnetwork-b.svg" alt=""> +</div> +</header> <div class="contentlevel"> <main> -<div class="leading">log.lp</div> +<div class="leading"></div> <hr> -<h1 id="log.zig">log.zig</h1> - <p>This file contains a simple logging function. It is a modified version of the example logging function implementation provided in <code>std.log</code>.</p> <h3 id="section">*:</h3> -<pre><code><span class="lp-ref">(Imports)</span> +<pre><code>@= Imports =@ -<span class="lp-ref">(Level setting)</span> +@= Level setting =@ -<span class="lp-ref">(Logging function)</span> +@= Logging function =@ </code></pre> <p>We first import the standard library, and the <code>Level</code> type which is an enum representing the possible log levels.</p> @@ -55,11 +62,11 @@ const Level = std.log.Level; comptime format: []const u8, args: anytype, ) void { - <span class="lp-ref">(Compare with level threshold)</span> + @= Compare with level threshold =@ - <span class="lp-ref">(Define message string)</span> + @= Define message string =@ - <span class="lp-ref">(Print to console)</span> + @= Print to console =@ } </code></pre> diff --git a/software/literary/tangle.html b/software/literary/tangle.html index b8269a3..9d853fe 100755 --- a/software/literary/tangle.html +++ b/software/literary/tangle.html @@ -9,37 +9,44 @@ <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/favicon/site.webmanifest"> -<title>tangle.lp — DistressNetwork°</title> -<meta http-equiv="last-modified" content="2022-03-31 23:28:57-04:00" /> -<style>.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-style: italic;}</style> +<script src="/js/bg.js"></script> +<title></title> +<meta name="description" content="" /> +<meta http-equiv="last-modified" content="" /> </head> <body> +<header> +<div class="bomber"></div> +<hr> +<div class="identcontainer"> +<div class="ident"><time datetime=""></time>––––<a href="https://distress.network">DistressNetwork°</a></div> +<img class="headerlogo" src="/media/distressnetwork-b.svg" alt=""> +</div> +</header> <div class="contentlevel"> <main> -<div class="leading">tangle.lp</div> +<div class="leading"></div> <hr> -<h1 id="tangle.zig">tangle.zig</h1> - <p>The structure of this file is quite similar to that of <code>weave.zig</code>, only differing in terms of which functions are used to transform the input data.</p> <h3 id="section">*:</h3> -<pre><code><span class="lp-ref">(Imports)</span> +<pre><code>@= Imports =@ pub fn main() !u8 { - <span class="lp-ref">(IO initialization)</span> + @= IO initialization =@ - <span class="lp-ref">(Allocator initialization)</span> + @= Allocator initialization =@ - <span class="lp-ref">(Read file from stdin)</span> + @= Read file from stdin =@ - <span class="lp-ref">(Split into lines)</span> + @= Split into lines =@ - <span class="lp-ref">(Parse lines into sections)</span> + @= Parse lines into sections =@ - <span class="lp-ref">(Generate code)</span> + @= Generate code =@ - <span class="lp-ref">(Write to stdout)</span> + @= Write to stdout =@ return 0; } diff --git a/software/literary/weave.html b/software/literary/weave.html index 9bfee51..73ae64f 100755 --- a/software/literary/weave.html +++ b/software/literary/weave.html @@ -9,35 +9,42 @@ <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/favicon/site.webmanifest"> -<title>weave.lp — DistressNetwork°</title> -<meta http-equiv="last-modified" content="2022-03-31 23:28:57-04:00" /> -<style>.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-style: italic;}</style> +<script src="/js/bg.js"></script> +<title></title> +<meta name="description" content="" /> +<meta http-equiv="last-modified" content="" /> </head> <body> +<header> +<div class="bomber"></div> +<hr> +<div class="identcontainer"> +<div class="ident"><time datetime=""></time>––––<a href="https://distress.network">DistressNetwork°</a></div> +<img class="headerlogo" src="/media/distressnetwork-b.svg" alt=""> +</div> +</header> <div class="contentlevel"> <main> -<div class="leading">weave.lp</div> +<div class="leading"></div> <hr> -<h1 id="weave.zig">weave.zig</h1> - <p>The structure of this file is quite similar to that of <code>tangle.zig</code>, only differing in terms of which functions are used to transform the input data.</p> <h3 id="section">*:</h3> -<pre><code><span class="lp-ref">(Imports)</span> +<pre><code>@= Imports =@ pub fn main() !u8 { - <span class="lp-ref">(IO initialization)</span> + @= IO initialization =@ - <span class="lp-ref">(Allocator initialization)</span> + @= Allocator initialization =@ - <span class="lp-ref">(Read file from stdin)</span> + @= Read file from stdin =@ - <span class="lp-ref">(Split into lines)</span> + @= Split into lines =@ - <span class="lp-ref">(Generate text)</span> + @= Generate text =@ - <span class="lp-ref">(Write to stdout)</span> + @= Write to stdout =@ return 0; } |