perllove has asked for the wisdom of the Perl Monks concerning the following question:

I had made some documentation using POD. And using Perl tidy I am able to generate 'tidy' looking web pages. But the code is in CVS. How can I make the POD abreast with any changes made in CVS? (and a good thing to have is a link to the comments made while making the CVS change)

Replies are listed 'Best First'.
Re: POD for CVS
by andreas1234567 (Vicar) on Jun 22, 2007 at 07:24 UTC
    The Perl Best Practices recommends:
    • Distinguish user documentation from technical documentation.
    • Put user documentation in source files.
    • Keep all user documentation in a single place within your source file.
    • Place POD as close as possible to the end of the file.
    --
    print map{chr}unpack(q{A3}x24,q{074117115116032097110111116104101114032080101114108032104097099107101114})
Re: POD for CVS
by TOD (Friar) on Jun 21, 2007 at 20:11 UTC
    i think the nearest thing would lie in subclassing one of the POD::xxx classes.

    --------------------------------
    masses are the opiate for religion.
Re: POD for CVS
by naikonta (Curate) on Jun 22, 2007 at 04:40 UTC
    perllove, could you please explain what your really want to do with the POD files? My wild guess says that you maintain some POD files under CVS to track revision. Each time you make change to a file, you commit the file along with some log changes. Now, you want to make all log changes intacted inside the corresponding POD file. If this is the case, then your post is a bit off topic (OT) because this is unrelated to Perl directly, and you should be careful to post OT here, specially in unclear statememnt.

    However, if this is really your case, you want to use a CVS keyword called $Log$. Please check relevant CVS documentation.


    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Re: POD for CVS
by halley (Prior) on Jun 22, 2007 at 18:45 UTC
    I'll try to paraphrase what I think you want. If you agree, then people can help you on that track.
    • there's a CVS code repository with some perl code
    • the perl code has POD embedded in it
    • I know I can use pod2html or other tricks to make HTML docs
    • I don't know how to keep my HTML docs up-to-date with the latest code in CVS

    If you phrase things cleanly and crisply, solutions come out into plain sight.

    For example, there are two big options:

    1. put the HTML into CVS and trigger HTML updates whenever anyone checks in POD code
    2. occasionally regenerate the HTML from scratch by checking out all the POD code into a temporary sandbox

    Benefits of #1: a user's checkout gets matching POD and HTML. Benefits of #2: less complicated and more portable to other version control mechanisms.

    --
    [ e d @ h a l l e y . c c ]

      Thanks halley, I'll try that. Also you showed me how to ask a good question.
Re: POD for CVS
by blazar (Canon) on Jun 22, 2007 at 16:47 UTC
    And using Perl tidy I am able to generate 'tidy' looking web pages.

    I can't understand. AFAIK Perl::Tidy is a tool to (mostly) beautify Perl source code. What does this have to do with "'tidy' looking web pages"? Aren't you perhaps confusing with HTML::Tidy?

    But the code is in CVS. How can I make the POD abreast with any changes made in CVS?

    In all earnestness I can't make sense of your question, but the most reasonable guess I can come up with is that you're concerned that minor changes to the text and passes through your reformatter will wildly change the source itself making for poorly identifiable diffs. In that case, there are better algorithms now than CVS's. But if that is not an option, reformat once and be careful about pod yourself. Or am I completely off base?

Re: POD for CVS
by Anonymous Monk on Jun 22, 2007 at 04:16 UTC
    pod doesn't come with breasts :|