GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PADRE::BROWSER (3)

.ds Aq ’

NAME

Padre::Browser -- documentation browser for Padre

CONTENTS

DESCRIPTION

Provide an interface for retrieving / generating documentation, resolving terms to documentation (search?) and formatting documentation.

Allow new packages to be loaded and interrogated for the MIME types they can generate documentation for. Provide similar mechanism for registering new documentation viewers and URI schemes accepted for resolving.

<B>NOTE:B> I think all the method names are wrong. Blast it.

SYNOPSIS



  # Does perlish things by default via Padre::Browser::POD
  my $browser = Padre::Browser->new;
  my $source = Padre::Document->new( filename=>source/Package.pm );

  my $docs = $browser->docs( $source );
  # $docs provided by Browser::POD->generate
  #  should be Padre::Browser::Document , application/x-pod

  my $output = $browser->browse( $docs );
  # $output provided by Browser::POD->render
  #  should be Padre::Document , text/x-html

  $browser->load_viewer( Padre::Browser::PodAdvanced );
  # PodAdvanced->render might add an html TOC in addition to
  #  just pod2html

  my $new_output = $browser->browse( $docs );
  # $new_output now with a table of contents



METHODS

    new

Boring constructor, pass nothing. Yet.

    load_provider

Accepts a single class name, will attempt to auto-use the class and interrogate its provider_for method. Any MIME types returned will be associated with the class for dispatch to generate.

Additionally, interrogate class for accept_schemes and associate the class with URI schemes for dispatch to resolve.

    load_viewer

Accepts a single class name, will attempt to auto-use the class and interrogate its viewer_for method. Any MIME types returned will be associated with the class for dispatch to render.

    resolve

Accepts a URI or scalar

    browse

    accept

EXTENDING



  package My::Browser::Doxygen;

  # URI of doxygen:$string or doxygen://path?query
  sub accept_schemes {
      doxygen,
  }

  sub provider_for {
      text/x-c++src
  }

  sub viewer_for {
      text/x-doxygen,
  }

  sub generate {
      my ($self,$doc) = @_;
      # $doc will be Padre::Document of any type specified
      # by ->provider_for

      # push $doc through doxygen
      # ...
      # that was easy :)

      # You know your own output type, be explicit
      my $response = Padre::Document->new;
      $response->{original_content} = $doxygen->output;
      $response->set_mimetype( text/x-doxygen );
      return $response;
  }

  sub render {
      my ($self,$docs) = @_;
      # $docs will be of any type specified
      # by ->viewer_for;

      ## turn $docs into doxygen(y) html document
      #  ...
      #

      my $response = Padre::Document->new;
      $response->{original_content} = $doxy2html->output;
      $response->set_mimetype( text/x-html );
      return $response;

  }



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PADRE::BROWSER (3) 2013-11-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.