Changes between Version 7 and Version 8 of PadrePluginCookbookRecipie05


Ignore:
Timestamp:
08/05/11 20:01:14 (3 years ago)
Author:
bowtie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PadrePluginCookbookRecipie05

    v7 v8  
    2525our $VERSION = '0.01'; 
    2626}}} 
    27 * Plugin must it's **Interfaces**, all Padre Modules should be included 
     27 
     28---- 
     29 
     30* Plugin must declare it's **Interfaces**, all Padre Modules should be included 
    2831 * Don't forget to include the following sub. 
    2932 * Use the version number of Padre you are developing against, as shown below. 
     
    4750}}} 
    4851 
    49 * Some Plugin will require a plugin_enable method, 
    50  * Why because it's using an external resource, which is not being picked up via perl (M::I). 
    51  * You can see this method has only been enabled for Ubuntu, it needs more os file locations adding. 
    52  
    53 {{{#!perl 
    54 ######### 
    55 # We need plugin_enable 
    56 # as we have an external dependancy 
    57 ######### 
    58 sub plugin_enable { 
    59  
    60     my $pdflatex_exists = 0; 
    61          
    62     # ToDo add other os locations 
    63     # Ubuntu -> /usr/bin/ 
    64     my @directories = qw( /usr/bin/ ); 
    65     find( 
    66         sub { 
    67             if ( $_ eq 'pdflatex' ) { 
    68                 $pdflatex_exists = 1; 
    69             } 
    70         }, 
    71         @directories 
    72     ); 
    73  
    74 return $pdflatex_exists; 
    75 } 
    76 }}} 
    77 From {{{Padre::Plugin::LaTeX}}} 
     52 
    7853* draft needs tiding up 
    7954{{{#!text 
     
    15012512:36 bowtie     Alias_, you are so happy it must be your un-Birthday again :), thanks 
    151126}}} 
     127 
     128---- 
     129 
     130* Some Plugin will require a plugin_enable method, 
     131 * Why because it's using an external resource, which is not being picked up via perl (M::I). 
     132 * You can see this method has only been enabled for Ubuntu, it needs more os file locations adding. 
     133 
     134{{{#!perl 
     135######### 
     136# We need plugin_enable 
     137# as we have an external dependancy 
     138######### 
     139sub plugin_enable { 
     140 
     141    my $pdflatex_exists = 0; 
     142         
     143    # ToDo add other os locations 
     144    # Ubuntu -> /usr/bin/ 
     145    my @directories = qw( /usr/bin/ ); 
     146    find( 
     147        sub { 
     148            if ( $_ eq 'pdflatex' ) { 
     149                $pdflatex_exists = 1; 
     150            } 
     151        }, 
     152        @directories 
     153    ); 
     154 
     155return $pdflatex_exists; 
     156} 
     157}}} 
     158 
     159From {{{Padre::Plugin::LaTeX}}} 
     160 
     161{{{Padre::Plugin::SpellCheck}}} dose not need this as it depends upon Text::Aspell which won't install with out Aspell files being present. 
     162 
     163---- 
     164 
     165* Registered_documents 
     166 * only if you have them  
     167{{{#!perl 
     168sub registered_documents { 
     169        'application/x-latex' => 'Padre::Document::LaTeX', 
     170        'application/x-bibtex' => 'Padre::Document::BibTeX',; 
     171} 
     172}}} 
     173From {{{Padre::Plugin::LaTeX}}} 
     174 
     175---- 
     176 
    152177* Plugin can be loaded and unloaded repeatedly 
    153178 * Don't forget to include the following sub.