Bwana, un man dans safari...

MalaMala Membre, Modérateur
03:51 modifié dans Objective-C, Swift, C, C++ #1
Tout est dans le titre. En surfant, je suis tombé la dessus par hasard:
http://www.bruji.com/bwana

Ce petit logiciel permet d'utiliser le manuel du terminal directement dans safari pour afficher la doc en html.

J'ai trouvé ça très futé et bien pratique donc avis aux intéressés.  :P

Réponses

  • nicotechnicotech Membre
    03:51 modifié #2
    Encore mieux, un script qui compose un pdf dans aperçu ou acrobat avec le man (récupéré je ne sait plus où, désolé pour l'auteur).

    un bonheur.




    #!/bin/bash

    # Convert man pages to PDF and open them in the default PDF viewer.
    # PDFs are cached when created.
    # By Tom Harrington, tph at atomicbird dot com, 16 March 2005

    # Directory to save cached PDFs in
    # (if you don't want long-term caching, you could use /tmp/).
    CACHEDIR=~/Library/Caches

    # Command to read PS from stdin and write PDF to an output file.
    PS2PDF_CMD="/usr/bin/pstopdf -i -o"
    # Command to open the resulting PDF once it's created.
    OPEN_CMD="/usr/bin/open"
    # Path to "man", which is expected to take the -w, -S, and -t args.
    MAN_CMD="/usr/bin/man"

    CACHEDIR="$CACHEDIR/manpdf"
    if [ ! -e $CACHEDIR ]; then
    mkdir -p $CACHEDIR
    fi

    if [ $# -eq 1 ]
    then
    MANSECT=""
    MANARG=$1
    elif [ $# -eq 2 ]
    then
    MANSECT=$1
    MANARG=$2
    else
    echo "Usage: " `basename $0` "[section] name"
    exit
    fi

    if [ "$MANSECT" != "" ]; then
    MANSECTARG="-S $MANSECT"
    fi

    # Look for the command's man page.
    MANFILE=`$MAN_CMD $MANSECTARG -w $MANARG 2>/dev/null`
    if [ -z $MANFILE ]; then
    echo No manual entry for $MANARG
    exit
    fi
    # OK, got the man page.  Now get the name for the corresponding
    # PDF.  The goal here is to organize cached PDFs in CACHEDIR
    # according to man-page section, similar to the way /usr/share/man
    # is organized into "man1", "man3", etc.
    echo file: $MANFILE
    MANSECT=`echo "$MANFILE" | sed 's/.*\.\([0-9]\)/\1/'`
    MANPDF=$CACHEDIR/pdf$MANSECT/$MANARG.$MANSECT.pdf
    FINALDIR=`dirname $MANPDF`
    echo PDF: $MANPDF
    # Create the PDF if it's not in the cache dir.
    if [ ! -e $MANPDF ]; then
    echo Generating man page...
    mkdir -p $FINALDIR
    $MAN_CMD $MANSECTARG -t $MANARG | $PS2PDF_CMD $MANPDF
    else
    echo Reading man page from cache...
    fi
    # Now open the PDF.
    $OPEN_CMD $MANPDF

  • GGGG Membre
    03:51 modifié #3
    moi je dois avouer que je suis tombé sur une combinaison vraiment sympa :

    http://81-174-13-243.f5.ngi.it/manimporter/

    et

    http://www.clindberg.org/projects/ManOpen.html

    Rechercher un man via Spotlight et il apparait dans un petit navigateur ManOpen.
    Très bonne combinaison qui me permet de faire une recherche sans jamais toucher la souris ;).


  • nicotechnicotech Membre
    03:51 modifié #4
    Pour la recherche manimporter me semble pas mal.

    Pour la visualisation, je préfère nettement les pdfs générés par le script bash que le htlm de manopen, question de goût...

    Et pour l'impression (si besoin), il n'y a pas photo.
  • Philippe49Philippe49 Membre
    03:51 modifié #5
    Sans oublier que le menu Help de XCode fournit un item : Help > Open man Page


  • MalaMala Membre, Modérateur
    03:51 modifié #6
    dans 1217539091:

    Sans oublier que le menu Help de XCode fournit un item : Help > Open man Page


    En fait, l'intérêt que je vois à  un outils tiers c'est justement de ne pas avoir à  ouvrir Xcode.
Connectez-vous ou Inscrivez-vous pour répondre.