NAME
App::Grok - Does most of grok's heavy lifting
DESCRIPTION
This class provides the main functionality needed by grok. It has some methods you can use if you need to hook into grok.
METHODS
new
This is the constructor. It takes no arguments.
run
If you call this method, it will look at the command line arguments in @ARGV
and act accordingly. This is basically what the grok
program does. Takes no arguments.
target_index
Takes no arguments. Returns a list of all the targets known to grok
.
read_functions
Takes no arguments. Returns a hash reference of all function documentation from Synopsis 29. There will be a key for every function, with the value being a Pod snippet from Synopsis 29.
read_table
Takes no arguments. Returns a hash reference of all entries in the Perl 6 Table Index. Keys are the entry names, values are Pod snippets.
detect_source
Takes a filename as an argument. Returns the name of the appropriate App::Grok::*
class to parse it. Returns nothing if the file doesn't contain any Pod.
find_target_file
Takes a valid grok
target as an argument. If found, it will return a path to a matching file, otherwise it returns nothing.
find_perl6_doc
Takes the name (or a substring of a name) of a Synopsis as an argument. Returns a path to a matching file if one is found, otherwise returns nothing. Note: this method is called by find_target
.
find_module_or_program
Takes the name of a module or a program. Returns a path to a matching file if one is found, otherwise returns nothing. Note: this doesn't do anything yet.
render_target
Takes two arguments, a target and the name of an output format. Returns a string containing the rendered documentation, or nothing if the target is unrecognized.
render_file
Takes two arguments, a filename and the name of an output format. Returns a string containing the rendered document. Note: this method is called by render_target
.
AUTHOR
Hinrik Örn Sigurðsson, hinrik.sig@gmail.com
LICENSE AND COPYRIGHT
Copyright 2009 Hinrik Örn Sigurðsson
grok
is distributed under the terms of the Artistic License 2.0. For more details, see the full text of the license in the file LICENSE that came with this distribution.