summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2022-05-02 12:37:11 -0400
committereudoxia <uplink@distress.network>2022-05-02 12:37:11 -0400
commitfcd667a0ebe73a7868e93232faea36d56535be18 (patch)
tree99a5b5620d96943d9d9b5bc232f242b473c278ef
parent3fa27d49be472c28d0c4eaed776804e39c7f8bee (diff)
reorganised docs locations (doc/* -> doc/online/*, doc/freestanding/* -> doc/*)
-rw-r--r--[-rwxr-xr-x]doc/data.html126
-rw-r--r--[-rwxr-xr-x]doc/log.html64
-rwxr-xr-x[-rw-r--r--]doc/online/data.html (renamed from doc/freestanding/data.html)126
-rw-r--r--doc/online/header (renamed from doc/header)0
-rwxr-xr-x[-rw-r--r--]doc/online/log.html (renamed from doc/freestanding/log.html)64
-rwxr-xr-x[-rw-r--r--]doc/online/tangle.html (renamed from doc/freestanding/tangle.html)68
-rwxr-xr-x[-rw-r--r--]doc/online/weave.html (renamed from doc/freestanding/weave.html)66
-rw-r--r--[-rwxr-xr-x]doc/tangle.html68
-rwxr-xr-xdoc/usage.md4
-rw-r--r--[-rwxr-xr-x]doc/weave.html66
-rwxr-xr-xgen-docs.sh25
-rwxr-xr-xgen-freestanding.sh11
-rwxr-xr-xgen-online.sh26
13 files changed, 357 insertions, 357 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
diff --git a/doc/log.html b/doc/log.html
index 59e9627..3e32826 100755..100644
--- a/doc/log.html
+++ b/doc/log.html
@@ -3,37 +3,49 @@
<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>log.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">log.lp</div>
-<hr>
+<h1>log.lp</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">(License)</span>
+<pre><code><span class="ref" >(License)</span>
-<span class="lp-ref">(Imports)</span>
+<span class="ref" >(Imports)</span>
-<span class="lp-ref">(Level setting)</span>
+<span class="ref" >(Level setting)</span>
-<span class="lp-ref">(Logging function)</span>
+<span class="ref" >(Logging 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>
<p>We first import the standard library, and the <code>Level</code> type which is an enum representing the possible log levels.</p>
@@ -60,11 +72,11 @@ const Level = std.log.Level;
comptime format: []const u8,
args: anytype,
) void {
- <span class="lp-ref">(Compare with level threshold)</span>
+ <span class="ref" >(Compare with level threshold)</span>
- <span class="lp-ref">(Define message string)</span>
+ <span class="ref" >(Define message string)</span>
- <span class="lp-ref">(Print to console)</span>
+ <span class="ref" >(Print to console)</span>
}
</code></pre>
@@ -93,13 +105,5 @@ const Level = std.log.Level;
<pre><code>const stderr = std.io.getStdErr().writer();
nosuspend stderr.print(msg, args) catch return;
</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
diff --git a/doc/freestanding/data.html b/doc/online/data.html
index 05bc7cf..9fddef4 100644..100755
--- a/doc/freestanding/data.html
+++ b/doc/online/data.html
@@ -3,69 +3,57 @@
<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>
+<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>
</head>
-
<body>
-<h1>data.lp</h1>
+<div class="contentlevel">
+<main>
+<div class="leading">data.lp</div>
+<hr>
<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" >(License)</span>
+<pre><code><span class="lp-ref">(License)</span>
-<span class="ref" >(Imports)</span>
+<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" >(Command type detection function)</span>
+<span class="lp-ref">(Command type detection 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>
<h3 id="license">License:</h3>
-<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;.
+<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/.
</code></pre>
<h2 id="constants">Constants</h2>
@@ -185,7 +173,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();
}
@@ -220,11 +208,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>
@@ -252,7 +240,7 @@ 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;
}
</code></pre>
@@ -288,7 +276,7 @@ fn command_type(line: []const u8) CommandType {
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();
}
@@ -297,7 +285,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 };
}
@@ -322,10 +310,10 @@ while (i &#60; lines.len) {
const line = lines[i];
switch (command_type(line)) {
.start =&#62; {
- <span class="ref" >(Add new section)</span>
+ <span class="lp-ref">(Add new section)</span>
},
.add =&#62; {
- <span class="ref" >(Append to section)</span>
+ <span class="lp-ref">(Append to section)</span>
},
.end =&#62; {
log(.err, "line {d}: unexpected section end", .{i + 1});
@@ -343,12 +331,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>
@@ -357,7 +345,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);
@@ -365,7 +353,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>
@@ -382,13 +370,13 @@ while (i &#60; lines.len) {
return error.UnexpectedStart;
},
.ref =&#62; {
- <span class="ref" >(Add reference)</span>
+ <span class="lp-ref">(Add reference)</span>
},
.end =&#62; {
break;
},
else =&#62; {
- <span class="ref" >(Add literal range)</span>
+ <span class="lp-ref">(Add literal range)</span>
},
}
}
@@ -400,7 +388,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>
@@ -441,17 +429,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>
@@ -487,7 +475,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| {
@@ -498,16 +486,16 @@ try buffer.appendSlice(code);
continue;
} else switch (command_type(line)) {
.start =&#62; {
- <span class="ref" >(Format starting command)</span>
+ <span class="lp-ref">(Format starting command)</span>
},
.add =&#62; {
- <span class="ref" >(Format appending command)</span>
+ <span class="lp-ref">(Format appending command)</span>
},
.ref =&#62; {
- <span class="ref" >(Format reference command)</span>
+ <span class="lp-ref">(Format reference command)</span>
},
.end =&#62; {
- <span class="ref" >(Format ending command)</span>
+ <span class="lp-ref">(Format ending command)</span>
},
else =&#62; {
try buffer.append(line);
@@ -560,5 +548,13 @@ 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> \ No newline at end of file
+</html>
diff --git a/doc/header b/doc/online/header
index fcecc47..fcecc47 100644
--- a/doc/header
+++ b/doc/online/header
diff --git a/doc/freestanding/log.html b/doc/online/log.html
index 3e32826..59e9627 100644..100755
--- a/doc/freestanding/log.html
+++ b/doc/online/log.html
@@ -3,49 +3,37 @@
<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>log.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>
</head>
-
<body>
-<h1>log.lp</h1>
+<div class="contentlevel">
+<main>
+<div class="leading">log.lp</div>
+<hr>
<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="ref" >(License)</span>
+<pre><code><span class="lp-ref">(License)</span>
-<span class="ref" >(Imports)</span>
+<span class="lp-ref">(Imports)</span>
-<span class="ref" >(Level setting)</span>
+<span class="lp-ref">(Level setting)</span>
-<span class="ref" >(Logging function)</span>
+<span class="lp-ref">(Logging function)</span>
</code></pre>
<h3 id="license">License:</h3>
-<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;.
+<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/.
</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>
@@ -72,11 +60,11 @@ const Level = std.log.Level;
comptime format: []const u8,
args: anytype,
) void {
- <span class="ref" >(Compare with level threshold)</span>
+ <span class="lp-ref">(Compare with level threshold)</span>
- <span class="ref" >(Define message string)</span>
+ <span class="lp-ref">(Define message string)</span>
- <span class="ref" >(Print to console)</span>
+ <span class="lp-ref">(Print to console)</span>
}
</code></pre>
@@ -105,5 +93,13 @@ const Level = std.log.Level;
<pre><code>const stderr = std.io.getStdErr().writer();
nosuspend stderr.print(msg, args) catch return;
</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>
diff --git a/doc/freestanding/tangle.html b/doc/online/tangle.html
index 85ede91..02e5905 100644..100755
--- a/doc/freestanding/tangle.html
+++ b/doc/online/tangle.html
@@ -3,54 +3,42 @@
<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>tangle.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>
</head>
-
<body>
-<h1>tangle.lp</h1>
+<div class="contentlevel">
+<main>
+<div class="leading">tangle.lp</div>
+<hr>
<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="ref" >(License)</span>
+<pre><code><span class="lp-ref">(License)</span>
-<span class="ref" >(Imports)</span>
+<span class="lp-ref">(Imports)</span>
pub fn main() !u8 {
- <span class="ref" >(IO initialization)</span>
+ <span class="lp-ref">(IO initialization)</span>
- <span class="ref" >(Allocator initialization)</span>
+ <span class="lp-ref">(Allocator initialization)</span>
- <span class="ref" >(Read file from stdin)</span>
+ <span class="lp-ref">(Read file from stdin)</span>
- <span class="ref" >(Split into lines)</span>
+ <span class="lp-ref">(Split into lines)</span>
- <span class="ref" >(Parse lines into sections)</span>
+ <span class="lp-ref">(Parse lines into sections)</span>
- <span class="ref" >(Generate code)</span>
+ <span class="lp-ref">(Generate code)</span>
- <span class="ref" >(Write to stdout)</span>
+ <span class="lp-ref">(Write to stdout)</span>
return 0;
}
@@ -58,8 +46,8 @@ pub fn main() !u8 {
<h3 id="license">License:</h3>
-<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;.
+<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/.
</code></pre>
<p>First we import the other files containing the core functions.</p>
@@ -144,5 +132,13 @@ defer arena.deinit();
try stdout.writer().print("{s}\n", .{line});
}
</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>
diff --git a/doc/freestanding/weave.html b/doc/online/weave.html
index 9e851ba..59fc750 100644..100755
--- a/doc/freestanding/weave.html
+++ b/doc/online/weave.html
@@ -3,52 +3,40 @@
<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>weave.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>
</head>
-
<body>
-<h1>weave.lp</h1>
+<div class="contentlevel">
+<main>
+<div class="leading">weave.lp</div>
+<hr>
<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="ref" >(License)</span>
+<pre><code><span class="lp-ref">(License)</span>
-<span class="ref" >(Imports)</span>
+<span class="lp-ref">(Imports)</span>
pub fn main() !u8 {
- <span class="ref" >(IO initialization)</span>
+ <span class="lp-ref">(IO initialization)</span>
- <span class="ref" >(Allocator initialization)</span>
+ <span class="lp-ref">(Allocator initialization)</span>
- <span class="ref" >(Read file from stdin)</span>
+ <span class="lp-ref">(Read file from stdin)</span>
- <span class="ref" >(Split into lines)</span>
+ <span class="lp-ref">(Split into lines)</span>
- <span class="ref" >(Generate text)</span>
+ <span class="lp-ref">(Generate text)</span>
- <span class="ref" >(Write to stdout)</span>
+ <span class="lp-ref">(Write to stdout)</span>
return 0;
}
@@ -56,8 +44,8 @@ pub fn main() !u8 {
<h3 id="license">License:</h3>
-<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;.
+<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/.
</code></pre>
<p>First we import the other files containing the core functions.</p>
@@ -128,5 +116,13 @@ defer arena.deinit();
try stdout.writer().print("{s}\n", .{line});
}
</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>
diff --git a/doc/tangle.html b/doc/tangle.html
index 02e5905..85ede91 100755..100644
--- a/doc/tangle.html
+++ b/doc/tangle.html
@@ -3,42 +3,54 @@
<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>tangle.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">tangle.lp</div>
-<hr>
+<h1>tangle.lp</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">(License)</span>
+<pre><code><span class="ref" >(License)</span>
-<span class="lp-ref">(Imports)</span>
+<span class="ref" >(Imports)</span>
pub fn main() !u8 {
- <span class="lp-ref">(IO initialization)</span>
+ <span class="ref" >(IO initialization)</span>
- <span class="lp-ref">(Allocator initialization)</span>
+ <span class="ref" >(Allocator initialization)</span>
- <span class="lp-ref">(Read file from stdin)</span>
+ <span class="ref" >(Read file from stdin)</span>
- <span class="lp-ref">(Split into lines)</span>
+ <span class="ref" >(Split into lines)</span>
- <span class="lp-ref">(Parse lines into sections)</span>
+ <span class="ref" >(Parse lines into sections)</span>
- <span class="lp-ref">(Generate code)</span>
+ <span class="ref" >(Generate code)</span>
- <span class="lp-ref">(Write to stdout)</span>
+ <span class="ref" >(Write to stdout)</span>
return 0;
}
@@ -46,8 +58,8 @@ pub fn main() !u8 {
<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>
<p>First we import the other files containing the core functions.</p>
@@ -132,13 +144,5 @@ defer arena.deinit();
try stdout.writer().print("{s}\n", .{line});
}
</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
diff --git a/doc/usage.md b/doc/usage.md
index 0cc9632..a008409 100755
--- a/doc/usage.md
+++ b/doc/usage.md
@@ -8,7 +8,7 @@ This tool consists of two programs, `tangle` and `weave`, both of which accept a
## Usage
-These programs are intended to be intermediary text processing functions, used as components within build automation routines or shell scripts. The build processes for this tool itself, `build.sh` and `gen-freestanding.sh`, serve as example use cases.
+These programs are intended to be intermediary text processing functions, used as components within build automation routines or shell scripts. The build processes for this tool itself, `build.sh` and `gen-docs.sh`, serve as example use cases.
# Dependencies
@@ -78,7 +78,7 @@ The format strings may contain the following control sequences:
# Literate Source Code
-The source code of this tool is rendered as a set of literate program documents, listed below. Additionally, freestanding versions of these documents exist in the `doc/freestanding` source directory for offline use.
+The source code of this tool is rendered as a set of literate program documents, listed below.
- [data.lp](/software/literary/data.html)
- [log.lp](/software/literary/log.html)
diff --git a/doc/weave.html b/doc/weave.html
index 59fc750..9e851ba 100755..100644
--- a/doc/weave.html
+++ b/doc/weave.html
@@ -3,40 +3,52 @@
<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>weave.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">weave.lp</div>
-<hr>
+<h1>weave.lp</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">(License)</span>
+<pre><code><span class="ref" >(License)</span>
-<span class="lp-ref">(Imports)</span>
+<span class="ref" >(Imports)</span>
pub fn main() !u8 {
- <span class="lp-ref">(IO initialization)</span>
+ <span class="ref" >(IO initialization)</span>
- <span class="lp-ref">(Allocator initialization)</span>
+ <span class="ref" >(Allocator initialization)</span>
- <span class="lp-ref">(Read file from stdin)</span>
+ <span class="ref" >(Read file from stdin)</span>
- <span class="lp-ref">(Split into lines)</span>
+ <span class="ref" >(Split into lines)</span>
- <span class="lp-ref">(Generate text)</span>
+ <span class="ref" >(Generate text)</span>
- <span class="lp-ref">(Write to stdout)</span>
+ <span class="ref" >(Write to stdout)</span>
return 0;
}
@@ -44,8 +56,8 @@ pub fn main() !u8 {
<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>
<p>First we import the other files containing the core functions.</p>
@@ -116,13 +128,5 @@ defer arena.deinit();
try stdout.writer().print("{s}\n", .{line});
}
</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
diff --git a/gen-docs.sh b/gen-docs.sh
index 6dcd149..5dfd166 100755
--- a/gen-docs.sh
+++ b/gen-docs.sh
@@ -1,26 +1,11 @@
#!/bin/sh -e
-# This script solely generates the formatted code as hosted on the distress.network website. It is thus not intended for actual use by anyone other than the site owner.
-
-tmp=$(mktemp -p /tmp)
-css="h3,.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-size: 1rem; font-weight: normal; font-style: italic;} h3 {margin: 1rem;}"
-
for file in "data" "log" "tangle" "weave" ; do
in="${file}.lp" ; out="doc/${file}.html" ;
- cat "doc/header" "$in" | ./weave > "$tmp" ;
- sed "s;title: ;&${in};1" -i'' "$tmp" ;
- sed "s;leading: ;&${in};1" -i'' "$tmp" ;
-
- pushd "../web" > "/dev/null" ;
- sh "./md.sh" "$tmp" "../literary/$out" > "/dev/null" ;
- popd > "/dev/null" ;
- sed "/<meta http-equiv=/d" -i'' "$out" ;
- sed "s~</head>~<style>${css}</style>\n&~1" -i'' "$out" ;
- sed 's;\(.*\)@= \(.*\) =@;\1<span class="lp-ref">(\2)</span>;1' -i'' "$out" ;
-
+ cp "doc/header-html" "$out" ;
+ printf "<h1>${in}</h1>\n" >> "$out" ;
+ cat "doc/header-lp" "$in" | ./weave | lowdown -Thtml >> "$out" ;
+ printf "</body>\n</html>" >> "$out" ;
+ sed 's/\(.*\)@= \(.*\) =@/\1<span class="ref" >(\2)<\/span>/1' -i'' "$out" ;
echo "[ok] generated text '${file}'" ;
done
-
-sh "./../sync.sh"
-
-rm "$tmp"
diff --git a/gen-freestanding.sh b/gen-freestanding.sh
deleted file mode 100755
index 9477463..0000000
--- a/gen-freestanding.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -e
-
-for file in "data" "log" "tangle" "weave" ; do
- in="${file}.lp" ; out="doc/freestanding/${file}.html" ;
- cp "doc/header-html" "$out" ;
- printf "<h1>${in}</h1>\n" >> "$out" ;
- cat "doc/header-lp" "$in" | ./weave | lowdown -Thtml >> "$out" ;
- printf "</body>\n</html>" >> "$out" ;
- sed 's/\(.*\)@= \(.*\) =@/\1<span class="ref" >(\2)<\/span>/1' -i'' "$out" ;
- echo "[ok] generated text '${file}'" ;
-done
diff --git a/gen-online.sh b/gen-online.sh
new file mode 100755
index 0000000..4ba5a5b
--- /dev/null
+++ b/gen-online.sh
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+# This script solely generates the formatted code as hosted on the distress.network website. It is thus not intended for actual use by anyone other than the site owner.
+
+tmp=$(mktemp -p /tmp)
+css="h3,.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-size: 1rem; font-weight: normal; font-style: italic;} h3 {margin: 1rem;}"
+
+for file in "data" "log" "tangle" "weave" ; do
+ in="${file}.lp" ; out="doc/online/${file}.html" ;
+ cat "doc/online/header" "$in" | ./weave > "$tmp" ;
+ sed "s;title: ;&${in};1" -i'' "$tmp" ;
+ sed "s;leading: ;&${in};1" -i'' "$tmp" ;
+
+ pushd "../web" > "/dev/null" ;
+ sh "./md.sh" "$tmp" "../literary/$out" > "/dev/null" ;
+ popd > "/dev/null" ;
+ sed "/<meta http-equiv=/d" -i'' "$out" ;
+ sed "s~</head>~<style>${css}</style>\n&~1" -i'' "$out" ;
+ sed 's;\(.*\)@= \(.*\) =@;\1<span class="lp-ref">(\2)</span>;1' -i'' "$out" ;
+
+ echo "[ok] generated text '${file}'" ;
+done
+
+sh "./../sync.sh"
+
+rm "$tmp"