App-mdee

 view release on metacpan or  search on metacpan

script/mdee  view on Meta::CPAN

Column alignment is parsed from the separator line: C<:---> (left,
default), C<:---:> (center), C<---:> (right).  The C<parse_separator()>
function extracts alignment markers and passes C<--table-right> and
C<--table-center> options to L<ansicolumn(1)|App::ansicolumn> (requires
version 1.53 or later).  Colons are stripped from the separator line
before further processing.

When C<--rule> is enabled (default), ASCII pipe characters are replaced
with Unicode box-drawing characters (C<│>, C<├>, C<┤>, C<┼>, C<─>).

=head3 Output Stage

The final stage uses L<nup(1)|App::nup> to provide multi-column paged output.
Layout options (C<--pane>, C<--row>, C<--grid>, C<--page>) are passed
directly to nup.

=head2 Theme System

B<em·dee> implements a theme system where themes are transformations
applied to the built-in default theme.  Multiple themes can be
chained via C<--theme=NAME1,NAME2,...>.

=head3 Theme Structure

Color definitions are managed by the L<App::Greple::md> module.
The C<theme_light> and C<theme_dark> arrays contain only the base
color.  Theme files can modify the base color and pass configuration
to the md module via C<md_config[]>:

    # theme/warm.sh — change base color
    theme_light[base]='<Coral>=y25'
    theme_dark[base]='<Coral>=y80'

    # theme/hashed.sh — enable closing hashes
    md_config+=(hashed.h3=1 hashed.h4=1 hashed.h5=1 hashed.h6=1)

The C<md_config[]> entries are passed as config parameters to the
L<App::Greple::md> module.  Color labels (C<h1>, C<bold>, etc.)
can also be set as config parameters:

    # theme file or config.sh — override color label
    md_config+=(h1='L25D/R;E' bold=RD)

=head4 Base Color Expansion

The C<${base}> placeholder in color values is expanded by the md
module.  The base color is determined by C<--base-color> option
(default: RoyalBlue) with automatic luminance adjustment based on
mode (C<=y25> for light, C<=y80> for dark).

=head3 Color Specifications

Colors are specified using L<Term::ANSIColor::Concise> format.
The C<--colormap> (C<--cm>) option maps colors to captured groups.  For example,
C<L00D/${base};E> specifies gray foreground on base-colored background.

The color specification supports modifiers:

=over 4

=item * C<+y10> / C<-y10>: Adjust luminance by percentage

=item * C<=y50>: Set absolute luminance

=item * C<D>: Bold, C<U>: Underline, C<E>: Erase line

=back

=head3 Terminal Mode Detection

B<em·dee> uses L<Getopt::EX::termcolor> to detect terminal background
luminance.  If luminance is below 50%, dark mode is automatically
selected.

=head1 LIMITATIONS

=head2 HTML Comments

Only HTML comments starting at the beginning of a line are highlighted.
Inline comments are not matched to avoid conflicts with inline code
containing comment-like text (e.g., C<< `<!-->` >>).

=head2 Emphasis

Emphasis patterns (bold and italic) do not span multiple lines.
Multi-line emphasis text is not supported.

C<***bold italic***> and C<___bold italic___> are supported.
Other nested forms (e.g., C<< **bold _italic_** >>) are not.

=head2 Links

Link patterns do not span multiple lines.  The link text and URL must
be on the same line.

Links inside other highlighted elements (such as headings or bold
text) are not processed.

Reference-style links (C<[text][ref]> with C<[ref]: url> elsewhere)
are not supported.

=head2 Table Alignment

Column alignment assumes that cell content in the source is not
pre-padded.  If the source table is already formatted with aligned
spacing (e.g., C<| c     |>), the embedded spaces become part of
the cell content and alignment directives in the separator line
will not produce the expected result.  This is by design: pre-formatted
tables are assumed to be correctly aligned as-is.

=head2 OSC 8 Hyperlinks

Links are converted to OSC 8 terminal hyperlinks for clickable URLs:

=over 4

=item C<[text](url)> - C<[text]> links to url

=item C<![alt](url)> - C<![alt]> links to url (image)

=item C<[![alt](img)](url)> - C<!> links to img, C<[alt]> links to url



( run in 1.695 second using v1.01-cache-2.11-cpan-39bf76dae61 )