Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.

Replies are listed 'Best First'.
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.

    "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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://270794]
Approved by hardburn
[choroba]: traincity: http://jobs.perl. org

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-03-21 18:57 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (270 votes). Check out past polls.