crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 4a628bc6dc9f994ce67c90d43dd511255c64ef17
parent c3ed327dba04ed8a34f128af3f0da888cfcff01a
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Thu, 20 Jan 2022 18:09:06 -0800

Clarify language

Move from "mailing list" to archive / public inbox

Diffstat:
MREADME.md | 6++----
Mcrabmail.conf | 1+
Mdoc/crabmail-config.5 | 27+++++++++++++++++----------
Mdoc/crabmail-config.5.scd | 23++++++++++++++---------
Msrc/config.rs | 6++++--
5 files changed, 38 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md @@ -20,7 +20,7 @@ EMAIL FOREVER! ## Installation and usage -To use crabmail to host your own archive-first mailing list, check out [Self-hosted Archives-first Mailing Lists in 2022](https://alex.flounder.online/tech/howtolist.gmi) +To use crabmail to host your own public inbox archive-first mailing list, check out [Self-hosted Public Inbox in 2022](https://alex.flounder.online/tech/howtolist.gmi) To install: ``` @@ -47,12 +47,10 @@ Open `site/index.html` in a web browser ## Contributing For patches, use `git-send-email` or `git-format-patch` -to send a patch to the [crabmail mailing list](https://lists.flounder.online/crabmail/) +to send a patch to the [crabmail public inbox](https://lists.flounder.online/crabmail/) `git-format-patch` is preferred for non-trivial or multi-commit changes -You can also use this mailing list for bug reports or questions - ## Etc Crabmail is AGPLv3 licenses, but some files are licensed under 0BSD or other diff --git a/crabmail.conf b/crabmail.conf @@ -1,6 +1,7 @@ base_url=https://lists.flounder.online # Use %s to represent list name email_fmt=lists+%s@flounder.online +title_fmt=%s public inbox description=All my lists reply_add_link=true diff --git a/doc/crabmail-config.5 b/doc/crabmail-config.5 @@ -5,7 +5,7 @@ .nh .ad l .\" Begin generated content: -.TH "crabmail-config" "5" "2022-01-17" +.TH "crabmail-config" "5" "2022-01-21" .P .SH NAME .P @@ -17,7 +17,7 @@ Each file uses an \fIini\fR format defined as follows: key=valuen.\& Keys cannot contain =.\& Values cannot contain n.\& There are no other restrictions.\& .P Section headers are defined by [brackets].\& These are optional, and can define -list-specific configuration +archive-specific configuration .P This variables are often not escaped, so treat this file as trusted input (ie, don'\&t fill in values from user input somehow).\& @@ -28,14 +28,21 @@ don'\&t fill in values from user input somehow).\& .P \fBbase_url\fR .RS 4 -The base URL where your list is hosted, used to generate atom feeds +The base URL where your archive is hosted, used to generate atom feeds .P .RE \fBemail_fmt\fR .RS 4 The structure of how emails are mapped to mail folders, for example -lists+%s@flounder.\&online will replace %s with the list name.\& You can -override this in list-specific configuration +lists+%s@flounder.\&online will replace %s with the archive name.\& You can +override this in archive-specific configuration +.P +.RE +\fBtitle_fmt\fR +.RS 4 +The structure of how names of each mail archive are structured, for example +%s public inbox_ or %s mailing list.\& Will be overwritten if title is set for +individual archives.\& .P .RE \fBdescription\fR @@ -51,23 +58,23 @@ thread context when receiving responses via email.\& TBD: This will allow poorly clients (eg Gmail) to still be threaded properly.\& Default: false .P .RE -.SS LISTS +.SS Archives .P -Each list is specified with a [subsection] header.\& +Each mail archive is specified with a [subsection] header.\& .P \fBtitle\fR .RS 4 -Title of the list.\& Default tile for lists is [list-name] mailing list.\& +Title of the archive.\& Default tile for archives is set by \fBtitle_fmt\fR .P .RE \fBemail\fR .RS 4 -Email of this list.\& Overrides \fBemail_fmt\fR.\& +Email of this archive.\& Overrides \fBemail_fmt\fR.\& .P .RE \fBdescription\fR .RS 4 -A description for your list.\& HTML is allowed.\& +A description for your archive.\& HTML is allowed, but be judicious.\& .P .RE .SH SEE ALSO diff --git a/doc/crabmail-config.5.scd b/doc/crabmail-config.5.scd @@ -10,7 +10,7 @@ Each file uses an _ini_ format defined as follows: key=value\n. Keys cannot contain =. Values cannot contain \n. There are no other restrictions. Section headers are defined by [brackets]. These are optional, and can define -list-specific configuration +archive-specific configuration This variables are often not escaped, so treat this file as trusted input (ie, don't fill in values from user input somehow). @@ -20,12 +20,17 @@ don't fill in values from user input somehow). ## GLOBAL *base_url* - The base URL where your list is hosted, used to generate atom feeds + The base URL where your archive is hosted, used to generate atom feeds *email_fmt* The structure of how emails are mapped to mail folders, for example - lists+%s@flounder.online will replace %s with the list name. You can - override this in list-specific configuration + lists+%s@flounder.online will replace %s with the archive name. You can + override this in archive-specific configuration + +*title_fmt* + The structure of how names of each mail archive are structured, for example + %s public inbox_ or %s mailing list. Will be overwritten if title is set for + individual archives. *description* A description for your homepage, will be displayed as a single line. HTML is @@ -36,18 +41,18 @@ don't fill in values from user input somehow). thread context when receiving responses via email. TBD: This will allow poorly designed clients (eg Gmail) to still be threaded properly. Default: false -## LISTS +## Archives -Each list is specified with a [subsection] header. +Each mail archive is specified with a [subsection] header. *title* - Title of the list. Default tile for lists is [list-name] mailing list. + Title of the archive. Default tile for archives is set by *title_fmt* *email* - Email of this list. Overrides *email_fmt*. + Email of this archive. Overrides *email_fmt*. *description* - A description for your list. HTML is allowed. + A description for your archive. HTML is allowed, but be judicious. # SEE ALSO diff --git a/src/config.rs b/src/config.rs @@ -24,6 +24,7 @@ use std::path::{Path, PathBuf}; #[derive(Default, Debug)] pub struct Config { pub email_fmt: String, + pub title_fmt: String, pub base_url: String, pub description: String, pub out_dir: PathBuf, // TODO rem @@ -39,6 +40,7 @@ impl Config { pub fn match_kv(&mut self, key: &str, value: &str) { match key { "email_fmt" => self.email_fmt = value.to_string(), + "title_fmt" => self.title_fmt = value.to_string(), "base_url" => self.base_url = value.to_string(), "description" => self.description = value.to_string(), "reply_add_link" => self.reply_add_link = value == "true", @@ -50,7 +52,7 @@ impl Config { #[derive(Default, Debug)] pub struct Subsection { pub name: String, // something - pub title: String, // something mailing list + pub title: String, // something mail archive pub email: String, pub description: String, } @@ -77,7 +79,7 @@ impl Config { pub fn default_subsection(&self, name: &str) -> Subsection { Subsection { name: name.to_owned(), - title: format!("{} mailing list", name), + title: self.title_fmt.replace("%s", name), email: self.email_fmt.replace("%s", name), description: String::new(), }