Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Sunday November 15, 2009
08:03 AM

Vim: Automatically opening POD as a PDF

[ #39899 ]

Doing a bit of POD munging and using Pod::Parser::Groffmom with this. The following is OS X specific, but it should be easy to adjust for another system. It automatically opens any POD file as a PDF document with cover page and table of contents:

au! FileType pod           :call PodMappings()

function! PodMappings()
    noremap <buffer> ,r :call PodToPDF()<cr>
endfunction

function! PodToPDF()
    let filename   = bufname("%")
    let postscript = filename . ".ps"
    let command  = 'perl $(which pod2mom) --cover --toc --ps '
        \ . filename
        \ . ' && open ' . postscript
    echo system(command)
endfunction

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Interesting idea. How do you like using it in practice?
    • I've liked it quite a bit. I have a custom subclass of Pod::Parser::Groffmom which even writes out slides for me, so I can create a presentation by writing POD. I then just run a version of the above (pod2mom takes a --parser option if you want a subclass) and get a lovely PDF and my S5 slides at the same time.