From de0ece10e2db3c489277c21084355322c111e321 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 15 Feb 2023 03:30:52 +0000 Subject: [PATCH] Use generated tables instead of hand-crafted tables. --- site/index.html | 180 +------------------------------------------- tools/bin/man-table | 34 +++++++++ tools/bin/td | 5 +- 3 files changed, 40 insertions(+), 179 deletions(-) create mode 100755 tools/bin/man-table diff --git a/site/index.html b/site/index.html index fbdf38e..409b4d2 100644 --- a/site/index.html +++ b/site/index.html @@ -118,188 +118,12 @@ configure it, as well as contribute to the project. The man pages are also available online for convenience:

User Documentation:

- - - - - - - - - - - - - - - - - - - - - - - - - -
Man PageDescription
telodendria(7) -Start here. This page contains the project introduction, and provides -information about it, such as its status, how to contact the developers, and what -the source code license is. -
telodendria(8) -Command line usage for Telodendria administrators. -
telodendria.conf(5) -Configuration file options. -
telodendria-contributing(7) -Contributing guide. -
telodendria-changelog(7) -The change log for the Telodendria project. -
+${USER_DOCS}

Developer Documentation:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Man PageDescription
porting(7) -Want to package Telodendria for your operating system? -Look no further than this page. -
td(8) -Build script and patch generation instructions. -
send-patch(8) -A simple script to send patch files to the Telodendria project. -
Array(3) -Dynamically-sized array API. -
Base64(3) -Base64 implementation with Matrix's "unpadded base64" support. -
HashMap(3) -A simple hash map implementation. -
Queue(3) -Basic fixed-size circular queue implementation. -
Log(3) -Logging framework used to log messages in Telodendria. -
Util(3) -Misc utility functions that don't need their own header. -
Db(3) -A minimal flat-file database with object locking and an efficient -cache. -
Memory(3) -Smart memory management API. -
Json(3) -A feature-complete API for reading and writing JSON. -
CanonicalJson(3) -An extension to the Json API that implements Matrix's canonical JSON. -
TelodendriaConfig(3) -Parse the configuration file into a structure. -
Matrix(3) -Functions for writing Matrix API endpoints. -
Routes(3) -Matrix API endpoint abstractions. -
Http(3) -Encode and decode various parts of the HTTP protocol. -
HttpServer(3) -Extremely simple HTTP server. -
Sha2(3) -A simple implementation of the SHA2 hashing functions. -
Cron(3) -A basic periodic job scheduler. -
User(3) -Convenience functions for working with local users. -
Str(3) -Functions for manipulating and creating strings. -
+${DEV_DOCS}

diff --git a/tools/bin/man-table b/tools/bin/man-table new file mode 100755 index 0000000..ede9878 --- /dev/null +++ b/tools/bin/man-table @@ -0,0 +1,34 @@ +#!/usr/bin/env sh + +printf "" +printf "" +printf "" +printf "" +printf "" + +find man -type f -name '*.[1-9]' | while IFS= read -r file; do + base=$(basename "$file") + + name=$(echo "$base" | cut -d '.' -f 1) + section=$(echo "$base" | cut -d '.' -f 2) + description=$(grep '^\.Nd' "$file" | cut -d ' ' -f 2-) + + prefix=$(echo "$name" | cut -d '-' -f 1) + + if [ "$prefix" = "telodendria" ]; then + if [ "$1" = "dev" ]; then + continue + fi + else + if [ "$1" = "user" ]; then + continue + fi + fi + + printf "" + printf "" + printf "" + printf "" +done + +printf "
Man PageDescription
$name($section)$description
" diff --git a/tools/bin/td b/tools/bin/td index 8fb7188..3f04156 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -71,7 +71,7 @@ setsubst() { ( set | while IFS='=' read -r var val; do - val=$(echo "$val" | cut -d "'" -f 2) + val=$(echo "$val" | cut -d "'" -f 2- | rev | cut -d "'" -f 2- | rev) echo "s|\\\${$var}|$val|g" done @@ -164,7 +164,10 @@ recipe_site() { exit 1 fi + # Set some variables that may be replaced in the files. DATE=$(date) + USER_DOCS=$(man-table user) + DEV_DOCS=$(man-table dev) cd site/ find . -type f | while IFS= read -r file; do