nautilus and POD documents

statico on 2005-02-01T06:30:06

I wanted a one click solution to viewing the POD of perl scripts or modules with Nautilus The solution: make sure Pod::Html is installed, and copy the following script to ~/.gnome2/nautilus-scripts/podview:

    #!/bin/sh
    for i in $@; do
        t=`tempfile`
        pod2html --infile=$i --outfile=$t \
            --css='http://www.ccs.neu.edu/home/bass/bass.css'
        mozilla-firefox -remote "openURL(file://$t,new-window)"
        ( sleep 2 && rm $t ) &
    done


You may have to open up the nautilus-scripts directory and refresh. Afterward, right-clicking on a document shows a "Scripts" submenu, which contains a "podview" item. And, my stylesheet is pretty.