summaryrefslogtreecommitdiff
path: root/doc/data.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/data.html')
-rw-r--r--[-rwxr-xr-x]doc/data.html126
1 files changed, 65 insertions, 61 deletions
diff --git a/doc/data.html b/doc/data.html
index 9fddef4..05bc7cf 100755..100644
--- a/doc/data.html
+++ b/doc/data.html
@@ -3,57 +3,69 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<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>
-<style>h3,.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-size: 1rem; font-weight: normal; font-style: italic;} h3 {margin: 1rem;}</style>
+<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>
</head>
+
<body>
-<div class="contentlevel">
-<main>
-<div class="leading">data.lp</div>
-<hr>
+<h1>data.lp</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">(License)</span>
+<pre><code><span class="ref" >(License)</span>
-<span class="lp-ref">(Imports)</span>
+<span class="ref" >(Imports)</span>
-<span class="lp-ref">(Processing limits)</span>
+<span class="ref" >(Processing limits)</span>
-<span class="lp-ref">(Formatting keywords)</span>
+<span class="ref" >(Formatting keywords)</span>
-<span class="lp-ref">(Configuration keywords)</span>
+<span class="ref" >(Configuration keywords)</span>
-<span class="lp-ref">(Data structure types)</span>
+<span class="ref" >(Data structure types)</span>
-<span class="lp-ref">(Error set)</span>
+<span class="ref" >(Error set)</span>
-<span class="lp-ref">(Line splitting function)</span>
+<span class="ref" >(Line splitting function)</span>
-<span class="lp-ref">(Configuration searching function)</span>
+<span class="ref" >(Configuration searching function)</span>
-<span class="lp-ref">(Section searching function)</span>
+<span class="ref" >(Section searching function)</span>
-<span class="lp-ref">(Command type detection function)</span>
+<span class="ref" >(Command type detection function)</span>
-<span class="lp-ref">(Parsing functions)</span>
+<span class="ref" >(Parsing functions)</span>
-<span class="lp-ref">(Code generation functions)</span>
+<span class="ref" >(Code generation functions)</span>
-<span class="lp-ref">(Text generation function)</span>
+<span class="ref" >(Text generation function)</span>
</code></pre>
<h3 id="license">License:</h3>
-<pre><code>// Copyright 2022 DistressNetwork° &#60;uplink@distress.network&#62;
-// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+<pre><code>&#47;&#47; Copyright 2022 DistressNetwork° &#60;uplink@distress.network&#62;
+&#47;&#47; This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https:&#47;&#47;mozilla.org&#47;MPL&#47;2.0&#47;.
</code></pre>
<h2 id="constants">Constants</h2>
@@ -173,7 +185,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>
+ <span class="ref" >(Split file at each newline)</span>
return buffer.toOwnedSlice();
}
@@ -208,11 +220,11 @@ while (iterator.next()) |line| {
return try fmt_conf(line, key, alloc);
}
}
- log(.err, "config declaration '{s}' not found", .{std.mem.trimRight(u8, key, " \t")});
+ log(.err, "config declaration &#39;{s}&#39; not found", .{std.mem.trimRight(u8, key, " \t")});
return error.NotFound;
}
-<span class="lp-ref">(Auxiliary formatting function)</span>
+<span class="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>
@@ -240,7 +252,7 @@ while (iterator.next()) |line| {
for (list) |section, index| {
if (std.mem.eql(u8, section.name, name)) return index;
}
- log(.err, "section '{s}' not found", .{name});
+ log(.err, "section &#39;{s}&#39; not found", .{name});
return error.NotFound;
}
</code></pre>
@@ -276,7 +288,7 @@ fn command_type(line: []const u8) CommandType {
var sections = std.ArrayList(Section).init(alloc);
defer sections.deinit();
- <span class="lp-ref">(Main parsing routine)</span>
+ <span class="ref" >(Main parsing routine)</span>
return sections.toOwnedSlice();
}
@@ -285,7 +297,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>
+ <span class="ref" >(Code parsing subroutine)</span>
return CodeReturn{ .content = content.toOwnedSlice(), .index = i + 1 };
}
@@ -310,10 +322,10 @@ while (i &#60; lines.len) {
const line = lines[i];
switch (command_type(line)) {
.start =&#62; {
- <span class="lp-ref">(Add new section)</span>
+ <span class="ref" >(Add new section)</span>
},
.add =&#62; {
- <span class="lp-ref">(Append to section)</span>
+ <span class="ref" >(Append to section)</span>
},
.end =&#62; {
log(.err, "line {d}: unexpected section end", .{i + 1});
@@ -331,12 +343,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 '{s}'", .{ i + 1, name });
+log(.debug, "({d}) starting section &#39;{s}&#39;", .{ 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 '{s}'", .{ section.index, name });
+log(.debug, "({d}) ending section &#39;{s}&#39;", .{ section.index, name });
i = section.index;
</code></pre>
@@ -345,7 +357,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 '{s}'", .{ i + 1, name });
+log(.debug, "({d}) appending to section &#39;{s}&#39;", .{ i + 1, name });
const section = try parse_code(lines, i + 1, alloc);
const index = try search(sections.items, name);
@@ -353,7 +365,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 '{s}'", .{ section.index, name });
+log(.debug, "({d}) ending section &#39;{s}&#39;", .{ section.index, name });
i = section.index;
</code></pre>
@@ -370,13 +382,13 @@ while (i &#60; lines.len) {
return error.UnexpectedStart;
},
.ref =&#62; {
- <span class="lp-ref">(Add reference)</span>
+ <span class="ref" >(Add reference)</span>
},
.end =&#62; {
break;
},
else =&#62; {
- <span class="lp-ref">(Add literal range)</span>
+ <span class="ref" >(Add literal range)</span>
},
}
}
@@ -388,7 +400,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 '{s}'", .{ i + 1, ref_name });
+log(.debug, "({d}) \tappended reference &#39;{s}&#39;", .{ i + 1, ref_name });
i += 1;
</code></pre>
@@ -429,17 +441,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 '{s}'", .{section.name});
+ log(.debug, "generating section &#39;{s}&#39;", .{section.name});
for (section.content) |content| switch (content) {
.literal =&#62; |range| {
- <span class="lp-ref">(Append literal range)</span>
+ <span class="ref" >(Append literal range)</span>
},
.reference =&#62; |name| {
- <span class="lp-ref">(Resolve reference)</span>
+ <span class="ref" >(Resolve reference)</span>
},
};
- log(.debug, "ending section '{s}'", .{section.name});
+ log(.debug, "ending section &#39;{s}&#39;", .{section.name});
return buffer.toOwnedSlice();
}
</code></pre>
@@ -475,7 +487,7 @@ try buffer.appendSlice(code);
var buffer = std.ArrayList([]const u8).init(alloc);
defer buffer.deinit();
- <span class="lp-ref">(Process configuration declarations)</span>
+ <span class="ref" >(Process configuration declarations)</span>
var current_name: []const u8 = undefined;
for (lines) |line| {
@@ -486,16 +498,16 @@ try buffer.appendSlice(code);
continue;
} else switch (command_type(line)) {
.start =&#62; {
- <span class="lp-ref">(Format starting command)</span>
+ <span class="ref" >(Format starting command)</span>
},
.add =&#62; {
- <span class="lp-ref">(Format appending command)</span>
+ <span class="ref" >(Format appending command)</span>
},
.ref =&#62; {
- <span class="lp-ref">(Format reference command)</span>
+ <span class="ref" >(Format reference command)</span>
},
.end =&#62; {
- <span class="lp-ref">(Format ending command)</span>
+ <span class="ref" >(Format ending command)</span>
},
else =&#62; {
try buffer.append(line);
@@ -548,13 +560,5 @@ try buffer.append(try std.mem.concat(alloc, u8, &#38;[_][]const u8{ line[0..star
<pre><code>try buffer.append(try std.mem.join(alloc, current_name, conf_end));
</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>
+</html> \ No newline at end of file