App-sdview-Output-Tickit
view release on metacpan or search on metacpan
lib/App/sdview/Output/Tickit.pm view on Meta::CPAN
C<App::sdview::Output::Tickit> - interactive terminal-based viewer for L<App::sdview>
=head1 SYNOPSIS
$ sdview README.pod -o tickit
(though this is likely the default output mode if this module is installed)
=head1 DESCRIPTION
This output module provides an interactive terminal-viewer for rendering
documents in L<App::sdview>, showing formatted information on the terminal.
It uses L<Tickit> to provide the terminal interactions.
=head2 Keybindings
=over 4
=item *
C<Home> or C<< < >> - scroll to top
=item *
C<Backspace> - scroll up a page
=item *
C<PageUp> - scroll up half a page
=item *
C<[> - scroll up to the previous item
=item *
C<Up> - scroll up a line
=item *
C<Down> - scroll down a line
=item *
C<]> - scroll up to the previous item
=item *
C<PageDown> - scroll down half a page
=item *
C<Space> - scroll down a page
=item *
C<End> or C<< > >> - scroll to bottom
=item *
C<F9> - open the outline view popup. See Below.
=item *
C</> - start a regexp search in the document body. See Below.
=item
C<q> - exit
=back
=head2 Outline View
The outline view displays an overview of all the section headings in the
document.
Within the outline view, the mouse wheel will scroll the list, and clicking an
entry will jump directly to it, dismissing the view.
Typing text with the outline view open will filter it to just those headings
matching the typed text. Pressing the C<< <Enter> >> key will jump directly to
the first highlighted heading, again dismissing the view.
=head2 Regexp Searching
Typing into the main search box enters text that forms a (perl) regexp pattern
to be tested against the body text of the document. Each paragraph is tested
individually and all matches are highlighted. Pressing C<< <Enter> >> will
select the first match. Use the C<< <n> >> and C<< <p> >> keys to jump between
them. Press C<< <Escape> >> to clear the highlights. Press C<< <Alt-i> >> to
toggle case-insensitivity. Press C<< <Alt-w> >> to toggle whole-word matching.
=cut
# Override default output format
require App::sdview;
$App::sdview::DEFAULT_OUTPUT = "tickit"
if $App::sdview::DEFAULT_OUTPUT eq "terminal" and -t STDOUT;
my @HIGHLIGHT_PEN = (
fg => 16, # avoid bold-black
bg => "magenta",
b => 1,
);
my @SELECT_PEN = (
bg => "green",
);
field $t;
field $scroller;
field $outlinetree;
field @items;
# Related to searching
field $matchposstatic;
field $matchidx;
field @matches;
ADJUST
( run in 0.676 second using v1.01-cache-2.11-cpan-364913b4093 )