summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Apropos and man.cgi should strcasecmp their output sorting.Kristaps Dzonsons2011-12-072-5/+15
| | | | | man.cgi should sort in the first place -- it wasn't before. Revert uppercasing of man.cgi title.
* Add skeleton man.cgi.css file. I don't think this should become moreKristaps Dzonsons2011-12-072-20/+33
| | | | | complicated than this. Also make the title be printed out in caps as it is in apropos(1) and whatis(1).
* Accept old-school man.cgi parameters like "sektion" and "query". This stillKristaps Dzonsons2011-12-071-0/+17
| | | | | | needs work because specifying an arch with "arch=i386" will return results that don't have an arch specified. I think this is weird, but it will need to be supported if we want backwards compatibility.
* Have a whatis/apropos mode, with the default (hitting enter within theKristaps Dzonsons2011-12-073-46/+72
| | | | | | | expression text) be whatis. This is a much nicer default than apropos, which can be scary. While here, fix the cat.css location (erroneously put in the response page instead of the catman page) and add bits for a default style-sheet.
* Make installing CGI a bit easier.Kristaps Dzonsons2011-12-071-0/+9
|
* By default, man.cgi should compile with -static (this was unset by mistake).Kristaps Dzonsons2011-12-072-4/+18
| | | | Also, set a custom CSS for man.cgi catman files.
* Implement search support for 24 additional macros, extract more informationIngo Schwarze2011-12-071-299/+252
| | | | | | from Fn, and lift section restrictions from An Cd Er Ev Fn Fo In Pa St Va Vt by removing 4 handler functions and 50 lines of code. ok kristaps@
* Add cat2html functionality. This keeps track of italic/bold mode per lineKristaps Dzonsons2011-12-071-56/+183
| | | | | | | | | | | | and properly handles some funny troff-isms we've exposed. I originally wanted to use man2html.c (found on W3's website with no known author) but the code is dodgy. This will need some more work (links, etc.) but does a decent job thusfar. Note: I think it's better style NOT to use <pre>, and instead have each line employ <BR> afterward. This allows browsers to break the lines if necessary. This can be changed trivially (replacing the newline and pre tags with the <BR> and new tag).
* must ignore \h with quoted argumentIngo Schwarze2011-12-051-0/+5
|
* Implement mdoc(7)-like output style variant for man(7) documents:Ingo Schwarze2011-12-043-20/+49
| | | | | | | | | | | * one instead of three blank lines after the page header; * one instead of three blank lines before the page footer; * source instead of title(section) in the lower right corner. Select this style variant with the undocumented command line option -Omdoc. In the long run, we hope to unify the ouput of both languages and to pull this out again, but that requires coordination with groff. Grudgingly ok and, (as usual,-) more comments requested by kristaps@
* Make catman and man.cgi understand the index type-field.Kristaps Dzonsons2011-12-044-36/+94
| | | | | | | Also make catman's man.conf be generated as catman.conf to avoid clobbering a real man.conf file. Finally, add a placeholder catman() function to man.cgi for preformatted manuals in the cache.
* Fix parsing of file names given on the command line; i broke itIngo Schwarze2011-12-041-4/+3
| | | | when adding support for formatted manual pages.
* Jumping out of man_unscope() for the root node is a bad ideaIngo Schwarze2011-12-043-12/+16
| | | | | | | | because that will skip root node validation, potentially entering rendering modules will NULL pointers lurking in the meta data. Instead, always validate the root node and (as suggested by joerg@) assert validity of the meta data before using it in the renderers. ok joerg@
* Remove an OpenBSD-specific tweak regarding .Xr spacing and make itIngo Schwarze2011-12-031-16/+0
| | | | | | | compatible with groff-1.21. This tweak was originally added for compatibility with groff-1.15, which is no longer needed. ok jmc@ kristaps@
* Back out lorder, which doesn't seem necessary (?). I think this means allKristaps Dzonsons2011-12-032-2/+0
| | | | fields are endian-neutral, although the recno(3) key is unknown.
* When processing .Sh HEAD, as soon as we know which section this is,Ingo Schwarze2011-12-031-0/+15
| | | | | | | | | | | fix up the section attributes of the HEAD, it's parent BLOCK, and all its (text) children. This is required because the section attributes get set when each node is allocated, i.e. before processing the content of the node itself. Thus, the listed nodes got the section attribute of the preceding section. No need to fix up the BODY, all is fine there already. Found while implementing TYPE_Sh for mandocdb(8). OK and comment requested by kristaps@.
* ISO style "%Y-%m-%d" dates are common in man(7) .TH.Ingo Schwarze2011-12-031-2/+3
| | | | | | | | | | | They have been considered valid in the past, but were reformatted to the mdoc(7) "Month day, year" style. To make page footers more similar to groff, no longer reformat them, just print them as they are. This doesn't change anything with respect to what's considered valid or what is warned about. ok kristaps@
* Make sure the btree(3) goop is also BE. This covers both the DB metadataKristaps Dzonsons2011-12-032-0/+2
| | | | and prior commits handle the contained binary fields.
* In man(7), when no explicit volume name is given, use the defaultIngo Schwarze2011-12-027-7/+23
| | | | | | | | | | | | volume name for the respective manual section, just like in mdoc(7). This gives us nicer page headers for cvs(1), lynx(1), tic(1), mkhybrid(8), and many curses(3) manuals. ok kristaps@ To not break compatibility, i wrote a corresponding patch for GNU troff which Werner Lemberg accepted upstream at rev. 1.65 of: http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff
* This is a little gross: Linux and Apple need lots some cajoling to workKristaps Dzonsons2011-12-024-6/+28
| | | | | | | | with byte-swapping. Tested on Mac. Any Linux machines somebody can test on? Anybody? While here, note the correct byte-size in mandocdb(8) and also note field widths and endianness. The btree is now endian-neutral.
* Use OpenBSD's endian functions. Make btree type also be endian-neutral.Kristaps Dzonsons2011-12-012-9/+5
|
* In apropos_db.c, move all btree reading (and safety checks) into theKristaps Dzonsons2011-12-012-30/+33
| | | | | | | | btree_read() function. Also, add a forgotten free() for the type of grokked record. Then in both mandocdb.c and apropos_db.c, make the "rec" field of the btree by in network-order.
* Fix mandocdb(8) to pass over the type when pruning the database. ThisKristaps Dzonsons2011-12-012-28/+74
| | | | | | fixed `-d' perpetually adding the same files. While here, clean up the code and document it. Remove -vv (complain if you want it back in). Document the error messages in a DIAGNOSTICS section of mandocdb(8).
* Add whatis(1) to www and start version information.Kristaps Dzonsons2011-11-291-29/+26
| | | | | | | While here, change "mdoc macro compiler" to "UNIX manpage compiler", which is more correct. I'm not sold on this language; I may end up just going with mandoc(1)'s notation. Note also that our archives are now hosted at gmane.
* Note that mandocdb(8) record type is 64-bit and show all possible values.Kristaps Dzonsons2011-11-291-38/+50
| | | | | Also slightly clarify the role of mdoc/man/cat. Finally, remove mandoc(1) reference (it's not mentioned in the manual).
* Snip some whitespace from apropos(1) and remove mandoc(1) ref fromKristaps Dzonsons2011-11-292-2/+1
| | | | | whatis(1) (both apropos/whatis aren't related to mandoc from an operator's perspective).
* Make `-i' only apply to regular expressions. For the equality operatorKristaps Dzonsons2011-11-293-35/+20
| | | | | | (and thus the default), always use strcasestr(). Discussed on tech@ with schwarze@. While here, fix the apropos.c usage() message to be consistent with apropos(1) and clean up the EXAMPLES in apropos(1).
* Add tables of matchable keys into apropos.1. Ok and with feedback byKristaps Dzonsons2011-11-291-4/+82
| | | | schwarze@.
* chdir(2) to the right man page tree before parsing manuals;Ingo Schwarze2011-11-291-1/+17
| | | | ok kristaps@
* Backout -DUSE_MANPATH that sneaked in;Ingo Schwarze2011-11-281-2/+2
| | | | ok kristaps@.
* Tweak whatis(1):Ingo Schwarze2011-11-283-7/+6
| | | | | | | * Bugfix: Use all arguments, not just the last one. * Use 'Nm~' instead of 'Nm,Nd~' to match OpenBSD behaviour. * For the progname, accept '^whatis', not '^whatis$' to ease testing. ok kristaps@
* Discuss the default behaviour up front before talking about optionsIngo Schwarze2011-11-281-36/+47
| | | | | | modifying it; based on a remark by kristaps@. While here, mention parsing of unformatted files and the changed index format and fix a few minor issues.
* Reimplement the global command line options -a and -vIngo Schwarze2011-11-271-26/+20
| | | | | | as static global variables, reducing the maze of arguments passed around among various static functions. Suggested by kristaps@.
* Save the manual type (mdoc, man, or cat) in the index fileIngo Schwarze2011-11-273-0/+3
| | | | | | | | of the mandoc databases, as suggested by kristaps@. Given the well-structured code, this is surprisingly simple. This changes the mandoc.index database format. Run "sudo mandocdb" to regenerate your databases.
* Rudimentary handling of formatted manuals ("cat pages").Ingo Schwarze2011-11-271-30/+205
| | | | | Coded on the train back from p2k11 in Budapest. Kristaps has seen the patch and agreed with the direction.
* Get us a whatis(1) mode for apropos(1).Kristaps Dzonsons2011-11-274-9/+176
| | | | | This is from a patch to tech@ as critiqued by schwarze@, checked in to get the ball rolling.
* Removing INSECURE mode. This is a work in progress! Logic forKristaps Dzonsons2011-11-274-110/+96
| | | | formatting manpages is now linked into man.cgi.
* Sync to OpenBSD, mostly gratuitous and whitespace differences,Ingo Schwarze2011-11-266-54/+61
| | | | | | | | | but a few serious things as well: * -M overrides MANPATH * -m prepends to the path * put back database close calls that got lost in mandocdb * missing sys/types.h in manpath.c, needed for size_t ok kristaps@
* Rename manup(8) to catman(8), which Linux already uses for a similar tool.Kristaps Dzonsons2011-11-262-3/+3
|
* Store page titles in the correct case, and by default, onlyIngo Schwarze2011-11-262-38/+201
| | | | | | put stuff into the database that man(1) will be able to retrieve. However, support an option to use all directories and files. feedback and ok kristaps@
* I say that mandocdb(8) uses "man(1)'s method", but it doesn't. It just usesKristaps Dzonsons2011-11-241-1/+1
| | | | | the configuration file and ignores MANPATH. Everybody else uses MANPATH (being apropos and man), so why shouldn't we?
* Make a small manual for how to run man.cgi.Kristaps Dzonsons2011-11-242-0/+79
| | | | | | This exists almost entirely to document that /tmp must exist in a jailed Apache directory for dbopen() not to fail. This was a massive headache to track down.
* Let man.cgi run in two modes:Kristaps Dzonsons2011-11-241-27/+90
| | | | | | | | | | | | | (1) Insecure. This means that we're operating over the full file-system with access to mandoc(1). In this mode, mandocdb entries are formatted on-the-fly. The $INSECURE environment variable must be passed to man.cgi for this mode to work. (2) Secure. Manuals are assumed to be pre-formatted in a cache directory, which may be set with $CACHE_DIR but default to /cache/man.cgi. This mode works with manup(8), which updates the cached pages from outside of the jail. man.cgi simply locates the manual file and outputs it to stdout.
* Have manup(8) put relative paths in its output man.conf. This lets usKristaps Dzonsons2011-11-241-2/+17
| | | | have arbitrarily-located cache directories for man.cgi.
* Allow man.conf file to be assignable.Kristaps Dzonsons2011-11-242-4/+4
|
* Export the manpath_manconf() function, slightly reorderng manpath.c whileKristaps Dzonsons2011-11-242-13/+21
| | | | | doing so. This will be used by a jailed man.cgi, as the cache built by manup(8) creates a man.conf for it to use.
* Add manup(8). This runs through mandocdb(8) databases (in the same way thatKristaps Dzonsons2011-11-243-2/+635
| | | | | | | apropos(1) does so) and updates an HTML fragment cache for use by man.cgi. Right now man.cgi is "online" in that it requires mandoc(1) in its path, but this doesn't work for, say, OpenBSD's apache chroot(1). This allows a cache to be maintained.
* Add pkgsrc to downstream. Ok'd Thomas Klausner.Kristaps Dzonsons2011-11-231-0/+6
|
* Fix whitespace in manuals.Kristaps Dzonsons2011-11-232-3/+2
|
* man.cgi works for the non-jailed case.Kristaps Dzonsons2011-11-231-80/+421
| | | | | | | In other words, if you smash this into a cgi-bin directory, it will Just Work for your system's manuals (it of course needs access to mandoc(1) and your file-system, hence "non-jailed"). The notion of a jailed case is much more subtle and being worked on now.