stagit-responsive

My mobile friendly fork of stagit
Log | Files | Refs | README | LICENSE

commit a8318e0499e4de4b09846a99e04dec36c3c6ac0f
parent e0196e450dee04886976926d0a246caaa9b20740
Author: Yohanes Bandung <hi@ybbond.dev>
Date:   Tue, 19 May 2020 18:40:27 +0700

feature: make targeting commit log possible

Diffstat:
Mstagit.c | 7+++++--
Mstyle.css | 2+-

2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/stagit.c b/stagit.c
@@ -582,7 +582,9 @@ printshowfile(FILE *fp, struct commitinfo *ci)
 void
 writelogline(FILE *fp, struct commitinfo *ci)
 {
-	fputs("<tr><td>", fp);
+	fprintf(fp, "<tr id=\"%s\">"
+		"<td><a href=\"#%s\">#</a></td>"
+		"<td>", ci->oid, ci->oid);
 	if (ci->author)
 		printtimeshort(fp, &(ci->author->when));
 	fputs("</td><td>", fp);
@@ -1189,7 +1191,8 @@ main(int argc, char *argv[])
 	relpath = "";
 	mkdir("commit", S_IRWXU | S_IRWXG | S_IRWXO);
 	writeheader(fp, "Log");
-	fputs("<div id=\"table-scroll\"><table id=\"log\"><thead>\n<tr><th>Date</th>"
+	fputs("<div id=\"table-scroll\"><table id=\"log\"><thead>\n<tr><th>"
+				"<a href=\"#\">🔗</a></th><th>Date</th>"
 	      "<th>Commit message</th>"
 	      "<th>Author</th><td class=\"num\"><b>Files</th>"
 	      "<td class=\"num\" id=\"plus\"><b>+</th>"
diff --git a/style.css b/style.css
@@ -26,7 +26,7 @@ min, a:hover {
 	color: #F9690E;
 }
 
-a:target {
+a:target, tr:target {
 	background-color: #303030;
 }