* mdocml: Simplify the code and the server setup by deleting the
@ 2016-07-10 10:06 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-07-10 10:06 UTC (permalink / raw)
To: source
Log Message:
-----------
Simplify the code and the server setup by deleting the pseudo-manpath
"mandoc" that was used for man.cgi(8) documentation and by assuming
that the apropos(1) and man.cgi(8) manuals are simply installed in
the default manpath. Even though man.cgi(8) is not installed by
default when installing OpenBSD, it is easy to copy it into the
default manpath used for man.cgi(8).
Idea found when considering a question asked by wrant dot com.
Modified Files:
--------------
mdocml:
Makefile
cgi.c
man.cgi.8
Revision Data
-------------
Index: man.cgi.8
===================================================================
RCS file: /home/cvs/mdocml/mdocml/man.cgi.8,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lman.cgi.8 -Lman.cgi.8 -u -p -r1.18 -r1.19
--- man.cgi.8
+++ man.cgi.8
@@ -220,13 +220,16 @@ run
.Pp
.Dl make man.cgi
.Pp
-and copy the files to the proper locations.
-Reading the
-.Cm installcgi
-target in the
-.Pa Makefile
-can help with that, but do not run it without carefully checking it
-because the directory layouts of web servers vary greatly.
+and copy the resulting binary to the proper location,
+for example using the command:
+.Pp
+.Dl make installcgi
+.Pp
+In addition to that, make sure the default manpath contains the files
+.Pa man1/apropos.1
+and
+.Pa man8/man.cgi.8 ,
+or the documentation links at the bottom of the index page will not work.
.Ss URI interface
.Nm
uniform resource identifiers are not needed for interactive use,
@@ -367,10 +370,6 @@ Default
data directory containing all the manual trees.
Can be overridden by
.Dv MAN_DIR .
-.It Pa /man/mandoc/man1/apropos.1 , /man/mandoc/man8/man.cgi.8
-Manual pages documenting
-.Nm
-itself, linked from the index page.
.It Pa /man/manpath.conf
The list of available manpaths, one per line.
If any of the lines in this file contains a slash
Index: cgi.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/cgi.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -Lcgi.c -Lcgi.c -u -p -r1.133 -r1.134
--- cgi.c
+++ cgi.c
@@ -470,9 +470,6 @@ validate_manpath(const struct req *req,
{
size_t i;
- if ( ! strcmp(manpath, "mandoc"))
- return 1;
-
for (i = 0; i < req->psz; i++)
if ( ! strcmp(manpath, req->p[i]))
return 1;
@@ -499,9 +496,9 @@ pg_index(const struct req *req)
resp_searchform(req, FOCUS_QUERY);
printf("<p>\n"
"This web interface is documented in the\n"
- "<a href=\"/%s%smandoc/man8/man.cgi.8\">man.cgi</a>\n"
+ "<a href=\"/%s%sman.cgi.8\">man.cgi(8)</a>\n"
"manual, and the\n"
- "<a href=\"/%s%smandoc/man1/apropos.1\">apropos</a>\n"
+ "<a href=\"/%s%sapropos.1\">apropos(1)</a>\n"
"manual explains the query syntax.\n"
"</p>\n",
scriptname, *scriptname == '\0' ? "" : "/",
@@ -884,12 +881,7 @@ pg_show(struct req *req, const char *ful
free(manpath);
return;
}
-
- if (strcmp(manpath, "mandoc")) {
- free(req->q.manpath);
- req->q.manpath = manpath;
- } else
- free(manpath);
+ free(manpath);
if ( ! validate_filename(file)) {
pg_error_badrequest(
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.485
retrieving revision 1.486
diff -LMakefile -LMakefile -u -p -r1.485 -r1.486
--- Makefile
+++ Makefile
@@ -397,12 +397,8 @@ db-install: base-build
cgi-install: cgi-build
mkdir -p $(DESTDIR)$(CGIBINDIR)
mkdir -p $(DESTDIR)$(HTDOCDIR)
- mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1
- mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8
$(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
$(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR)
- $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/
- $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/
Makefile.local config.h: configure ${TESTSRCS}
@echo "$@ is out of date; please run ./configure"
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-10 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-10 10:06 mdocml: Simplify the code and the server setup by deleting the 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).