summaryrefslogtreecommitdiff
path: root/doc/data.html
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2022-04-01 00:04:08 -0400
committereudoxia <uplink@distress.network>2022-04-01 00:04:08 -0400
commiteac46231ab86e3b6a3862c92323ee58fe1ee722b (patch)
tree0440a92a680eb402735991cd4fa791de0c6437fa /doc/data.html
parent27f4773b122a2758cfaf88537c9e1a8ad5df7e69 (diff)
doc generation integrated with distress.network
Diffstat (limited to 'doc/data.html')
-rw-r--r--doc/data.html120
1 files changed, 59 insertions, 61 deletions
diff --git a/doc/data.html b/doc/data.html
index 676f209..ccf8c3a 100644
--- a/doc/data.html
+++ b/doc/data.html
@@ -3,60 +3,50 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<style>
-* {box-sizing: border-box;}
-html {
---fs-sans: Helvetica, "Helvetica Neue", Arial, "San Francisco", sans;
---fs-mono: jetbrains-mono-regular, Consolas, Menlo, monospace;
-font-size: 16px;
-}
-body {background-color: #111; color: #ddd; margin: 2rem calc(50% - 32rem); font-family: var(--fs-sans); font-size: 1rem; font-style: normal;}
-body * {line-height: 1.5; text-align: justify; text-justify: inter-word;}
-h1,h2 {font-family: var(--fs-sans); margin: 2rem 0 1rem; font-weight: bold; line-height: 1;}
-h1 {font-size: 3rem;}
-h2 {font-size: 2rem;}
-h3 {margin: 1rem; font-size: 1rem; font-weight: normal; font-style: italic;}
-code,code * {font-family: var(--fs-mono); hyphens: none; line-height: 1.25rem;}
-body>pre {background-color: #000; margin: 1rem; padding: 1rem; white-space: pre-wrap; border-radius: 0.25rem;}
-ul,ol {margin: 1rem 0; padding: 0 0 0 2rem;}
-ul ul,ol ol {margin: 0;}
-.ref {font-family: var(--fs-sans); font-style: italic;}
-@media screen and (max-width: 68rem) {body {margin: 2rem calc(50% - 24rem);}}
-@media screen and (max-width: 52rem) {body {margin: 2rem calc(50% - 16rem);}}
-@media screen and (max-width: 36rem) {body {margin: 2rem; hyphens: auto;} h3,body>pre {margin: 1rem 0}}
-</style>
+<link rel="stylesheet" href="/fonts/fonts.css">
+<link rel="stylesheet" href="/css/main.css">
+<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
+<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 &mdash; 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>
</head>
-
<body>
+<div class="contentlevel">
+<main>
+<div class="leading">data.lp</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="ref" >(Imports)</span>
+<pre><code><span class="lp-ref">(Imports)</span>
-<span class="ref" >(Processing limits)</span>
+<span class="lp-ref">(Processing limits)</span>
-<span class="ref" >(Formatting keywords)</span>
+<span class="lp-ref">(Formatting keywords)</span>
-<span class="ref" >(Configuration keywords)</span>
+<span class="lp-ref">(Configuration keywords)</span>
-<span class="ref" >(Data structure types)</span>
+<span class="lp-ref">(Data structure types)</span>
-<span class="ref" >(Error set)</span>
+<span class="lp-ref">(Error set)</span>
-<span class="ref" >(Line splitting function)</span>
+<span class="lp-ref">(Line splitting function)</span>
-<span class="ref" >(Configuration searching function)</span>
+<span class="lp-ref">(Configuration searching function)</span>
-<span class="ref" >(Section searching function)</span>
+<span class="lp-ref">(Section searching function)</span>
-<span class="ref" >(Parsing functions)</span>
+<span class="lp-ref">(Parsing functions)</span>
-<span class="ref" >(Code generation functions)</span>
+<span class="lp-ref">(Code generation functions)</span>
-<span class="ref" >(Text generation function)</span>
+<span class="lp-ref">(Text generation function)</span>
</code></pre>
<h2 id="constants">Constants</h2>
@@ -176,7 +166,7 @@ pub const LineRange = struct {
var buffer = std.ArrayList([]const u8).init(alloc);
defer buffer.deinit();
- <span class="ref" >(Split file at each newline)</span>
+ <span class="lp-ref">(Split file at each newline)</span>
return buffer.toOwnedSlice();
}
@@ -211,11 +201,11 @@ while (iterator.next()) |line| {
return try fmt_conf(line, key, alloc);
}
}
- log(.err, "config declaration &#39;{s}&#39; not found", .{std.mem.trimRight(u8, key, " \t")});
+ log(.err, "config declaration '{s}' not found", .{std.mem.trimRight(u8, key, " \t")});
return error.NotFound;
}
-<span class="ref" >(Auxiliary formatting function)</span>
+<span class="lp-ref">(Auxiliary formatting function)</span>
</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>
@@ -243,10 +233,10 @@ while (iterator.next()) |line| {
for (list) |section, index| {
if (std.mem.eql(u8, section.name, name)) return index;
}
- log(.err, "section &#39;{s}&#39; not found", .{name});
+ log(.err, "section '{s}' not found", .{name});
return error.NotFound;
}
-&#47;&#47; TODO return last match instead?
+// TODO return last match instead?
</code></pre>
<h2 id="parsing">Parsing</h2>
@@ -259,7 +249,7 @@ while (iterator.next()) |line| {
var sections = std.ArrayList(Section).init(alloc);
defer sections.deinit();
- <span class="ref" >(Main parsing routine)</span>
+ <span class="lp-ref">(Main parsing routine)</span>
return sections.toOwnedSlice();
}
@@ -268,7 +258,7 @@ fn parse_code(lines: [][]const u8, index: u32, alloc: Allocator) !CodeReturn {
var content = std.ArrayList(Content).init(alloc);
defer content.deinit();
- <span class="ref" >(Code parsing subroutine)</span>
+ <span class="lp-ref">(Code parsing subroutine)</span>
return CodeReturn{ .content = content.toOwnedSlice(), .index = i + 1 };
}
@@ -292,9 +282,9 @@ fn parse_code(lines: [][]const u8, index: u32, alloc: Allocator) !CodeReturn {
while (i &#60; lines.len) {
const line = lines[i];
if (std.mem.startsWith(u8, line, k_start)) {
- <span class="ref" >(Add new section)</span>
+ <span class="lp-ref">(Add new section)</span>
} else if (std.mem.startsWith(u8, line, k_add)) {
- <span class="ref" >(Append to section)</span>
+ <span class="lp-ref">(Append to section)</span>
} else if (std.mem.eql(u8, line, k_end)) {
log(.err, "line {d}: unexpected section end", .{i + 1});
return error.UnexpectedEnd;
@@ -309,12 +299,12 @@ while (i &#60; lines.len) {
<h3 id="add-new-section">Add new section:</h3>
<pre><code>const name = line[(k_start.len)..];
-log(.debug, "({d}) starting section &#39;{s}&#39;", .{ i + 1, name });
+log(.debug, "({d}) starting section '{s}'", .{ i + 1, name });
const section = try parse_code(lines, i + 1, alloc);
try sections.append(.{ .name = name, .content = section.content });
-log(.debug, "({d}) ending section &#39;{s}&#39;", .{ section.index, name });
+log(.debug, "({d}) ending section '{s}'", .{ section.index, name });
i = section.index;
</code></pre>
@@ -323,7 +313,7 @@ i = section.index;
<h3 id="append-to-section">Append to section:</h3>
<pre><code>const name = line[(k_add.len)..];
-log(.debug, "({d}) appending to section &#39;{s}&#39;", .{ i + 1, name });
+log(.debug, "({d}) appending to section '{s}'", .{ i + 1, name });
const section = try parse_code(lines, i + 1, alloc);
const index = try search(sections.items, name);
@@ -331,7 +321,7 @@ const old = &#38;sections.items[index];
const new = try std.mem.concat(alloc, Content, &#38;[_][]const Content{ old.*.content, section.content });
old.*.content = new;
-log(.debug, "({d}) ending section &#39;{s}&#39;", .{ section.index, name });
+log(.debug, "({d}) ending section '{s}'", .{ section.index, name });
i = section.index;
</code></pre>
@@ -346,11 +336,11 @@ while (i &#60; 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="ref" >(Add reference)</span>
+ <span class="lp-ref">(Add reference)</span>
} else if (std.mem.eql(u8, line, k_end)) {
break;
} else {
- <span class="ref" >(Add literal range)</span>
+ <span class="lp-ref">(Add literal range)</span>
}
}
</code></pre>
@@ -361,7 +351,7 @@ while (i &#60; lines.len) {
<pre><code>const ref_name = std.mem.trimLeft(u8, line, " \t")[(k_ref.len)..];
try content.append(.{ .reference = ref_name });
-log(.debug, "({d}) \tappended reference &#39;{s}&#39;", .{ i + 1, ref_name });
+log(.debug, "({d}) \tappended reference '{s}'", .{ i + 1, ref_name });
i += 1;
</code></pre>
@@ -402,17 +392,17 @@ fn codegen_main(lines: [][]const u8, list: []Section, index: usize, depth: u8, a
defer buffer.deinit();
const section = list[index];
- log(.debug, "generating section &#39;{s}&#39;", .{section.name});
+ log(.debug, "generating section '{s}'", .{section.name});
for (section.content) |content| switch (content) {
.literal =&#62; |range| {
- <span class="ref" >(Append literal range)</span>
+ <span class="lp-ref">(Append literal range)</span>
},
.reference =&#62; |name| {
- <span class="ref" >(Resolve reference)</span>
+ <span class="lp-ref">(Resolve reference)</span>
},
};
- log(.debug, "ending section &#39;{s}&#39;", .{section.name});
+ log(.debug, "ending section '{s}'", .{section.name});
return buffer.toOwnedSlice();
}
</code></pre>
@@ -448,7 +438,7 @@ try buffer.appendSlice(code);
var buffer = std.ArrayList([]const u8).init(alloc);
defer buffer.deinit();
- <span class="ref" >(Process configuration declarations)</span>
+ <span class="lp-ref">(Process configuration declarations)</span>
var current_name: []const u8 = undefined;
for (lines) |line| {
@@ -458,13 +448,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="ref" >(Format starting command)</span>
+ <span class="lp-ref">(Format starting command)</span>
} else if (std.mem.startsWith(u8, line, k_add)) {
- <span class="ref" >(Format appending command)</span>
+ <span class="lp-ref">(Format appending command)</span>
} else if (std.mem.startsWith(u8, line, k_end)) {
- <span class="ref" >(Format ending command)</span>
+ <span class="lp-ref">(Format ending command)</span>
} else if (std.mem.startsWith(u8, std.mem.trimLeft(u8, line, " \t"), k_ref)) {
- <span class="ref" >(Format reference command)</span>
+ <span class="lp-ref">(Format reference command)</span>
} else {
try buffer.append(line);
}
@@ -515,5 +505,13 @@ try buffer.append(try std.mem.join(alloc, current_name, conf_add));
const ref = try std.mem.join(alloc, line[(start + k_ref.len)..], conf_ref);
try buffer.append(try std.mem.concat(alloc, u8, &#38;[_][]const u8{ line[0..start], ref }));
</code></pre>
+</main>
+<nav>
+</nav>
+</div>
+<footer>
+<p><a href="/info">About.</a> <a href="mailto:uplink@distress.network">Contact.</a> <a href="/cw.html">Content Warning.</a> <a href="https://git.distress.network">Git.</a> <a href="/meta/sitemap">Sitemap.</a> <a href="https://creativecommons.org/licenses/by-sa/4.0">CC BY-SA 4.0.</a></p>
+<img src="/media/distressnetwork-w.svg" alt="">
+</footer>
</body>
-</html> \ No newline at end of file
+</html>