From: schwarze Date: Sun, 13 Jul 2014 00:16:03 +0000 (+0000) Subject: update after recent code changes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=158bb45642545431d5af2202577a7c273ab47ee9;p=openbsd update after recent code changes --- diff --git a/usr.bin/mandoc/man.cgi.8 b/usr.bin/mandoc/man.cgi.8 index c7aff6b850e..bf31d849fa9 100644 --- a/usr.bin/mandoc/man.cgi.8 +++ b/usr.bin/mandoc/man.cgi.8 @@ -1,4 +1,4 @@ -.\" $Id: man.cgi.8,v 1.1 2014/07/11 15:37:22 schwarze Exp $ +.\" $Id: man.cgi.8,v 1.2 2014/07/13 00:16:03 schwarze Exp $ .\" .\" Copyright (c) 2014 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 11 2014 $ +.Dd $Mdocdate: July 13 2014 $ .Dt MAN.CGI 8 .Os .Sh NAME @@ -37,26 +37,42 @@ At the top of each generated HTML page, displays a search form containing these elements: .Bl -enum .It -A -.Dq Search -button to send a search request from the client to the server, -to be clicked after filling in the following input box(es). -.It -An input box for search queries, expecting an +An input box for search queries, expecting +either a name of a manual page or an .Ar expression using the syntax described in the .Xr apropos 1 manual; filling this in is required for each search. .It -An input box for an optional section number. +A +.Dq Submit +button to send a search request from the client to the server. +.It +A +.Dq Reset +button to undo any changes to the input boxes and the dropdown menus +and reset them to the values contained in the +.Ev QUERY_STRING . +.It +Radio buttons to select pages either by name like in +.Xr man 1 +or using +.Xr apropos 1 +queries. +.It +A dropdown menu to optionally select a manual section. If one is provided, it has the same effect as the +.Xr man 1 +and .Xr apropos 1 .Fl s option. Otherwise, pages from all sections are shown. .It -An input box for an optional architecture name. +A dropdown menu to optionally select an architecture. If one is provided, it has the same effect as the +.Xr man 1 +and .Xr apropos 1 .Fl S option. @@ -67,12 +83,6 @@ If the configuration file .Pa /var/www/man/manpath.conf contains only one manpath, the dropdown menu is not shown. By default, the first manpath given in the file is used. -.It -A -.Dq Reset -button to undo any changes to the input boxes and the dropdown menu -and reset them to the values contained in the -.Ev QUERY_STRING . .El .Ss Program output The @@ -165,77 +175,46 @@ The host name and a following slash. The path to the program, normally .Pa cgi-bin/man.cgi/ . .It -A page name, which can be -.Cm index , -which is the default and can be omitted, -.Cm search , -or -.Cm show . -.It -For -.Cm show -only, a slash, the manpath, another slash, +To show a single page, a slash, the manpath, another slash, and the name of the requested file, for example .Pa /OpenBSD-current/man1/mandoc.1 . .It -For -.Cm search -only, a query string starting with a question mark +For searches, a query string starting with a question mark and consisting of .Ar key Ns = Ns Ar value pairs, separated by ampersands, for example -.Pa ?manpath=OpenBSD-current&expr=mandoc . +.Pa ?manpath=OpenBSD-current&query=mandoc . Supported keys are .Cm manpath , -.Cm expr , +.Cm query , .Cm sec , -and .Cm arch , corresponding to .Xr apropos 1 .Fl M , .Ar expression , .Fl s , -and .Fl S , -respectively. +respectively, and +.Cm apropos , +which is a boolean parameter to select or deselect the +.Xr apropos 1 +query mode. For backward compatibility with the traditional .Nm , -.Cm query -is supported as an alias for -.Cm expr -and .Cm sektion -as an alias for +is supported as an alias for .Cm sec . .El .Sh ENVIRONMENT The web server may pass the following CGI variables to .Nm : .Bl -tag -width Ds -.It Ev CSS_DIR -An optional path to the directory containing the CSS files, -to be specified relative to the server's document root, -and to be specified without a trailing slash. -When not specified, the CSS files -are assumed to be in the document root. -This is used in generated HTML code. .It Ev HTTP_HOST The FQDN of the (possibly virtual) host the HTTP server is running on. This is used for .Ic Location: headers in HTTP 303 responses. -.It Ev MAN_DIR -A path to the -.Nm -data directory to be used instead of -.Pa /man , -relative to the web server -.Xr chroot 2 -directory, to be specified without a trailing slash. -This is prepended to the manpath when opening -.Xr mandoc.db 5 -and manual page files. .It Ev PATH_INFO The final part of the URI path passed from the client to the server, starting after the @@ -300,13 +279,34 @@ source file located below the .Dq OpenBSD-current manpath. .El +.Sh COMPILE-TIME DEFINES +.Bl -tag -width Ds +.It Ev CSS_DIR +An optional path to the directory containing the CSS files, +to be specified relative to the server's document root, +and to be specified without a trailing slash. +When not specified, the CSS files +are assumed to be in the document root. +This is used in generated HTML code. +.It Ev MAN_DIR +A path to the +.Nm +data directory to be used instead of +.Pa /var/www/man , +relative to the web server +.Xr chroot 2 +directory, to be specified without a trailing slash. +This is prepended to the manpath when opening +.Xr mandoc.db 5 +and manual page files. +.El .Sh COMPATIBILITY The .Nm CGI program is call-compatible with queries from the traditional .Pa man.cgi script by Wolfram Schneider. -However, the results may not be quite the same. +However, the output may not be quite the same. .Sh SEE ALSO .Xr apropos 1 , .Xr mandoc.db 5 ,