source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Add skeleton man.cgi.css file.
Date: Wed, 7 Dec 2011 10:55:06 -0500 (EST)	[thread overview]
Message-ID: <201112071555.pB7Ft6KG015346@krisdoz.my.domain> (raw)

Log Message:
-----------
Add skeleton man.cgi.css file.  I don't think this should become more 
complicated than this.  Also make the title be printed out in caps as it
is in apropos(1) and whatis(1).

Modified Files:
--------------
    mdocml:
        cgi.c

Added Files:
-----------
    mdocml:
        man.cgi.css

Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/cgi.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lcgi.c -Lcgi.c -u -p -r1.13 -r1.14
--- cgi.c
+++ cgi.c
@@ -295,8 +295,8 @@ resp_begin_html(int code, const char *ms
 	     " \"http://www.w3.org/TR/html4/strict.dtd\">"	"\n"
 	     "<HTML>"						"\n"
 	     " <HEAD>"						"\n"
-	     "   <META HTTP-EQUIV=\"Content-Type\" "		"\n"
-	     "         CONTENT=\"text/html; charset=utf-8\">"	"\n"
+	     "  <META HTTP-EQUIV=\"Content-Type\" "		"\n"
+	     "        CONTENT=\"text/html; charset=utf-8\">"	"\n"
 	     "  <LINK REL=\"stylesheet\" HREF=\"/man.cgi.css\""	"\n"
 	     "        TYPE=\"text/css\" media=\"all\">"		"\n"
 	     "  <TITLE>System Manpage Reference</TITLE>"	"\n"
@@ -339,21 +339,20 @@ resp_searchform(const struct req *req)
 	printf("<FORM ACTION=\"");
 	html_print(progname);
 	printf("/search.html\" METHOD=\"get\">\n");
-	puts("<FIELDSET>\n"
-	     "<INPUT TYPE=\"submit\" NAME=\"op\" "
-	      "VALUE=\"Whatis\"> or \n"
-	     "<INPUT TYPE=\"submit\" NAME=\"op\" "
-	      "VALUE=\"apropos\"> for manuals satisfying \n"
-	     "<INPUT TYPE=\"text\" SIZE=\"40\" "
-	      "NAME=\"expr\" VALUE=\"");
+	printf("<FIELDSET>\n"
+	       "<INPUT TYPE=\"submit\" NAME=\"op\" "
+	        "VALUE=\"Whatis\"> or \n"
+	       "<INPUT TYPE=\"submit\" NAME=\"op\" "
+	        "VALUE=\"apropos\"> for manuals satisfying \n"
+	       "<INPUT TYPE=\"text\" NAME=\"expr\" VALUE=\"");
 	html_print(expr);
-	puts("\">, section "
-	     "<INPUT TYPE=\"text\" "
-	      "SIZE=\"4\" NAME=\"sec\" VALUE=\"");
+	printf("\">, section "
+	       "<INPUT TYPE=\"text\" "
+	        "SIZE=\"4\" NAME=\"sec\" VALUE=\"");
 	html_print(sec);
-	puts("\">, arch "
-	     "<INPUT TYPE=\"text\" "
-	      "SIZE=\"8\" NAME=\"arch\" VALUE=\"");
+	printf("\">, arch "
+	       "<INPUT TYPE=\"text\" "
+	        "SIZE=\"8\" NAME=\"arch\" VALUE=\"");
 	html_print(arch);
 	puts("\">.\n"
 	     "<INPUT TYPE=\"reset\" VALUE=\"Reset\">\n"
@@ -424,6 +423,7 @@ static void
 resp_search(struct res *r, size_t sz, void *arg)
 {
 	int		 i;
+	char		*cp;
 
 	if (1 == sz) {
 		/*
@@ -441,23 +441,30 @@ resp_search(struct res *r, size_t sz, vo
 	resp_begin_html(200, NULL);
 	resp_searchform((const struct req *)arg);
 
-	if (0 == sz)
+	if (0 == sz) {
 		puts("<P>No results found.</P>");
+		resp_end_html();
+		return;
+	}
+
+	puts("<P></P>\n"
+	     "<TABLE>");
 
 	for (i = 0; i < (int)sz; i++) {
-		printf("<P><A HREF=\"");
+		printf("<TR><TD CLASS=\"title\"><A HREF=\"");
 		html_print(progname);
 		printf("/show/%u/%u.html\">", r[i].volume, r[i].rec);
-		html_print(r[i].title);
+		for (cp = r[i].title; '\0' != *cp; cp++)
+			html_putchar(toupper((unsigned char)*cp));
 		putchar('(');
 		html_print(r[i].cat);
 		if (r[i].arch && '\0' != *r[i].arch) {
 			putchar('/');
 			html_print(r[i].arch);
 		}
-		printf(")</A> ");
+		printf(")</A></TD><TD CLASS=\"desc\">");
 		html_print(r[i].desc);
-		puts("</P>");
+		puts("</TD></TR>");
 	}
 
 	resp_end_html();
--- /dev/null
+++ man.cgi.css
@@ -0,0 +1,6 @@
+body		{ font-family: Helvetica,Arial, sans-serif;
+		  font-size: small; }
+fieldset	{ text-align: center; }
+input[name=expr] { width: 25%; }
+td.title	{ padding-right: 1em; 
+		  text-align: right; }
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2011-12-07 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112071555.pB7Ft6KG015346@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).