Initial commit
[app-zealc.git] / zealc
CommitLineData
6c01e3e3
MG
1#!/usr/bin/perl
2use v5.14;
3use warnings;
4
5use lib 'lib';
6use lib '../zeal/lib';
7
8use App::Zealc;
9App::Zealc->run;
10__END__
11
12=encoding utf-8
13
14=head1 NAME
15
16zealc - Browse API documentation for various projects
17
18=head1 SYNOPSIS
19
20 zealc download Perl
21 # Downloading Perl version 5.20.1 from http://sanfrancisco.kapeli.com/feeds/Perl.tgz
22
23 zealc list
24 # Perl
25
26 zealc list -l
27 # Perl perl:
28
29 zealc expand perl_os -l
30 # perl:perldos
31 # perl:perlvos
32
33 zealc query perldos
34 zealc query perldoc --elinks
35
36=head1 DESCRIPTION
37
38zealc is a command-line offline documentation browser inspired by
39L<Dash|http://kapeli.com/dash> and L<Zeal|http://zealdocs.org>. It
40uses Dash/Zeal format docsets via the L<Zeal> library.
41
42=head2 Global options
43
44=over
45
46=item B<--config>=I</path/to/file>
47
48Specify a configuration file to use. If this argument is missing,
49B<zealc> will look for files F<zealcconfig>, F<zealc.config>,
50F<zealcrc>, F<.zealcrc> in the current directory, the home directory,
51in F</etc/>, and in F</usr/local/etc/>. This behaviour is described in
52the "HOW IT WORKS" section of the L<Config::Auto> manpage.
53
54See also the L</"CONFIGURATION"> section below.
55
56=item B<--path>=I</path/to/docset/directory>
57
58The path to a directory containing docsets. Defaults to F<~/.docset>
59if the home directory is known, F<.docset> otherwise.
60
61=item B<--verbose>, B<--no-verbose>
62
63If B<--verbose> is in effect, more messages will be printed. Default
64is B<--no-verbose>.
65
66=back
67
68=head2 Commands
69
70=over
71
72=item B<zealc download>
73
74View the list of official Dash docsets. The docsets that are already
75installed will be displayed in a bold font and with a * after their
76name.
77
78=item B<zealc download> I<docset_id>
79
80Download an official Dash docset. I<docset_id> is one of the ids
81returned by B<zealc download>.
82
83=item B<zealc download> I<http://example.com/path/to/feed.xml>
84
85Download a docset from a given docset feed.
86
87=item B<zealc expand> [-f|--family] I<pattern>
88
89List all documents matching I<pattern>, where I<pattern> is a SQL LIKE
90pattern. If I<-f> or I<--family> is present, include the docset family
91of each found document. This command is mostly intended for use in
92scripts, as each line of the output can be directly passed to B<zealc
93query>.
94
95=item B<zealc list> [-l|--long]
96
97List the names of all installed docsets. If I<-l> or I<--long> is
98present, also display the family of each docset.
99
100=item B<zealc query> [-w WITH|--with=WITH] [-f FORMAT|--format FORMAT] I<pattern>
101
102Display the documentation for a given pattern. I<pattern> is a SQL
103LIKE pattern. If more than one document is found and STDOUT is a
104terminal, the user will be asked to choose one of them. If more than
105one document is found and STDOUT is not a terminal, a randomly chosen
106document will be displayed.
107
108To display the document, it will first be converted in the format
109specified by I<--format>, then it will be opened with the program
110specified by I<--with>.
111
112I<--format> can be one of:
113
114=over
115
116=item html, in which case no conversion will be done
117
118=item text, in which case it will be converted to text with L<HTML::FormatText>
119
120=item program arg1 arg2, in which case the HTML document will be
121passed as the first argument to this program
122
123=back
124
125=back
126
127=head1 CONFIGURATION
128
129B<zealc> uses L<Config::Auto> for configuration. please read its
130manpage for a detailed explanation. Command-line arguments override
131configuration directives. The available configuration directives are:
132
133=over
134
135=item B<path>
136
137Path to the directory containing the docsets. Equivalent to the
138B<--config> global option.
139
140=item B<verbose>
141
142If true, print more detailed messages. Equivalent to the B<--verbose>
143global option.
144
145If false, do not print detailed messages. Equivalent to the
146B<--no-verbose> global option, which is the default.
147
148=item B<with>
149
150The program used to open documents. Usually a web browser or a pager.
151Equivalent to the B<--with> option to B<zealc query>.
152
153=item B<format>
154
155The program used to format documents. This can also be one of the
156special values I<html> (do not format this document) or I<text>
157(convert to text via L<HTML::FormatText>). Equivalent to the
158B<--format> option to B<zealc query>.
159
160=back
161
162To get started with configuration, create a file named F<.zealcrc> in
163your home directory (or in the current directory) with keys separated
164by values using an equals sign. For example:
165
166 path=/home/mgv/docsets/
167 with=/usr/bin/lynx -color
168 format=html
169 verbose=1
170
171=head1 SEE ALSO
172
173L<http://kapeli.com/dash>, L<Zeal>
174
175=head1 AUTHOR
176
177Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
178
179=head1 COPYRIGHT AND LICENSE
180
181Copyright (C) 2015 by Marius Gavrilescu
182
183This library is free software; you can redistribute it and/or modify
184it under the same terms as Perl itself, either Perl version 5.20.1 or,
185at your option, any later version of Perl 5 you may have available.
186
187
188
189=cut
This page took 0.018453 seconds and 4 git commands to generate.