If this is the case there is a way to do this. I did this a looong
time ago and it went somewhat like this:
1) run docscan on your personal tree of modules. This produces a
database of docs (in the example below it is 'pdlmylib.db').
2) pull this db into the online search list from within perldl
For 2) within .perldlrc I have code like this:
my $docs = "$ENV{PDLMYLIB}/blib/lib/PDL/pdlmylib.db"; }
use PDL::Doc::Perldl;
$PDL::onlinedoc->addfiles($docs);
For 1) I forget the code sequence but one should be able to glean it
from our installation code.
This should ideally be much easier and could be with the right support
code around the existing functionality....
Christian
On 15/12/2009, at 1:11 PM, Craig DeForest wrote:
> Jarle,
>
> I think David wants to get this effect using a .pm file in a module
> tree somewhere.
>
>
> David,
>
> There is a routine in PDL::Doc::Perldl ("find_autodoc") that searches
> the $PDLLIB tree.
> It is called from "search_docs" in that same file (line 188 or
> thereabouts) -- search_docs
> looks at a precompiled documentation tree and then calls find_autodoc
> to search $PDLLIB.
> There is currently no provision to include documentation from
> precompiled modules that are
> not part of the PDL distribution (the precompiled documentation tree
> is compiled from all
> the .pm files at build time).
>
> It might be useful to do a find_manpage or something that would find
> matches in the man
> pages -- since the normal Ext::MakeMaker module generates a man page
> for most modules,
> that would probably do What You Want. Another thing would be to
> search @INC for .pm
> files that seem to match your search string -- but that is hit or
> miss...
>
> Cheers,
> Craig
>
>
> On Dec 14, 2009, at 3:48 PM, Jarle Brinchmann wrote:
>
>> Hi David,
>>
>> Not sure I understand 100% your situation. When I want to do this I
>> put code in my $PDLLIB directory, in this case in jb_hist2d.pdl. The
>> code is:
>>
>> -------------------------
>> =head1 NAME
>>
>> jb_hist2d - 2D histogramming made fancy.
>>
>> =head1 SYNOPSIS
>>
>> =head1 DESCRIPTION
>>
>> =cut
>> --------------------------
>>
>> (useful since I haven't got around to filling it in. It resides in a
>> subdirectory of my $PDLLIB which is set to +/Users/jarle/pdllib.
>>
>> Then in perldl I can do:
>>
>> -------------------------------------
>> perldl> help jb_hist2d
>> Autoload file "/Users/jarle/pdllib/Histograms/jb_hist2d.pdl"
>> NAME
>> jb_hist2d - 2D histogramming made fancy.
>>
>> SYNOPSIS
>> DESCRIPTION
>> Docs from
>> /Users/jarle/pdllib/Histograms/jb_hist2d.pdl
>> -------------------------------------
>>
>> My ~/.perldlrc looks like:
>>
>> use PDL::AutoLoader;
>>
>> $PDL::AutoLoader::Rescan=1;
>> $PDL::Doc::pager = '/usr/bin/less'
>>
>> This all seems to work, but it might not have been what you wanted?
>>
>> Cheers,
>> Jarle.
>>
>>
>> On 14 Dec 2009, at 23:34, David Mertens wrote:
>>
>>> Question for those who know the inner workings of PDL's
>>> Documentation System:
>>>
>>> I'm working on a pure perl module that I hope to use from within
>>> perldl to run some of my simulations. I would like to document the
>>> various simulation object methods, and then make use of perldl's
>>> help functionality but I cannot seem to get it to work.
>>>
>>> This has frustrated me to no end today because I know that
>>> Autoloading can magically insert documentation, but when I look at
>>> Autoloading's code, I can't figure out where it manipulates
>>> $PDL::onlinedoc. I've considered putting all of my documentation in
>>> an autoloaded file - just to solve the darned problem - but I'm sure
>>> there's the 'right' way to get perldl to pull the documentation for
>>> my module. I've even tried renaming my file's name to have a .pdl
>>> extension, in hopes that PDL::Doc was doing something magical with
>>> those file extensions. No luck.
>>>
>>> Let me make this concrete. How would I fill in the following
>>> example file so that the perldl's 'help' works on it? (Or, put a
>>> little differently, how would I modify the test_func.pdl file below
>>> to get the same results when I rename the file to
>>> My::Test::Func.pm?)
>>>
>>> ------------------------%<------------------------
>>> # This file is named My/Own/Module.pm (with respect to current
>>> working directory)
>>> package My::Own::Module;
>>>
>>> =head1 NAME
>>>
>>> My::Own::Module - a perldl documentation test module
>>>
>>> =head1 FUNCTIONS
>>>
>>> =head2 myfunc
>>>
>>> =for ref
>>>
>>> Does something magical!
>>>
>>> =cut
>>>
>>> sub myfunc {
>>> print "It works\n!";
>>> }
>>>
>>> 1;
>>> ------------------------%<------------------------
>>>
>>> Thanks for any help on this!
>>>
>>> David
>>>
>>>
>>>
>>> P.S. If anybody wants to use Autoloading (ala Matlab) and wants to
>>> document your autoloaded functions, here's a template that should
>>> work (you'll still need to configure Autoloading, but that's not the
>>> point of this email):
>>> ------------------------%<---test_func.pdl---
>>> %<------------------------
>>> =head2 test_func
>>>
>>> =for ref
>>>
>>> One-line explanation.
>>>
>>> =for example
>>>
>>> # An example should go here.
>>> perldl> test_func()
>>> It works!
>>>
>>> Here is where you put more documentation. :)
>>>
>>> =cut
>>>
>>> sub test_func {
>>> print "It works!\n";
>>> }
>>>
>>> 1;
>>> ------------------------%<---test_func.pdl---
>>> %<------------------------
>>>
>>> Then you can call
>>> perldl> help test_func
>>> and it will give you your nice summary. (Note I had trouble with
>>> the usage command... not quite sure why.)
>>> _______________________________________________
>>> Perldl mailing list
>>> [email protected]
>>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
--
Christian Soeller PhD Dept. of Physiology +64 9 3737599 x82770
University of Auckland Auckland, New Zealand fax +64 9 3737499
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl