about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-21 16:58:29 -0400
committerJune McEnroe <june@causal.agency>2021-04-21 16:59:50 -0400
commit2c5451f8d0ba7ffac3b0c117dd66303909e7ea32 (patch)
treed6a8fc4ba69309ac3e0006eb11be3c299214271e
parentParse dates in a hopefully more portable fashion (diff)
downloadbubger-2c5451f8d0ba7ffac3b0c117dd66303909e7ea32.tar.gz
bubger-2c5451f8d0ba7ffac3b0c117dd66303909e7ea32.zip
Omit HTML nav from nested messages
We don't output mbox for nested messages, nor do we necessarily
have a parent message on the same page.
-rw-r--r--archive.h2
-rw-r--r--export.c4
-rw-r--r--html.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/archive.h b/archive.h
index 29833e8..5c7dfcf 100644
--- a/archive.h
+++ b/archive.h
@@ -233,7 +233,7 @@ int atomThreadClose(FILE *file);
 int atomIndexOpen(FILE *file);
 int atomIndexClose(FILE *file);
 
-int htmlMessageOpen(FILE *file, const struct Envelope *envelope);
+int htmlMessageOpen(FILE *file, const struct Envelope *envelope, bool nested);
 int htmlInline(FILE *file, const struct BodyPart *part, const char *content);
 int htmlAttachmentOpen(FILE *file);
 int htmlAttachment(
diff --git a/export.c b/export.c
index ef1d526..bebd524 100644
--- a/export.c
+++ b/export.c
@@ -260,7 +260,7 @@ static int exportHTMLBody(
 	} else if (part->message.structure) {
 		const struct BodyPart *structure = part->message.structure;
 		int error = 0
-			|| htmlMessageOpen(file, part->message.envelope)
+			|| htmlMessageOpen(file, part->message.envelope, true)
 			|| exportHTMLBody(file, envelope, section, structure, body)
 			|| htmlMessageClose(file);
 		return error;
@@ -284,7 +284,7 @@ static void exportHTML(
 	FILE *file = fopen(path, "w");
 	if (!file) err(EX_CANTCREAT, "%s", path);
 
-	int error = htmlMessageOpen(file, envelope);
+	int error = htmlMessageOpen(file, envelope, false);
 	if (error) err(EX_IOERR, "%s", path);
 
 	struct List section = {0};
diff --git a/html.c b/html.c
index 34ffb16..c3b47fd 100644
--- a/html.c
+++ b/html.c
@@ -180,7 +180,7 @@ int htmlMessageNav(FILE *file, const struct Envelope *envelope) {
 	return error;
 }
 
-int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
+int htmlMessageOpen(FILE *file, const struct Envelope *envelope, bool nested) {
 	char *fragment = htmlFragment(envelope->messageID);
 	char *mailto = htmlMailto(envelope->from);
 	const char *template = Q(
@@ -206,7 +206,7 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 		|| templateRender(file, template, vars, escapeXML)
 		|| htmlAddressList(file, "To", envelope->to)
 		|| htmlAddressList(file, "Cc", envelope->cc)
-		|| htmlMessageNav(file, envelope)
+		|| (nested ? 0 : htmlMessageNav(file, envelope))
 		|| templateRender(file, Q(</header>), NULL, NULL);
 	free(fragment);
 	free(mailto);
2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe God that makes the lexers so much simpler. 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future. 2021-01-12Split fields by tab onlyJune McEnroe Also don't fail hard on non-forward-search definitions. 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe