App-sdview
view release on metacpan or search on metacpan
#!/usr/bin/perl
use v5.14;
use warnings;
use App::sdview;
use Getopt::Long;
GetOptions(
'format|f=s' => \my $FORMAT,
'output|t=s' => \my $OUTPUT,
'output-option|O=s@' => \my @OUTPUT_OPTIONS,
'highlight|h' => \my $HIGHLIGHT,
) or exit 1;
exit App::sdview->new->run(
shift @ARGV,
format => $FORMAT,
output => $OUTPUT,
output_options => \@OUTPUT_OPTIONS,
highlight => $HIGHLIGHT,
);
=head1 NAME
F<sdview> - a terminal-based structured document viewer for Pod and other formats
=head1 SYNOPSIS
$ sdview my-document.pod
# Understands Pod in .pm files
$ sdview lib/App/sdview.pm
# Search perldoc for page documentation
sdview Scalar::Util
$ Understands Markdown files
sdview README.md
=head1 DESCRIPTION
This script runs the L<App::sdview> program, which renders a structured
document to a terminal output, via the F<less> pager.
=head1 ARGUMENTS
$ sdview [FILE]
=head2 FILE
If a file path is given, the filename is used to determine if it should be
parsed as Pod (F<*.pm>, F<*.pl> or F<*.pod>), or Markdown (F<*.md>). (But see
also the C<-f> option).
If the name is not a file, C<perldoc -l> will be used to convert the name of
a Perl module into a location for its documentation.
=head1 OPTIONS
=head2 -f, --format FORMAT
Overrides detection of the file's format by inspecting the filename. Useful
for viewing Pod out of toplevel scripts whose filename does not indicate a
language:
$ sdview -f Pod bin/sdview
Request C<-f ?> to print a list of parser format names.
=head2 -t, --output FORMAT
Specifies that a different form of output will be generated, instead of
rendering formatted output directly to the terminal. Useful for cross-
converting between file types:
$ sdview lib/App/sdview.pm -t Markdown > sdview.md
Request C<-t ?> to print a list of output format names.
( run in 0.843 second using v1.01-cache-2.11-cpan-39bf76dae61 )