stagit

My fork of stagit

git clone git://git.shimmy1996.com/stagit.git
commit 7392fa22157e0c6e28a00d48ecd52fb1d3a5e378
parent cfd2d23d1a7cdf6e78e35b5ac7ae53d36970b2dc
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun,  5 Apr 2020 09:41:17 -0500

Replace div with HTML5 sections

Diffstat:
Mstagit-index.c | 6+++---
Mstagit.c | 10++++------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/stagit-index.c b/stagit-index.c
@@ -72,12 +72,12 @@ writeheader(FILE *fp)
 	xmlencode(fp, title, strlen(title));
 	fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
 	fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
-	fputs("</head>\n<body>\n", fp);
+	fputs("</head>\n<body>\n<header>\n", fp);
     fprintf(fp, "<h1>%s</h1>\n", title);
     fprintf(fp, "<p>");
 	xmlencode(fp, description, strlen(description));
 	fputs("</p>\n"
-		"<hr/>\n<div id=\"content\">\n"
+		"</header>\n<main>\n"
 		"<table id=\"index\"><thead><tr>\n"
 		"<th>Name</th><th>Description</th><th>Owner</th><th>Last commit</th>"
 		"</tr></thead><tbody>\n", fp);
@@ -86,7 +86,7 @@ writeheader(FILE *fp)
 void
 writefooter(FILE *fp)
 {
-	fputs("</tbody>\n</table>\n</div>\n</body>\n</html>\n", fp);
+	fputs("</tbody>\n</table>\n</main>\n</body>\n</html>\n", fp);
 }
 
 int
diff --git a/stagit.c b/stagit.c
@@ -362,7 +362,7 @@ writeheader(FILE *fp, const char *title)
 	fprintf(fp, "<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s Atom Feed\" href=\"%satom.xml\" />\n",
 		name, relpath);
 	fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
-	fputs("</head>\n<body>\n<nav>", fp);
+	fputs("</head>\n<body>\n<header>\n<nav>", fp);
 	fprintf(fp, "<a href=\"../%s\">←Trantor Holocron</a> | ", relpath);
 	fprintf(fp, "<a href=\"%slog.html\">Log</a> | ", relpath);
 	fprintf(fp, "<a href=\"%sfiles.html\">Files</a> | ", relpath);
@@ -386,13 +386,13 @@ writeheader(FILE *fp, const char *title)
 		xmlencode(fp, cloneurl, strlen(cloneurl));
 		fputs("</pre>", fp);
 	}
-	fputs("\n<hr/>\n<div id=\"content\">\n", fp);
+	fputs("\n</header>\n<main>\n", fp);
 }
 
 void
 writefooter(FILE *fp)
 {
-	fputs("</div>\n</body>\n</html>\n", fp);
+	fputs("</main>\n</body>\n</html>\n", fp);
 }
 
 int
@@ -530,8 +530,6 @@ printshowfile(FILE *fp, struct commitinfo *ci)
 	        ci->addcount,  ci->addcount  == 1 ? "" : "s",
 	        ci->delcount,  ci->delcount  == 1 ? "" : "s");
 
-	fputs("<hr/>", fp);
-
 	for (i = 0; i < ci->ndeltas; i++) {
 		patch = ci->deltas[i]->patch;
 		delta = git_patch_get_delta(patch);
@@ -802,7 +800,7 @@ writeblob(git_object *obj, const char *fpath, const char *filename, git_off_t fi
 	fputs("<p> ", fp);
 	xmlencode(fp, filename, strlen(filename));
 	fprintf(fp, " (%juB)", (uintmax_t)filesize);
-	fputs("</p><hr/>", fp);
+	fputs("</p>", fp);
 
 	if (git_blob_is_binary((git_blob *)obj)) {
 		fputs("<p>Binary file.</p>\n", fp);