help / color / mirror / Atom feed
* mandoc & mandocdb on Mac OS X
@ 2014-08-09 12:25 Kristaps Dzonsons
  0 siblings, 0 replies; only message in thread
From: Kristaps Dzonsons @ 2014-08-09 12:25 UTC (permalink / raw)
  To: discuss


Thought I'd drop a note to all with OSX who want mandoc goodness instead 
of the defaults for apropos and so on.  This can be easily modified to 
only affect the local user, but I want to make it the system default. 
(As noted to tech@, there's a certain failure with mmap() in running 
some commands, but this should be fixed soon, so I won't mention it here.)

First, uncomment "USE_MANPATH" in the Makefile.  Then make (or remake) 
and install with the usual make install.  (All binaries dumped into 
/usr/local now.)

Aside: I also uncommented the CFLAGS and DBLIB to include /usr/local as 
I've compiled a more recent SQLite in there.  The default SQLite doesn't 
have SQLITE_DETERMINISTIC.  I don't know how much of a difference this 
makes, however.

Prep the makewhatis database.

  $ sudo /usr/local/sbin/makewhatis

Optionally add this to the /etc/weekly.local file.  Note that the system 
makewhatis (via makewhatis.local) will also run weekly as stipulated in 

Then make sure that apropos and whatis point to mandoc's versions of the 
same.  You can either replace the in-system binaries or alias.  (Note: 
if you alias, running apropos via man won't work with the new system.)

Finally, we need to de-funk man-db:

  $ alias man='man -c -p ""'

This makes the formatter be run each time (-c) and suppresses 
preprocessors (-p "").  Next, to continue de-funkifying, we need not 
only to replace nroff with mandoc in /etc/man.conf, but to decline the 
"help" that man-db gives us in line lengths in a way that I can't 
disable but that triggers -man mode instead of -mdoc:

  NROFF           tail -n +2 | /usr/local/bin/mandoc

That's it!  NOTE: not all manuals play well with mandoc!  Specifically, 
the OpenGL manuals look like butts.  I don't know why yet.  Perhaps, in 
converting from DocBook, they didn't use docbook2mdoc...

(Aside number two.  It's because the OpenGL docbook input use a lot of 
<inlineequation>, which docbook2mdoc doesn't understand enough to 
convert to eqn.  In turn, mandoc's eqn wouldn't understand enough of the 
eqn itself...  Any takers?)


 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-09 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-09 12:25 mandoc & mandocdb on Mac OS X Kristaps Dzonsons

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