stagit

My fork of stagit

git clone git://git.shimmy1996.com/stagit.git
commit 5d4a393c9dd3c412bfb3094a6321537cfce5cc9b
parent 9a29ca4f359f3f0b8c54248a2d5e3feade824d3c
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
@@ -468,7 +468,7 @@ writeheader(FILE *fp, const char *title)
 	fprintf(fp, "<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s Atom Feed (tags)\" href=\"%stags.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);
@@ -492,13 +492,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
@@ -636,8 +636,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);
@@ -923,7 +921,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);