commit d6bba896adc2a6217adb2e9db3e97daf8c4d2657
parent 5ee11d339bfeb78a5d38fdaab3db0ce160cc01a9
Author: root <root>
Date: Sun, 20 Apr 2025 14:14:22 +0200
minor customizations
Diffstat:
6 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/stagit b/stagit
Binary files differ.
diff --git a/stagit-index b/stagit-index
Binary files differ.
diff --git a/stagit-index.c b/stagit-index.c
@@ -103,12 +103,11 @@ writeheader(FILE *fp)
xmlencode(fp, description, strlen(description));
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);
- fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
- "<td><span class=\"desc\">", relpath);
+ fputs("</head>\n<body><div class=\"main-container\">\n", fp);
+ fputs("<table>\n<tr><td><span class=\"repotitle\">", fp);
xmlencode(fp, description, strlen(description));
fputs("</span></td></tr><tr><td></td><td>\n"
- "</td></tr>\n</table>\n<hr/>\n<div id=\"content\">\n"
+ "</td></tr>\n</table>\n<hr/>\n<div id=\"content\" class=\"git-content\">\n"
"<table id=\"index\"><thead>\n"
"<tr><td><b>Name</b></td><td><b>Description</b></td><td><b>Owner</b></td>"
"<td><b>Last commit</b></td></tr>"
@@ -118,7 +117,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</div>\n</div></body>\n</html>\n", fp);
}
int
diff --git a/stagit-index.o b/stagit-index.o
Binary files differ.
diff --git a/stagit.c b/stagit.c
@@ -519,21 +519,14 @@ writeheader(FILE *fp, const char *title)
xmlencode(fp, name, strlen(name));
fprintf(fp, " Atom Feed (tags)\" href=\"%stags.xml\" />\n", relpath);
fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
- fputs("</head>\n<body>\n<table><tr><td>", fp);
- fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
- relpath, relpath);
- fputs("</td><td><h1>", fp);
+ fputs("</head>\n<body><div class=\"main-container\">\n<table><tr>", fp);
+// fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
+// relpath, relpath);
+ fputs("<td><h1><a href=\"/\">", fp);
xmlencode(fp, strippedname, strlen(strippedname));
- fputs("</h1><span class=\"desc\">", fp);
+ fputs("</a></h1><span class=\"desc\">", fp);
xmlencode(fp, description, strlen(description));
fputs("</span></td></tr>", fp);
- if (cloneurl[0]) {
- fputs("<tr class=\"url\"><td></td><td>git clone <a href=\"", fp);
- xmlencode(fp, cloneurl, strlen(cloneurl)); /* not percent-encoded */
- fputs("\">", fp);
- xmlencode(fp, cloneurl, strlen(cloneurl));
- fputs("</a></td></tr>", fp);
- }
fputs("<tr><td></td><td>\n", fp);
fprintf(fp, "<a href=\"%slog.html\">Log</a> | ", relpath);
fprintf(fp, "<a href=\"%sfiles.html\">Files</a> | ", relpath);
@@ -547,20 +540,21 @@ writeheader(FILE *fp, const char *title)
if (license)
fprintf(fp, " | <a href=\"%sfile/%s.html\">LICENSE</a>",
relpath, license);
- fputs("</td></tr></table>\n<hr/>\n<div id=\"content\">\n", fp);
+ fputs("</td></tr></table>\n<hr/>\n<div id=\"content\" class=\"git-content\">\n", fp);
}
void
writefooter(FILE *fp)
{
- fputs("</div>\n</body>\n</html>\n", fp);
+ fputs("</div>\n</div></body>\n</html>\n", fp);
}
size_t
writeblobhtml(FILE *fp, const git_blob *blob)
{
size_t n = 0, i, len, prev;
- const char *nfmt = "<a href=\"#l%zu\" class=\"line\" id=\"l%zu\">%7zu</a> ";
+// const char *nfmt = "<a href=\"#l%zu\" class=\"line\" id=\"l%zu\">%7zu</a> ";
+ const char *nfmt = "<span class=\"dummy\"></span>";
const char *s = git_blob_rawcontent(blob);
len = git_blob_rawsize(blob);
@@ -571,7 +565,8 @@ writeblobhtml(FILE *fp, const git_blob *blob)
if (s[i] != '\n')
continue;
n++;
- fprintf(fp, nfmt, n, n, n);
+// fprintf(fp, nfmt, n, n, n);
+ fputs(nfmt, fp);
xmlencodeline(fp, &s[prev], i - prev + 1);
putc('\n', fp);
prev = i + 1;
@@ -718,25 +713,23 @@ printshowfile(FILE *fp, struct commitinfo *ci)
if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
break;
- fprintf(fp, "<a href=\"#h%zu-%zu\" id=\"h%zu-%zu\" class=\"h\">", i, j, i, j);
+ fputs("<span>", fp);
xmlencode(fp, hunk->header, hunk->header_len);
- fputs("</a>", fp);
+ fputs("</span>", fp);
for (k = 0; ; k++) {
if (git_patch_get_line_in_hunk(&line, patch, j, k))
break;
if (line->old_lineno == -1)
- fprintf(fp, "<a href=\"#h%zu-%zu-%zu\" id=\"h%zu-%zu-%zu\" class=\"i\">+",
- i, j, k, i, j, k);
+ fputs("<span class=\"i\">+", fp);
else if (line->new_lineno == -1)
- fprintf(fp, "<a href=\"#h%zu-%zu-%zu\" id=\"h%zu-%zu-%zu\" class=\"d\">-",
- i, j, k, i, j, k);
+ fputs("<span class=\"d\">-", fp);
else
putc(' ', fp);
xmlencodeline(fp, line->content, line->content_len);
putc('\n', fp);
if (line->old_lineno == -1 || line->new_lineno == -1)
- fputs("</a>", fp);
+ fputs("</span>", fp);
}
}
}
diff --git a/stagit.o b/stagit.o
Binary files differ.