summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2022-04-01 10:45:42 -0400
committereudoxia <uplink@distress.network>2022-04-01 10:45:42 -0400
commit4ae210e0c2593587dbcb07fe5ed3a7ce687b8d1d (patch)
tree3aaf042b9d17676de930600bb8486e6254501a76
parent175b6c47b15f2d5dc56d106ef044451ed19df4b2 (diff)
software/literary: updated docs
-rwxr-xr-xsoftware/literary/data.html71
-rwxr-xr-xsoftware/literary/log.html29
-rwxr-xr-xsoftware/literary/tangle.html33
-rwxr-xr-xsoftware/literary/weave.html31
4 files changed, 64 insertions, 100 deletions
diff --git a/software/literary/data.html b/software/literary/data.html
index 0019f3e..66ecb30 100755
--- a/software/literary/data.html
+++ b/software/literary/data.html
@@ -9,51 +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">
-<script src="/js/bg.js"></script>
-<title></title>
-<meta name="description" content="" />
-<meta http-equiv="last-modified" content="" />
+<title>data.lp &mdash; DistressNetwork°</title>
+<meta http-equiv="last-modified" content="2022-04-01 10:35:03-04:00" />
+<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>
-<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"></div>
+<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>@= Imports =@
+<pre><code><span class="lp-ref">(Imports)</span>
-@= Processing limits =@
+<span class="lp-ref">(Processing limits)</span>
-@= Formatting keywords =@
+<span class="lp-ref">(Formatting keywords)</span>
-@= Configuration keywords =@
+<span class="lp-ref">(Configuration keywords)</span>
-@= Data structure types =@
+<span class="lp-ref">(Data structure types)</span>
-@= Error set =@
+<span class="lp-ref">(Error set)</span>
-@= Line splitting function =@
+<span class="lp-ref">(Line splitting function)</span>
-@= Configuration searching function =@
+<span class="lp-ref">(Configuration searching function)</span>
-@= Section searching function =@
+<span class="lp-ref">(Section searching function)</span>
-@= Parsing functions =@
+<span class="lp-ref">(Parsing functions)</span>
-@= Code generation functions =@
+<span class="lp-ref">(Code generation functions)</span>
-@= Text generation function =@
+<span class="lp-ref">(Text generation function)</span>
</code></pre>
<h2 id="constants">Constants</h2>
@@ -173,7 +164,7 @@ pub const LineRange = struct {
var buffer = std.ArrayList([]const u8).init(alloc);
defer buffer.deinit();
- @= Split file at each newline =@
+ <span class="lp-ref">(Split file at each newline)</span>
return buffer.toOwnedSlice();
}
@@ -212,7 +203,7 @@ while (iterator.next()) |line| {
return error.NotFound;
}
-@= Auxiliary formatting function =@
+<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>
@@ -256,7 +247,7 @@ while (iterator.next()) |line| {
var sections = std.ArrayList(Section).init(alloc);
defer sections.deinit();
- @= Main parsing routine =@
+ <span class="lp-ref">(Main parsing routine)</span>
return sections.toOwnedSlice();
}
@@ -265,7 +256,7 @@ fn parse_code(lines: [][]const u8, index: u32, alloc: Allocator) !CodeReturn {
var content = std.ArrayList(Content).init(alloc);
defer content.deinit();
- @= Code parsing subroutine =@
+ <span class="lp-ref">(Code parsing subroutine)</span>
return CodeReturn{ .content = content.toOwnedSlice(), .index = i + 1 };
}
@@ -289,9 +280,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)) {
- @= Add new section =@
+ <span class="lp-ref">(Add new section)</span>
} else if (std.mem.startsWith(u8, line, k_add)) {
- @= Append to section =@
+ <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;
@@ -343,11 +334,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)) {
- @= Add reference =@
+ <span class="lp-ref">(Add reference)</span>
} else if (std.mem.eql(u8, line, k_end)) {
break;
} else {
- @= Add literal range =@
+ <span class="lp-ref">(Add literal range)</span>
}
}
</code></pre>
@@ -402,10 +393,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 =&#62; |range| {
- @= Append literal range =@
+ <span class="lp-ref">(Append literal range)</span>
},
.reference =&#62; |name| {
- @= Resolve reference =@
+ <span class="lp-ref">(Resolve reference)</span>
},
};
@@ -445,7 +436,7 @@ try buffer.appendSlice(code);
var buffer = std.ArrayList([]const u8).init(alloc);
defer buffer.deinit();
- @= Process configuration declarations =@
+ <span class="lp-ref">(Process configuration declarations)</span>
var current_name: []const u8 = undefined;
for (lines) |line| {
@@ -455,13 +446,13 @@ try buffer.appendSlice(code);
or std.mem.startsWith(u8, line, kc_ref)) {
continue;
} else if (std.mem.startsWith(u8, line, k_start)) {
- @= Format starting command =@
+ <span class="lp-ref">(Format starting command)</span>
} else if (std.mem.startsWith(u8, line, k_add)) {
- @= Format appending command =@
+ <span class="lp-ref">(Format appending command)</span>
} else if (std.mem.startsWith(u8, line, k_end)) {
- @= Format ending command =@
+ <span class="lp-ref">(Format ending command)</span>
} else if (std.mem.startsWith(u8, std.mem.trimLeft(u8, line, " \t"), k_ref)) {
- @= Format reference command =@
+ <span class="lp-ref">(Format reference command)</span>
} else {
try buffer.append(line);
}
diff --git a/software/literary/log.html b/software/literary/log.html
index c2bffff..9ebf2dc 100755
--- a/software/literary/log.html
+++ b/software/literary/log.html
@@ -9,33 +9,24 @@
<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">
-<script src="/js/bg.js"></script>
-<title></title>
-<meta name="description" content="" />
-<meta http-equiv="last-modified" content="" />
+<title>log.lp &mdash; DistressNetwork°</title>
+<meta http-equiv="last-modified" content="2022-04-01 10:35:03-04:00" />
+<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>
-<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"></div>
+<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>@= Imports =@
+<pre><code><span class="lp-ref">(Imports)</span>
-@= Level setting =@
+<span class="lp-ref">(Level setting)</span>
-@= Logging function =@
+<span class="lp-ref">(Logging function)</span>
</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>
@@ -62,11 +53,11 @@ const Level = std.log.Level;
comptime format: []const u8,
args: anytype,
) void {
- @= Compare with level threshold =@
+ <span class="lp-ref">(Compare with level threshold)</span>
- @= Define message string =@
+ <span class="lp-ref">(Define message string)</span>
- @= Print to console =@
+ <span class="lp-ref">(Print to console)</span>
}
</code></pre>
diff --git a/software/literary/tangle.html b/software/literary/tangle.html
index 9d853fe..1559d31 100755
--- a/software/literary/tangle.html
+++ b/software/literary/tangle.html
@@ -9,44 +9,35 @@
<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">
-<script src="/js/bg.js"></script>
-<title></title>
-<meta name="description" content="" />
-<meta http-equiv="last-modified" content="" />
+<title>tangle.lp &mdash; DistressNetwork°</title>
+<meta http-equiv="last-modified" content="2022-04-01 10:35:03-04:00" />
+<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>
-<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"></div>
+<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>@= Imports =@
+<pre><code><span class="lp-ref">(Imports)</span>
pub fn main() !u8 {
- @= IO initialization =@
+ <span class="lp-ref">(IO initialization)</span>
- @= Allocator initialization =@
+ <span class="lp-ref">(Allocator initialization)</span>
- @= Read file from stdin =@
+ <span class="lp-ref">(Read file from stdin)</span>
- @= Split into lines =@
+ <span class="lp-ref">(Split into lines)</span>
- @= Parse lines into sections =@
+ <span class="lp-ref">(Parse lines into sections)</span>
- @= Generate code =@
+ <span class="lp-ref">(Generate code)</span>
- @= Write to stdout =@
+ <span class="lp-ref">(Write to stdout)</span>
return 0;
}
diff --git a/software/literary/weave.html b/software/literary/weave.html
index 73ae64f..9edd4f1 100755
--- a/software/literary/weave.html
+++ b/software/literary/weave.html
@@ -9,42 +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">
-<script src="/js/bg.js"></script>
-<title></title>
-<meta name="description" content="" />
-<meta http-equiv="last-modified" content="" />
+<title>weave.lp &mdash; DistressNetwork°</title>
+<meta http-equiv="last-modified" content="2022-04-01 10:35:03-04:00" />
+<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>
-<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"></div>
+<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>@= Imports =@
+<pre><code><span class="lp-ref">(Imports)</span>
pub fn main() !u8 {
- @= IO initialization =@
+ <span class="lp-ref">(IO initialization)</span>
- @= Allocator initialization =@
+ <span class="lp-ref">(Allocator initialization)</span>
- @= Read file from stdin =@
+ <span class="lp-ref">(Read file from stdin)</span>
- @= Split into lines =@
+ <span class="lp-ref">(Split into lines)</span>
- @= Generate text =@
+ <span class="lp-ref">(Generate text)</span>
- @= Write to stdout =@
+ <span class="lp-ref">(Write to stdout)</span>
return 0;
}