From cb3a5e53721b03d2d12c0ebe227f1a41dc9656f8 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 6 Aug 2016 13:05:45 +0200 Subject: sfeed_frames, sfeed_html: don't use HTML tables reasons: - HTML table rendering is extremely slow (invalidate because of resizing cells etc). - whitespace wrapping does not work properly in ancient browsers, links(1). --- sfeed_frames.c | 16 ++++------------ sfeed_html.c | 15 ++++----------- style.css | 18 +----------------- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/sfeed_frames.c b/sfeed_frames.c index 240a4cb..b7d9c65 100644 --- a/sfeed_frames.c +++ b/sfeed_frames.c @@ -138,7 +138,6 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) fputs("\n", fpitems); } - fputs("\n", fpitems); while ((linelen = getline(&line, &linesize, fpin)) > 0) { if (line[linelen - 1] == '\n') line[--linelen] = '\0'; @@ -216,17 +215,11 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) totalnew += isnew; f->totalnew += isnew; f->total++; - if (isnew) - fputs("", fpitems); - else - fputs("", fpitems); - fputs("\n", fpitems); + fputs("\n", fpitems); } - fputs("
", fpitems); - fprintf(fpitems, "%04d-%02d-%02d %02d:%02d ", + fprintf(fpitems, "%04d-%02d-%02d %02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); - fputs("", fpitems); if (isnew) fputs("", fpitems); fputs("", fpitems); if (isnew) fputs("", fpitems); - fputs("
\n", fpitems); } int @@ -271,7 +263,7 @@ main(int argc, char *argv[]) err(1, "fopen: items.html"); fputs("" "" - "
", fpitems); + "
", fpitems);
 
 	if (argc == 1) {
 		if (!(feeds[0] = calloc(1, sizeof(struct feed))))
@@ -293,7 +285,7 @@ main(int argc, char *argv[])
 			fclose(fp);
 		}
 	}
-	fputs("\n
\n", fpitems); /* div items */ + fputs("\n
\n", fpitems); /* div items */ if (showsidebar) { fputs("" diff --git a/sfeed_html.c b/sfeed_html.c index 6f6811c..ee45607 100644 --- a/sfeed_html.c +++ b/sfeed_html.c @@ -31,7 +31,6 @@ printfeed(FILE *fp, struct feed *f) xmlencode(f->name, stdout); fputs("\n", stdout); } - fputs("\n", stdout); while ((linelen = getline(&line, &linesize, fp)) > 0) { if (line[linelen - 1] == '\n') @@ -51,15 +50,9 @@ printfeed(FILE *fp, struct feed *f) f->totalnew += isnew; f->total++; - if (isnew) - fputs("", stdout); - else - fputs("", stdout); - fputs("\n", stdout); + fputs("\n", stdout); } - fputs("
", stdout); - fprintf(stdout, "%04d-%02d-%02d %02d:%02d", + fprintf(stdout, "%04d-%02d-%02d %02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); - fputs("", stdout); if (isnew) fputs("", stdout); if (islink) { @@ -72,9 +65,8 @@ printfeed(FILE *fp, struct feed *f) fputs("", stdout); if (isnew) fputs("", stdout); - fputs("
\n", stdout); } int @@ -110,6 +102,7 @@ main(int argc, char *argv[]) fputs("\t\t
\n", stdout); else fputs("\t\t
\n", stdout); + fputs("
", stdout);
 
 	if (argc == 1) {
 		if (!(feeds[0] = calloc(1, sizeof(struct feed))))
@@ -132,7 +125,7 @@ main(int argc, char *argv[])
 			fclose(fp);
 		}
 	}
-	fputs("
\n", stdout); /* div items */ + fputs("\n
\n", stdout); /* div items */ if (showsidebar) { fputs("\t
\n\t\t