Creating a new section of man pages

0

I have obtained man pages for the GNU Fortran intrinsic procedures (link). After cloning the repo, the man pages themselves are in a directory ~/Documents/fortran-man-pages/man3f, and each one is a file ending in *.3f, e.g., the ajdustl function is documented in adustl.3f. I want man to be able to "see" these pages, so I have copied them to /usr/local/share/man/man3f. In theory, man should know to look there since /usr/local/share/man is one of the directories listed by man --path. But no dice:

$ man adjustl
No manual entry for adjustl
$ man 3f adjustl
No entry in section 3f of the manual
$ man -M /usr/local/share/man adjustl
No manual entry for adjustl
$ man -k adjustl
Nothing appropriate

This is made even more mystifying by the fact that man knows about other pages in that directory:

$ man -w gs
/usr/local/share/man/man1/gs.1

But what about...

$ man -K adjustl
(long pause...)
/usr/local/share/man/man3f/adjustl.3f? [ynq]

Aha! So these pages are on the search path for man -K, but not man? Have I missed a step in trying to install these Fortran man pages? I am on OS X 10.11.6 (El Capitan).

Endulum

Posted 2019-02-11T00:08:49.957

Reputation: 101

Answers

0

man manpath may help.

I always put man pages in ~/.config/share/man/... This clause in my universal ~/.bashrc file puts them in the search path.

if [ -d $HOME/.local/share/man/man1 ]; then
    which manpath >/dev/null 2>&1  &&  P="$(manpath 2>/dev/null)"\
                                   ||  P="$MANPATH"
    case ":$P:" in
        *:$HOME/.local/share/man:*) ;;
        *) MANPATH="$P:$HOME/.local/share/man"
           export MANPATH           ;;
    esac
fi

That is, if manpath already knows about it, or $MANPATH already includes it, then I do nothing. Otherwise I create $MANPATH from manpath if the variable doesn't exist. And then add my path to $MANPATH.

You could change it to /usr/local/share/man/.

Ken Jackson

Posted 2019-02-11T00:08:49.957

Reputation: 281