source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Provide a dropdown entry "All Architectures" and make it the
@ 2014-07-24  8:26 schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: schwarze @ 2014-07-24  8:26 UTC (permalink / raw)
  To: source

Log Message:
-----------
Provide a dropdown entry "All Architectures" and make it the default.
Still, amd64 remains the default in the following sense:
If a man(1) mode search returns more than one page of the same name,
prefer amd64 over other architectures for immediate display.
ok deraadt@ daniel@

Modified Files:
--------------
    mdocml:
        TODO

Revision Data
-------------
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.172
retrieving revision 1.173
diff -LTODO -LTODO -u -p -r1.172 -r1.173
--- TODO
+++ TODO
@@ -168,6 +168,13 @@
   with apropos(1) using the file name as a key, as well.
   Issue reported by tedu@  Fri, 05 Jul 2013 21:15:23 -0400
 
+- When makewhatis(8) encounters a FATAL parse error,
+  it silently treats the file as formatted, which makes no sense
+  at all for paths like man1/foo.1 - and which also contradicts
+  what the manual says at the end of the description.
+  The end result will be ENOENT for file names returned
+  by mansearch() in manpage.file.
+
 - makewhatis(8) for preformatted pages:
   parse the section number from the header line
   and compare to the section number from the directory name
@@ -246,6 +253,10 @@
   Search the text "Routing tables".
   Also check what PostScript mode does when fixing this.
   reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200
+
+--- HTML issues --------------------------------------------------------
+
+- check https://github.com/trentm/mdocml
 
 ************************************************************************
 * formatting issues: gratuitous differences
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* mdocml: Provide a dropdown entry "All Architectures" and make it the
@ 2014-07-24  8:26 schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: schwarze @ 2014-07-24  8:26 UTC (permalink / raw)
  To: source

Log Message:
-----------
Provide a dropdown entry "All Architectures" and make it the default.
Still, amd64 remains the default in the following sense:
If a man(1) mode search returns more than one page of the same name,
prefer amd64 over other architectures for immediate display.
ok deraadt@ daniel@

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

Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/cgi.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -Lcgi.c -Lcgi.c -u -p -r1.80 -r1.81
--- cgi.c
+++ cgi.c
@@ -422,7 +422,11 @@ resp_searchform(const struct req *req)
 
 	/* Write architecture selector. */
 
-	puts("<SELECT NAME=\"arch\">");
+	printf(	"<SELECT NAME=\"arch\">\n"
+		"<OPTION VALUE=\"default\"");
+	if (NULL == req->q.arch)
+		printf(" SELECTED");
+	puts(">All Architectures</OPTION>");
 	for (i = 0; i < arch_MAX; i++) {
 		printf("<OPTION VALUE=\"%s\"", arch_names[i]);
 		if (NULL != req->q.arch &&
@@ -559,7 +563,9 @@ pg_error_internal(void)
 static void
 pg_searchres(const struct req *req, struct manpage *r, size_t sz)
 {
+	char		*arch, *archend;
 	size_t		 i, iuse, isec;
+	int		 archprio, archpriouse;
 	int		 prio, priouse;
 	char		 sec;
 
@@ -622,12 +628,30 @@ pg_searchres(const struct req *req, stru
 		puts("<HR>");
 		iuse = 0;
 		priouse = 10;
+		archpriouse = 3;
 		for (i = 0; i < sz; i++) {
 			isec = strcspn(r[i].file, "123456789");
 			sec = r[i].file[isec];
 			if ('\0' == sec)
 				continue;
 			prio = sec_prios[sec - '1'];
+			if (NULL == req->q.arch) {
+				archprio =
+				    (NULL == (arch = strchr(
+					r[i].file + isec, '/'))) ? 3 :
+				    (NULL == (archend = strchr(
+					arch + 1, '/'))) ? 0 :
+				    strncmp(arch, "amd64/",
+					archend - arch) ? 2 : 1;
+				if (archprio < archpriouse) {
+					archpriouse = archprio;
+					priouse = prio;
+					iuse = i;
+					continue;
+				}
+				if (archprio > archpriouse)
+					continue;
+			}
 			if (prio >= priouse)
 				continue;
 			priouse = prio;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-24  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-24  8:26 mdocml: Provide a dropdown entry "All Architectures" and make it the schwarze
2014-07-24  8:26 schwarze

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).