App-nup

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

Build.PL
CLAUDE.md
Changes
LICENSE
META.json
README.md
cpanfile
images/Makefile
images/capture.sh
images/nup.png
lib/App/nup.pm
lib/App/optex/up.pm
minil.toml
script/nup
t/00_compile.t
t/01_nup.t
t/02_up_options.t
t/03_up_run.t
t/Util.pm
t/runner/README.md

README.md  view on Meta::CPAN


Version 1.07

# DESCRIPTION

**N-up** (command: `nup`) is a multi-column paged output tool.
It provides a convenient way to view files or run commands in
n-up layout using the [App::optex::up](https://metacpan.org/pod/App%3A%3Aoptex%3A%3Aup) module through `optex`.

<div>
    <p><img width="750" src="https://raw.githubusercontent.com/tecolicom/App-nup/main/images/nup.png"></p>
</div>

`nup` automatically detects the mode based on the first argument:
if it is an existing file, n-up file view mode is used; if it is an
executable command, n-up command mode is used.  Use `-e` option to
force command mode when needed.

# OPTIONS

## General Options

images/Makefile  view on Meta::CPAN

# Generate screenshot images for documentation.
# Requires: iTerm2, capture.sh, nup
#
# Note: On Retina displays, captured images will be at 2x resolution.

.PHONY: all clean

all: nup.png

nup.png:
	./capture.sh -o $@ -- 'nup man nup'

clean:
	rm -f nup.png

images/capture.sh  view on Meta::CPAN

# Opens a new iTerm window with specified terminal size, runs the
# given command, waits for output to render, then captures the
# window as a PNG image.
#
# Requires: iTerm2, macOS screencapture, getoptlong.sh
#
# Note: On Retina displays, the captured image will be at 2x
# resolution.  There is currently no simple way to capture at
# 1x resolution without a non-Retina (virtual) display.
#
# Usage: ./capture.sh [-o output.png] [-c cols] [-r rows] command...
# Example: ./capture.sh -o nup.png 'nup man nup'

set -e

declare -A OPTS=(
    [ output |o: # output filename            ]=screenshot.png
    [ cols   |c: # terminal columns           ]=180
    [ rows   |r: # terminal rows              ]=50
    [ shadow |s  # capture with window shadow ]=1
    [ delay  |d: # delay before capture (sec) ]=2
    [ keys   |k: # send keys after command    ]=
    [ help   |h  # show help                  ]=
)

. getoptlong.sh OPTS "$@" || exit 1

if [[ -n "$help" ]] || [[ $# -eq 0 ]]; then
    echo "Usage: $0 [-o output.png] [-c cols] [-r rows] command..."
    echo "Example: $0 -o nup.png 'nup man nup'"
    exit 0
fi

OUTPUT="$output"
COMMAND="$*"

# Create iTerm window, run command, and get window ID
WIN_ID=$(osascript <<EOF
tell application "iTerm"
    set newWin to (create window with default profile)

lib/App/nup.pm  view on Meta::CPAN


=cut
=head1 DESCRIPTION

B<N-up> (command: C<nup>) is a multi-column paged output tool.
It provides a convenient way to view files or run commands in
n-up layout using the L<App::optex::up> module through C<optex>.

=begin html

<p><img width="750" src="https://raw.githubusercontent.com/tecolicom/App-nup/main/images/nup.png"></p>

=end html

C<nup> automatically detects the mode based on the first argument:
if it is an existing file, n-up file view mode is used; if it is an
executable command, n-up command mode is used.  Use C<-e> option to
force command mode when needed.

=head1 OPTIONS

lib/App/optex/up.pm  view on Meta::CPAN

=back

=head1 EXAMPLES

Display perldoc output in multiple columns:

    optex -Mup perldoc App::optex::up

=begin html

<p><img width="750" src="https://raw.githubusercontent.com/tecolicom/App-nup/main/images/nup.png">

=end html

List files in multiple columns with pager:

    optex -Mup ls -l

Use 2 columns:

    optex -Mup -C2 -- ls -l

script/nup  view on Meta::CPAN

: <<'=cut'

=head1 DESCRIPTION

B<N-up> (command: C<nup>) is a multi-column paged output tool.
It provides a convenient way to view files or run commands in
n-up layout using the L<App::optex::up> module through C<optex>.

=begin html

<p><img width="750" src="https://raw.githubusercontent.com/tecolicom/App-nup/main/images/nup.png"></p>

=end html

C<nup> automatically detects the mode based on the first argument:
if it is an existing file, n-up file view mode is used; if it is an
executable command, n-up command mode is used.  Use C<-e> option to
force command mode when needed.

=head1 OPTIONS



( run in 1.821 second using v1.01-cache-2.11-cpan-788537b7465 )