From 3d438a3600536da5375d7629896667530c476aaf Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 19 Jan 2017 13:35:02 +0000 Subject: Start cleanup: trim useless HTML comments,
elements, and CSS rules on the and levels. --- cgi.c | 15 +++++---------- man_html.c | 18 ++++++++---------- mandoc.css | 43 ++++++++++++++++++++----------------------- mdoc_html.c | 18 ++++++++---------- 4 files changed, 41 insertions(+), 53 deletions(-) diff --git a/cgi.c b/cgi.c index 30a0ea43..5a21856a 100644 --- a/cgi.c +++ b/cgi.c @@ -1,7 +1,7 @@ -/* $Id: cgi.c,v 1.141 2016/09/12 00:06:20 schwarze Exp $ */ +/* $Id: cgi.c,v 1.142 2017/01/19 13:35:02 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2016 Ingo Schwarze + * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -356,8 +356,7 @@ resp_begin_html(int code, const char *msg) " type=\"text/css\" media=\"all\">\n" "%s\n" "\n" - "\n" - "\n", + "\n", CSS_DIR, CUSTOMIZE_TITLE); resp_copy(MAN_DIR "/header.html"); @@ -378,9 +377,7 @@ resp_searchform(const struct req *req, enum focus focus) { int i; - puts(""); - printf("
\n" - "
\n" + printf("\n" "
\n" "Manual Page Search Parameters\n", scriptname); @@ -448,9 +445,7 @@ resp_searchform(const struct req *req, enum focus focus) } puts("
\n" - "
\n" - "
"); - puts(""); + ""); } static int diff --git a/man_html.c b/man_html.c index cf973ce0..1ee661aa 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.125 2017/01/19 01:00:14 schwarze Exp $ */ +/* $Id: man_html.c,v 1.126 2017/01/19 13:35:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -148,24 +148,22 @@ html_man(void *arg, const struct roff_man *man) { struct mhtml mh; struct html *h; - struct tag *t, *tt; + struct tag *t; memset(&mh, 0, sizeof(mh)); h = (struct html *)arg; - if ( ! (HTML_FRAGMENT & h->oflags)) { + if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); - t = print_otag(h, TAG_HTML, ""); - tt = print_otag(h, TAG_HEAD, ""); + print_otag(h, TAG_HTML, ""); + t = print_otag(h, TAG_HEAD, ""); print_man_head(&man->meta, man->first, &mh, h); - print_tagq(h, tt); + print_tagq(h, t); print_otag(h, TAG_BODY, ""); - print_otag(h, TAG_DIV, "c", "mandoc"); - } else - t = print_otag(h, TAG_DIV, "c", "mandoc"); + } print_man_nodelist(&man->meta, man->first, &mh, h); - print_tagq(h, t); + print_tagq(h, NULL); } static void diff --git a/mandoc.css b/mandoc.css index 90085061..5c4e930a 100644 --- a/mandoc.css +++ b/mandoc.css @@ -1,29 +1,26 @@ -/* $Id: mandoc.css,v 1.2 2016/04/13 10:19:23 schwarze Exp $ */ - +/* $Id: mandoc.css,v 1.3 2017/01/19 13:35:02 schwarze Exp $ */ /* - * This is an example style-sheet provided for mandoc(1) and the -Thtml - * or -Txhtml output mode. - * - * It mimics the appearance of the traditional cvsweb output. - * - * See mdoc(7) and man(7) for macro explanations. + * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). */ -html { max-width: 880px; margin-left: 1em; } -body { font-size: smaller; font-family: Helvetica,Arial,sans-serif; } -body > div { padding-left: 2em; - padding-top: 1em; } -body > div.mandoc, -body > div#mancgi { padding-left: 0em; - padding-top: 0em; } -body > div.results { font-size: smaller; } -#mancgi fieldset { text-align: center; - border: thin solid silver; - border-radius: 1em; - font-size: small; } -#mancgi input[name=expr] { width: 25%; } -.results td.title { vertical-align: top; - padding-right: 1em; } +/* Global defaults. */ + +html { max-width: 100ex; } +body { font-family: Helvetica,Arial,sans-serif; } + +/* Search form and search results. */ + +fieldset { border: thin solid silver; + border-radius: 1em; + text-align: center; } +input[name=expr] { + width: 25%; } + +div.results { margin-top: 1em; + margin-left: 2em; + font-size: smaller; } + + h1 { margin-bottom: 1ex; font-size: 110% } div.section > h1 { margin-left: -4ex; } /* Section header (Sh, SH). */ h2 { margin-bottom: 1ex; font-size: 105%; margin-left: -2ex; } /* Sub-section header (Ss, SS). */ diff --git a/mdoc_html.c b/mdoc_html.c index c62c8e9e..62a319ac 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.251 2017/01/19 01:00:14 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.252 2017/01/19 13:35:02 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -299,25 +299,23 @@ void html_mdoc(void *arg, const struct roff_man *mdoc) { struct html *h; - struct tag *t, *tt; + struct tag *t; h = (struct html *)arg; - if ( ! (HTML_FRAGMENT & h->oflags)) { + if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); - t = print_otag(h, TAG_HTML, ""); - tt = print_otag(h, TAG_HEAD, ""); + print_otag(h, TAG_HTML, ""); + t = print_otag(h, TAG_HEAD, ""); print_mdoc_head(&mdoc->meta, mdoc->first->child, h); - print_tagq(h, tt); + print_tagq(h, t); print_otag(h, TAG_BODY, ""); - print_otag(h, TAG_DIV, "c", "mandoc"); - } else - t = print_otag(h, TAG_DIV, "c", "mandoc"); + } mdoc_root_pre(&mdoc->meta, mdoc->first->child, h); print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h); mdoc_root_post(&mdoc->meta, mdoc->first->child, h); - print_tagq(h, t); + print_tagq(h, NULL); } static void -- cgit v1.2.3-56-ge451