Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Code formatting

by Foggy Bottoms (Monk)
on Jul 02, 2003 at 13:51 UTC ( #270794=perlquestion: print w/ replies, xml ) Need Help??
Foggy Bottoms has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone already written a little script that'd take pl/pm files and insert them in a Word document, format the resulting text by changing font, adding color for comments and so on in order to quickly write up a report.
If not, I've started doing so and will put up the source shortly when it's fully functional (it may not be of any use to you wisest monks but to those of us who still study we still have reports to turn in and reediting code in Word is a time consuming pain in the neck)
Let me know what you think.

Comment on Code formatting
Re: Code formatting
by Corion (Pope) on Jul 02, 2003 at 13:55 UTC

    My approach to this would be to take one of the better Perl code highlighters that output HTML, and import that HTML into the Word document, best by automating Word via Win32::OLE instead of a manual process, to keep the document and the code in sync. You could also try whether master documents (or central documents) work with file types different from .doc...

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Code formatting
by crouchingpenguin (Priest) on Jul 02, 2003 at 15:01 UTC

    Not straight to Word, but you can use vim to output html. A quick Super Search revealed this node.

    Update: or here, here, or here.


    cp
    ----
    "Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."
Re: Code formatting
by hsmyers (Canon) on Jul 02, 2003 at 17:26 UTC

    PerlTidy has an output option of colored html that you might want to look into.

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Re: Code formatting
by TVSET (Chaplain) on Jul 02, 2003 at 21:53 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://270794]
Approved by hardburn
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (17)
As of 2014-10-01 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (21 votes), past polls