On 10/30/2010 10:29 AM, Octavian Rasnita wrote:
Hi,

Is there a tool that can be used to extract the POD from all the modules of a 
Catalyst app and create an HTML version of that documentation?

Thanks.

Octavian


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

If you're not concerned with resource usage (small user-base, whatever), you could try something like this that I wrote a few days ago. With some jquery-candy, it gives me a nice navigable list that lets me move about through the docs pretty well. Also, it's live-updating as I code, so I can see my own POD docs as I go. I just threw this together and it's not well developed yet; modify it to work better, of course!

/reference/code?module=MyApp::Awesomeness::Incodenate -- code resources for developers.
/reference/help -- user help resources

   ### From MyApp::Web::Controller::Reference::Code
   ### This chains off "/reference/"
   sub index :ChainedParent :PathPart('code') :Args :Does('NeedsLogin') {
       my ($self, $c, @args) = @_;

       if ($c->request->param('module')) {
          my $module = Pod::HTMLEmbed->new(url_prefix =>
   '/reference/code?module=')
             ->find($c->request->param('module'));

          if ($module) {
             $c->stash->{pod} = $module->body;
             $c->stash->{current_module} = $c->request->param('module');
          } else {
             $c->stash->{pod} = undef;
          }
       }

       ### A list of our modules.
       $c->stash->{modules} = [];

       ### Look through the elements of %INC and find/modify the ones
   we care about.
       map {
          ### Take things that start with MyApp::, MyOtherNamespace::, etc.
          if ($_ =~ /^(MyApp|MyOtherNamespace)/) {
             ### Replace '/' with '::' and strip off the ".pm"
             $_ =~ s/\//::/g;
             $_ =~ s/\.pm$//g;

             push @{$c->stash->{modules}}, $_;
          }
       } keys(%INC);
   }

-Sir







_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to