ctucx.git: stagit

ctucx' stagit fork

commit 94aabf32924783829c9db7a602cd31423eca9a52
parent 403caa5e9fb401e8b8aa62fc02ab60c60568b6d0
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 24 May 2022 12:30:11 +0200

writeblob: refactor html output
1 file changed, 6 insertions(+), 4 deletions(-)
M
stagit.c
|
10
++++++----
diff --git a/stagit.c b/stagit.c
@@ -947,9 +947,11 @@ writeblob(git_object *obj, const char *fpath, const char *rpath, const char *fil
 	relpath = tmp;
 
 	fp = efopen(fpath, "w");
-	fputs("<p> ", fp);
 	writeheader(fp, filename, "tree");
 
+
+	fputs("<div class=\"breadcrumb\">path: ", fp);
+
 	if (parent_path_len > 0) {
 		parent_path_len--;
 

@@ -958,16 +960,16 @@ writeblob(git_object *obj, const char *fpath, const char *rpath, const char *fil
 		fputs(".html\">/", fp);
 		xmlencode(fp, filepath, parent_path_len);
 		fputs("/</a>", fp);
+
 	} else {
 		fprintf(fp, "<a href=\"%stree.html\">/</a>", relpath);
 	}
 
 	xmlencode(fp, filename, strlen(filename));
-	fprintf(fp, " (%zuB)", filesize);
-	fprintf(fp, " - <a href=\"%s%s\">raw</a></p><hr/>", relpath, rpath);
+	fprintf(fp, "<span class=\"right\"> %s | <a href=\"%s%s\">plain</a></span></div><div class=\"clearfix\"></div>\n", format_bytes(filesize), relpath, rpath);
 
 	if (git_blob_is_binary((git_blob *)obj))
-		fputs("<p>Binary file.</p>\n", fp);
+		fputs("<pre>Binary file.</pre>", fp);
 	else
 		lc = writeblobhtml(fp, (git_blob *)obj);