view release on metacpan or search on metacpan
# Dark mode
[code_mark]='L10'
[code_tick]='L15/L05'
[code_info]='L10'
[code_block]='/L05;E'
[code_inline]='L25/L05'
[emphasis_mark]='L10'
```
The `code_block` label includes `;E` (erase line) for full-width background on fenced code blocks. `code_tick` has background color matching `code_inline` for visual continuity, with dimmer foreground. `code_inline` has explicit foreground (`L00`/`L2...
Inline code backticks are displayed as `` `content´ `` using `code_tick` color for the markers. Multi-backtick delimiters (``` `` ```, ```` ``` ````, etc.) are collapsed to a single pair, with optional surrounding spaces stripped per CommonMark. The...
Regex patterns used by the md module:
Fenced code blocks ([CommonMark](https://spec.commonmark.org/0.31.2/#fenced-code-blocks)):
```
^ {0,3}(?<bt>`{3,}+|~{3,}+)(.*)\n((?s:.*?))^ {0,3}(\g{bt})
```
#### Code Span Pattern and `(*SKIP)(*FAIL)` Protection
`$CODE` matches code spans (named captures `_bt`, `_content`). `$SKIP_CODE = qr{$CODE (*SKIP)(*FAIL)}` is used as first alternative in link/emphasis substitutions to skip code spans. Named captures required â `$SKIP_CODE` consumes `$1`. Link patter...
#### Link Text Matching Pattern
`$LT = qr/(?:`[^`\n]*+`|\\.|[^`\\\n\]]++)+/` â three branches: backtick-span (allows `]` inside), backslash-escape (`\]`), any other char. Possessive quantifiers prevent backtracking.
### Mode Detection with [Getopt::EX::termcolor](https://metacpan.org/pod/Getopt::EX::termcolor)
Terminal background luminance (0-100) is detected via OSC 11 query. Luminance < 50 â dark mode, ⥠50 â light mode.
### [Getopt::Long::Bash](https://metacpan.org/pod/Getopt::Long::Bash) (getoptlong.sh)
Option parsing uses getoptlong.sh from Getopt::Long::Bash module.
#### OPTS Array Format
```bash
declare -A OPTS=(
[&REQUIRE]=0.7.1 [&USAGE]="$USAGE"
Add decorative border lines (`#`) above and below h1 headings,
using `=+` to append a text transformation while preserving the
original heading color.
Use `-d` to dump current theme values in sourceable format.
- **-m** _MODE_, **--mode**=_MODE_
Select light or dark mode. Default is `light`.
If the terminal supports background color detection (via
[Getopt::EX::termcolor](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3Atermcolor)), the mode is automatically selected based on
terminal luminance.
Each theme has light and dark variants optimized for different terminal
backgrounds. The built-in `default` theme uses RoyalBlue as the base
color with automatic luminance adjustment:
- `light` - RoyalBlue with luminance 25 (dark text for light backgrounds)
- `dark` - RoyalBlue with luminance 80 (bright text for dark backgrounds)
- **-B** _COLOR_, **--base-color**=_COLOR_
Override the theme's base color. The base color determines the overall
color scheme because all heading colors (h1, h2, h3, etc.) are derived
from it by adjusting luminance. For example, h2 might be `${base}+y20`
(base color with luminance increased by 20).
**Simple color name** - luminance is adjusted automatically:
When you specify just a color name (without `<>` brackets or
other syntax), the default luminance adjustment is applied based on
the current mode:
-B RoyalBlue # becomes <RoyalBlue>=y25 in light mode
# becomes <RoyalBlue>=y80 in dark mode
This makes it easy to try different colors without worrying about
luminance values. The default adjustments (`=y25` for light, `=y80`
for dark) are designed to provide good contrast against typical terminal
backgrounds.
**Full color specification** - used exactly as specified:
If you include `<>` brackets, luminance modifiers, or use RGB
notation, the value is used as-is without any automatic adjustment:
-B '<Ivory>' # original color, no adjustment
-B '<Ivory>=y50' # explicit luminance 50
-B '#780043' # burgundy in hex
-B '(120,0,67)' # same color in RGB decimal
`FILE`, `FILE_FORMAT`) are consumed locally and applied to both
light and dark themes; all other parameters are forwarded to the
md module.
Color labels (`h1`, `bold`, `italic`, etc.) are accepted as
config parameters and override default colors. The `${base}`
placeholder can be used and will be expanded at runtime.
mdee --config h1=RD # red h1
mdee --config bold=GD --config italic=YI # green bold, yellow italic
mdee --config h1='L25D/R;E' # custom h1 with background
mdee --config FILE='L25D/R;E' # red file label
mdee --config FILE_FORMAT=%s: # simple format
mdee --config hashed.h3=1 # enable h3 closing hashes
Theme keys consumed by mdee:
- `base` - Base color (equivalent to `--base-color`)
- `FILE` - Color spec for file label (default: `L25D/${base};E` for light, `L00D/${base};E` for dark). This is passed to greple's `FILE` label and cannot be set via `--cm`.
- `FILE_FORMAT` - Format string for file label passed to greple's `--format FILE=` (default: `\n %s\n\n`). Cannot be set via `--cm`.
## Highlight Options
- **--colormap**=_LABEL_=_SPEC_, **--cm**=_LABEL_=_SPEC_
Override the color for a specific element. _LABEL_ is one of the
color labels listed below. _SPEC_ follows
[Term::ANSIColor::Concise](https://metacpan.org/pod/Term%3A%3AANSIColor%3A%3AConcise) format.
--colormap h1=RD # red bold headings
--colormap code_block=/L20;E # dark background for code blocks
--colormap bold='${base}D' # base color bold
Available labels:
h1 - h6 Heading levels 1 through 6
bold Bold (**text** or __text__)
italic Italic (*text* or _text_)
strike Strikethrough (~~text~~)
emphasis_mark Emphasis markers (**, *, __, _, ~~)
bold_mark Bold markers only (overrides emphasis_mark)
Changing the base color automatically affects all derived colors
(h1, h2, bold, etc.) because the md module expands `${base}`
references.
Use `-d` to dump current theme values in sourceable format.
**Color specification format**
Color specifications use [Term::ANSIColor::Concise](https://metacpan.org/pod/Term%3A%3AANSIColor%3A%3AConcise) format.
The `FG/BG` notation specifies foreground and background colors
(e.g., `L25D/${base};E` means gray foreground on base-colored background).
The `${base}` string is expanded to the base color value after loading.
# EXAMPLES
mdee README.md # view markdown file
mdee -C2 document.md # 2-column view
mdee -G2x2 manual.md # 2x2 grid (4-up)
mdee -w60 narrow.md # narrower text width
mdee --no-pager file.md # without pager
mdee --no-nup file.md # output to stdout without nup
This command requires the following:
- [App::Greple](https://metacpan.org/pod/App%3A%3AGreple) - pattern matching and highlighting
- [App::Greple::tee](https://metacpan.org/pod/App%3A%3AGreple%3A%3Atee) - filter integration
- [App::ansifold](https://metacpan.org/pod/App%3A%3Aansifold) - ANSI-aware text folding
- [App::ansicolumn](https://metacpan.org/pod/App%3A%3Aansicolumn) - ANSI-aware column formatting
- [App::nup](https://metacpan.org/pod/App%3A%3Anup) - N-up multi-column paged output
- [App::ansiecho](https://metacpan.org/pod/App%3A%3Aansiecho) - ANSI color output
- [Getopt::Long::Bash](https://metacpan.org/pod/Getopt%3A%3ALong%3A%3ABash) - bash option parsing
- [Getopt::EX::termcolor](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3Atermcolor) - terminal background detection
# IMPLEMENTATION
**em·dee** is implemented as a Bash script that orchestrates multiple
specialized tools into a unified pipeline. The architecture follows
Unix philosophy: each tool does one thing well, and they communicate
through standard streams.
The overall data flow is:
The `${base}` placeholder in color values is expanded by the md
module. The base color is determined by `--base-color` option
(default: RoyalBlue) with automatic luminance adjustment based on
mode (`=y25` for light, `=y80` for dark).
### Color Specifications
Colors are specified using [Term::ANSIColor::Concise](https://metacpan.org/pod/Term%3A%3AANSIColor%3A%3AConcise) format.
The `--colormap` (`--cm`) option maps colors to captured groups. For example,
`L00D/${base};E` specifies gray foreground on base-colored background.
The color specification supports modifiers:
- `+y10` / `-y10`: Adjust luminance by percentage
- `=y50`: Set absolute luminance
- `D`: Bold, `U`: Underline, `E`: Erase line
### Terminal Mode Detection
**em·dee** uses [Getopt::EX::termcolor](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3Atermcolor) to detect terminal background
luminance. If luminance is below 50%, dark mode is automatically
selected.
# LIMITATIONS
## 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., `` `<!-->` ``).
- `LESS`
Default: `-R`. The `-R` option is required for ANSI color
sequences to be displayed correctly.
- `LESSANSIENDCHARS`
Default: `mK`. This tells `less` to recognize ANSI sequences
ending with `m` (SGR color) and `K` (erase line). The erase line
sequence is used for background color rendering.
If you already have these variables set in your environment, **mdee**
does not override them.
# SEE ALSO
- [App::Greple::md](https://metacpan.org/pod/App%3A%3AGreple%3A%3Amd)
Greple module for Markdown syntax highlighting, table formatting,
and text folding. Bundled with this distribution.
docs/plans/2026-02-16-greple-md-implementation.md view on Meta::CPAN
```
option default \
-G --all --need=0 --filestyle=once --color=always \
--cm code_fence=L20 \
--cm code_lang=L18 \
--cm code_body=/L23;E \
-E '(?!)' \
--print &__PACKAGE__::colorize
```
Note: The current mdee `code_block` key uses comma-separated colors for 4 capture groups: `'L20 , L18 , /L23;E , L20'`. In the module, these become separate `--cm` labels: `code_fence` (opening+closing), `code_lang` (language specifier), `code_body` ...
**Step 4: Test code block colorization**
Run: `greple -Mmd -Ilib /Users/utashiro/Git/tecolicom/App-mdee/t/test.md 2>/dev/null | head -30`
Expected: Code blocks should be visibly colored (gray text/background)
**Step 5: Commit**
```bash
git add lib/App/Greple/md.pm
git commit -m "feat: code block colorization with state machine"
```
---
docs/plans/2026-02-16-greple-md-implementation.md view on Meta::CPAN
--cm h4=<RoyalBlue>=y80;UD \
--cm h5=<RoyalBlue>=y80;U \
--cm h6=<RoyalBlue>=y80 \
```
Note: mdee's `${base}` expansion is done in Bash. For module defaults, the base color is hardcoded. mdee will override all colors via `--cm` passthrough anyway.
**Step 3: Test cumulative heading + link coloring**
Run: `echo '## See [docs](https://example.com) here' | greple -Mmd -Ilib 2>/dev/null | cat -v`
Expected: The line has both h2 color (background) and link color (inside the link text), with OSC 8 sequences preserved.
**Step 4: Commit**
```bash
git add lib/App/Greple/md.pm
git commit -m "feat: heading colorization with cumulative coloring over links"
```
---
docs/plans/2026-02-16-greple-md-implementation.md view on Meta::CPAN
**Step 1: Full visual test with light mode**
Run: `greple -Mmd -Ilib /Users/utashiro/Git/tecolicom/App-mdee/t/test.md 2>/dev/null | less -R`
Verify:
- [ ] Headers h1-h6 are colored with decreasing prominence
- [ ] Bold text is bold with base color
- [ ] Italic text is italic
- [ ] Strikethrough has strikethrough styling
- [ ] Inline code has background color
- [ ] Code blocks have background color, fence and language colored differently
- [ ] Links show as `[text]` with clickable OSC 8 (on supported terminals)
- [ ] Images show as `![alt]` with clickable OSC 8
- [ ] Blockquote `>` marker is colored
- [ ] Horizontal rules are colored
- [ ] HTML comments are colored
- [ ] Links inside headings have both heading color AND link color
- [ ] Bold inside inline code is NOT processed as bold
**Step 2: Full visual test with dark mode**
lib/App/Greple/md.pm view on Meta::CPAN
It colorizes headings, bold, italic, strikethrough, inline code,
fenced code blocks, HTML comments, blockquotes, horizontal rules,
links, and images. Tables are formatted with aligned columns and
optional Unicode box-drawing borders. Long lines in list items can
be folded with proper indentation. Links become clickable via OSC 8
terminal hyperlinks in supported terminals.
Nested elements are handled with cumulative coloring: for example,
a link inside a heading retains both its link color and the heading
background color.
For a complete Markdown viewing experience with line folding,
multi-column output, and themes, see L<App::mdee>, which uses this
module as its highlighting engine.
=head1 COMMAND OPTIONS
The following options are defined as greple command options
(specified after C<-->).
lib/App/mdee.pm view on Meta::CPAN
original heading color.
=back
Use C<-d> to dump current theme values in sourceable format.
=item B<-m> I<MODE>, B<--mode>=I<MODE>
Select light or dark mode. Default is C<light>.
If the terminal supports background color detection (via
L<Getopt::EX::termcolor>), the mode is automatically selected based on
terminal luminance.
Each theme has light and dark variants optimized for different terminal
backgrounds. The built-in C<default> theme uses RoyalBlue as the base
color with automatic luminance adjustment:
=over 4
=item C<light> - RoyalBlue with luminance 25 (dark text for light backgrounds)
=item C<dark> - RoyalBlue with luminance 80 (bright text for dark backgrounds)
=back
=item B<-B> I<COLOR>, B<--base-color>=I<COLOR>
Override the theme's base color. The base color determines the overall
color scheme because all heading colors (h1, h2, h3, etc.) are derived
from it by adjusting luminance. For example, h2 might be C<${base}+y20>
(base color with luminance increased by 20).
lib/App/mdee.pm view on Meta::CPAN
When you specify just a color name (without C<E<lt>E<gt>> brackets or
other syntax), the default luminance adjustment is applied based on
the current mode:
-B RoyalBlue # becomes <RoyalBlue>=y25 in light mode
# becomes <RoyalBlue>=y80 in dark mode
This makes it easy to try different colors without worrying about
luminance values. The default adjustments (C<=y25> for light, C<=y80>
for dark) are designed to provide good contrast against typical terminal
backgrounds.
B<Full color specification> - used exactly as specified:
If you include C<E<lt>E<gt>> brackets, luminance modifiers, or use RGB
notation, the value is used as-is without any automatic adjustment:
-B '<Ivory>' # original color, no adjustment
-B '<Ivory>=y50' # explicit luminance 50
-B '#780043' # burgundy in hex
-B '(120,0,67)' # same color in RGB decimal
lib/App/mdee.pm view on Meta::CPAN
C<FILE>, C<FILE_FORMAT>) are consumed locally and applied to both
light and dark themes; all other parameters are forwarded to the
md module.
Color labels (C<h1>, C<bold>, C<italic>, etc.) are accepted as
config parameters and override default colors. The C<${base}>
placeholder can be used and will be expanded at runtime.
mdee --config h1=RD # red h1
mdee --config bold=GD --config italic=YI # green bold, yellow italic
mdee --config h1='L25D/R;E' # custom h1 with background
mdee --config FILE='L25D/R;E' # red file label
mdee --config FILE_FORMAT=%s: # simple format
mdee --config hashed.h3=1 # enable h3 closing hashes
Theme keys consumed by mdee:
=over 4
=item C<base> - Base color (equivalent to C<--base-color>)
lib/App/mdee.pm view on Meta::CPAN
=over 4
=item B<--colormap>=I<LABEL>=I<SPEC>, B<--cm>=I<LABEL>=I<SPEC>
Override the color for a specific element. I<LABEL> is one of the
color labels listed below. I<SPEC> follows
L<Term::ANSIColor::Concise> format.
--colormap h1=RD # red bold headings
--colormap code_block=/L20;E # dark background for code blocks
--colormap bold='${base}D' # base color bold
Available labels:
h1 - h6 Heading levels 1 through 6
bold Bold (**text** or __text__)
italic Italic (*text* or _text_)
strike Strikethrough (~~text~~)
emphasis_mark Emphasis markers (**, *, __, _, ~~)
bold_mark Bold markers only (overrides emphasis_mark)
lib/App/mdee.pm view on Meta::CPAN
Changing the base color automatically affects all derived colors
(h1, h2, bold, etc.) because the md module expands C<${base}>
references.
Use C<-d> to dump current theme values in sourceable format.
B<Color specification format>
Color specifications use L<Term::ANSIColor::Concise> format.
The C<FG/BG> notation specifies foreground and background colors
(e.g., C<L25D/${base};E> means gray foreground on base-colored background).
The C<${base}> string is expanded to the base color value after loading.
=head1 EXAMPLES
mdee README.md # view markdown file
mdee -C2 document.md # 2-column view
mdee -G2x2 manual.md # 2x2 grid (4-up)
mdee -w60 narrow.md # narrower text width
mdee --no-pager file.md # without pager
mdee --no-nup file.md # output to stdout without nup
lib/App/mdee.pm view on Meta::CPAN
=item * L<App::ansifold> - ANSI-aware text folding
=item * L<App::ansicolumn> - ANSI-aware column formatting
=item * L<App::nup> - N-up multi-column paged output
=item * L<App::ansiecho> - ANSI color output
=item * L<Getopt::Long::Bash> - bash option parsing
=item * L<Getopt::EX::termcolor> - terminal background detection
=back
=head1 IMPLEMENTATION
B<em·dee> is implemented as a Bash script that orchestrates multiple
specialized tools into a unified pipeline. The architecture follows
Unix philosophy: each tool does one thing well, and they communicate
through standard streams.
lib/App/mdee.pm view on Meta::CPAN
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<< `<!-->` >>).
lib/App/mdee.pm view on Meta::CPAN
=item C<LESS>
Default: C<-R>. The C<-R> option is required for ANSI color
sequences to be displayed correctly.
=item C<LESSANSIENDCHARS>
Default: C<mK>. This tells C<less> to recognize ANSI sequences
ending with C<m> (SGR color) and C<K> (erase line). The erase line
sequence is used for background color rendering.
=back
If you already have these variables set in your environment, B<mdee>
does not override them.
=head1 SEE ALSO
=over 4
script/mdee view on Meta::CPAN
declare -A pattern
for ((_i=0; _i<${#patterns_default[@]}; _i+=2)); do
_name=${patterns_default[_i]}
[[ -v pattern[$_name] ]] && pattern[$_name]+='|'
pattern[$_name]+=${patterns_default[_i+1]}
done
# User config file path
config_file="${XDG_CONFIG_HOME:-$HOME/.config}/mdee/config.sh"
# Detect mode from terminal background luminance
# Returns "dark" if luminance < 50, "light" otherwise
# Returns empty string if luminance cannot be determined
detect_terminal_mode() {
local lum
lum=$(perl -MGetopt::EX::termcolor=luminance -e luminance 2>/dev/null) || return
[[ $lum ]] || return
(( lum < 50 )) && echo dark || echo light
}
##############################################################################
script/mdee view on Meta::CPAN
original heading color.
=back
Use C<-d> to dump current theme values in sourceable format.
=item B<-m> I<MODE>, B<--mode>=I<MODE>
Select light or dark mode. Default is C<light>.
If the terminal supports background color detection (via
L<Getopt::EX::termcolor>), the mode is automatically selected based on
terminal luminance.
Each theme has light and dark variants optimized for different terminal
backgrounds. The built-in C<default> theme uses RoyalBlue as the base
color with automatic luminance adjustment:
=over 4
=item C<light> - RoyalBlue with luminance 25 (dark text for light backgrounds)
=item C<dark> - RoyalBlue with luminance 80 (bright text for dark backgrounds)
=back
=item B<-B> I<COLOR>, B<--base-color>=I<COLOR>
Override the theme's base color. The base color determines the overall
color scheme because all heading colors (h1, h2, h3, etc.) are derived
from it by adjusting luminance. For example, h2 might be C<${base}+y20>
(base color with luminance increased by 20).
script/mdee view on Meta::CPAN
When you specify just a color name (without C<E<lt>E<gt>> brackets or
other syntax), the default luminance adjustment is applied based on
the current mode:
-B RoyalBlue # becomes <RoyalBlue>=y25 in light mode
# becomes <RoyalBlue>=y80 in dark mode
This makes it easy to try different colors without worrying about
luminance values. The default adjustments (C<=y25> for light, C<=y80>
for dark) are designed to provide good contrast against typical terminal
backgrounds.
B<Full color specification> - used exactly as specified:
If you include C<E<lt>E<gt>> brackets, luminance modifiers, or use RGB
notation, the value is used as-is without any automatic adjustment:
-B '<Ivory>' # original color, no adjustment
-B '<Ivory>=y50' # explicit luminance 50
-B '#780043' # burgundy in hex
-B '(120,0,67)' # same color in RGB decimal
script/mdee view on Meta::CPAN
C<FILE>, C<FILE_FORMAT>) are consumed locally and applied to both
light and dark themes; all other parameters are forwarded to the
md module.
Color labels (C<h1>, C<bold>, C<italic>, etc.) are accepted as
config parameters and override default colors. The C<${base}>
placeholder can be used and will be expanded at runtime.
mdee --config h1=RD # red h1
mdee --config bold=GD --config italic=YI # green bold, yellow italic
mdee --config h1='L25D/R;E' # custom h1 with background
mdee --config FILE='L25D/R;E' # red file label
mdee --config FILE_FORMAT=%s: # simple format
mdee --config hashed.h3=1 # enable h3 closing hashes
Theme keys consumed by mdee:
=over 4
=item C<base> - Base color (equivalent to C<--base-color>)
script/mdee view on Meta::CPAN
=over 4
=item B<--colormap>=I<LABEL>=I<SPEC>, B<--cm>=I<LABEL>=I<SPEC>
Override the color for a specific element. I<LABEL> is one of the
color labels listed below. I<SPEC> follows
L<Term::ANSIColor::Concise> format.
--colormap h1=RD # red bold headings
--colormap code_block=/L20;E # dark background for code blocks
--colormap bold='${base}D' # base color bold
Available labels:
h1 - h6 Heading levels 1 through 6
bold Bold (**text** or __text__)
italic Italic (*text* or _text_)
strike Strikethrough (~~text~~)
emphasis_mark Emphasis markers (**, *, __, _, ~~)
bold_mark Bold markers only (overrides emphasis_mark)
script/mdee view on Meta::CPAN
Changing the base color automatically affects all derived colors
(h1, h2, bold, etc.) because the md module expands C<${base}>
references.
Use C<-d> to dump current theme values in sourceable format.
B<Color specification format>
Color specifications use L<Term::ANSIColor::Concise> format.
The C<FG/BG> notation specifies foreground and background colors
(e.g., C<L25D/${base};E> means gray foreground on base-colored background).
The C<${base}> string is expanded to the base color value after loading.
=head1 EXAMPLES
mdee README.md # view markdown file
mdee -C2 document.md # 2-column view
mdee -G2x2 manual.md # 2x2 grid (4-up)
mdee -w60 narrow.md # narrower text width
mdee --no-pager file.md # without pager
mdee --no-nup file.md # output to stdout without nup
script/mdee view on Meta::CPAN
=item * L<App::ansifold> - ANSI-aware text folding
=item * L<App::ansicolumn> - ANSI-aware column formatting
=item * L<App::nup> - N-up multi-column paged output
=item * L<App::ansiecho> - ANSI color output
=item * L<Getopt::Long::Bash> - bash option parsing
=item * L<Getopt::EX::termcolor> - terminal background detection
=back
=head1 IMPLEMENTATION
B<em·dee> is implemented as a Bash script that orchestrates multiple
specialized tools into a unified pipeline. The architecture follows
Unix philosophy: each tool does one thing well, and they communicate
through standard streams.
script/mdee view on Meta::CPAN
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<< `<!-->` >>).
script/mdee view on Meta::CPAN
=item C<LESS>
Default: C<-R>. The C<-R> option is required for ANSI color
sequences to be displayed correctly.
=item C<LESSANSIENDCHARS>
Default: C<mK>. This tells C<less> to recognize ANSI sequences
ending with C<m> (SGR color) and C<K> (erase line). The erase line
sequence is used for background color rendering.
=back
If you already have these variables set in your environment, B<mdee>
does not override them.
=head1 SEE ALSO
=over 4