stagit

personal fork of static git page generator
git clone https://a3nm.net/git/stagit/
Log | Files | Refs | README | LICENSE

commit 60943c1dd49dd9d035bc98d5d8df85a12979d8a7
parent 2479f2af3329d06b9af785083d149bb69b1c1f76
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed,  9 May 2018 20:56:37 +0200

fix aligns

Diffstat:
stagit.c | 18+++++++++---------
style.css | 9+++++----
2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/stagit.c b/stagit.c @@ -554,11 +554,11 @@ writelogline(FILE *fp, struct commitinfo *ci) fputs("</td><td>", fp); if (ci->author) xmlencode(fp, ci->author->name, strlen(ci->author->name)); - fputs("</td><td class=\"num\" align=\"right\">", fp); + fputs("</td><td class=\"num\">", fp); fprintf(fp, "%zu", ci->filecount); - fputs("</td><td class=\"num\" align=\"right\">", fp); + fputs("</td><td class=\"num\">", fp); fprintf(fp, "+%zu", ci->addcount); - fputs("</td><td class=\"num\" align=\"right\">", fp); + fputs("</td><td class=\"num\">", fp); fprintf(fp, "-%zu", ci->delcount); fputs("</td></tr>\n", fp); } @@ -850,7 +850,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *path) fputs(filemode(git_tree_entry_filemode(entry)), fp); fprintf(fp, "</td><td><a href=\"%s%s\">", relpath, filepath); xmlencode(fp, entrypath, strlen(entrypath)); - fputs("</a></td><td class=\"num\" align=\"right\">", fp); + fputs("</a></td><td class=\"num\">", fp); if (lc > 0) fprintf(fp, "%dL", lc); else @@ -862,7 +862,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *path) relpath); xmlencode(fp, entrypath, strlen(entrypath)); git_submodule_free(module); - fputs("</a></td><td class=\"num\" align=\"right\"></td></tr>\n", fp); + fputs("</a></td><td class=\"num\"></td></tr>\n", fp); } } @@ -878,7 +878,7 @@ writefiles(FILE *fp, const git_oid *id) fputs("<table id=\"files\"><thead>\n<tr>" "<th>Mode</th><th>Name</th>" - "<th class=\"num\" align=\"right\">Size</th>" + "<th class=\"num\">Size</th>" "</tr>\n</thead><tbody>\n", fp); if (!git_commit_lookup(&commit, repo, id) && @@ -1136,9 +1136,9 @@ main(int argc, char *argv[]) writeheader(fp, "Log"); fputs("<table id=\"log\"><thead>\n<tr><th>Date</th>" "<th>Commit message</th>" - "<th>Author</th><th class=\"num\" align=\"right\">Files</th>" - "<th class=\"num\" align=\"right\">+</th>" - "<th class=\"num\" align=\"right\">-</th></tr>\n</thead><tbody>\n", fp); + "<th>Author</th><th class=\"num\">Files</th>" + "<th class=\"num\">+</th>" + "<th class=\"num\">-</th></tr>\n</thead><tbody>\n", fp); if (cachefile && head) { /* read from cache file (does not need to exist) */ diff --git a/style.css b/style.css @@ -34,15 +34,16 @@ a:hover { text-decoration: none; } -table thead td { +table th { font-weight: bold; + text-align: left; } -table td { +table td, table th { padding: 0 0.4em; } -#content table td { +#content table td, #content table th { vertical-align: top; white-space: nowrap; } @@ -62,7 +63,7 @@ table td { white-space: normal; } -td.num { +table th.num { text-align: right; }