in reply to Re: [literate programming] How to mix POD with code? And how to fold this?
in thread [literate programming] How to mix POD with code? And how to fold this?

1. It's difficult to fold...outline-minor-mode assigns outline-levels and "=head1" and "sub {" are toplevel, "=head2" second level and so on. Ilya wants to know the "common sense" befor changing this.

2. It's not DRY, e.g. I still have to repeat the method name

3. all these necessary empty lines makes it voluminous

4. (personal side note) it doesn't support introspection a la "docstring"

> A small improvement might be to put all Pod before METHODS and after SEE ALSO in a separate file

yeah I already had this idea to extract documentation in comments and to generate the POD.

e.g. something like

sub func { my $DOC="yadda yadda" ...code }

or

sub func :DOC(yadda yadda) { ...code }

would fold nicely in every editor, allow introspection and could be parsed to generate the POD.

(but it's always smarter to ask before risking to reinvent the wheel :)

Cheers Rolf