blib/lib/App/mdee.pm

filter: Statementstmt 100% 2 / 2 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 2 / 2 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/App/Greple/md/widen.pm ↑ Summary
1 package App::mdee;
2  
3 # DO NOT EDIT this file manually.
4 # POD documentation is appended from script/mdee at release time.
5 # See minil.toml for details.
6  
7 1 our $VERSION = "1.20";
8  
9 1 1;
10 =encoding utf-8
11  
12 =head1 NAME
13  
14 mdee - em·dee, Markdown Easy on the Eyes
15  
16 =head1 SYNOPSIS
17  
18 mdee [ options ] file ...
19  
20 -h --help show help
21 --version show version
22 -d --debug debug level (repeatable)
23 -x --[no-]trace trace mode (set -x)
24 -n --dryrun dry-run mode
25 -s --style=# output style (nup/pager/cat/filter/raw)
26 -f --filter shortcut for --style=filter
27 -p --plain shortcut for --style=pager
28 --[no-]fold line folding (default: on)
29 -r --[no-]refill join paragraph lines (default: off)
30 --[no-]table table formatting (default: on)
31 --[no-]trim trim cell spaces (default: on)
32 --[no-]nup nup paged output (default: on)
33 -V --parallel show files side by side
34 -L --[no-]lateral all pages in one row, scrolled sideways
35 --[no-]rule use Unicode rules for tables (default: on)
36 --ts --table-style=# table style: lattice, 3line or simple (default: lattice)
37 --cat-v visualize whitespace via cat-v
38 -w --width=# output width (default: terminal width)
39 --fold-width=# fold width (default: pane width - 3 - run-in)
40 --runin=# run-in width for line breaking (default: 4)
41 --runout=# run-out width for line breaking (default: 4)
42 --runlen=# set both run-in and run-out
43 --boundary=# fold boundary: word, space or none (default: word)
44 -t --theme=#[,#,...] color theme(s) (default: hashed,nomark,markcell,doubleline)
45 -m --mode=# light or dark (default: light)
46 -B --base-color=# override base color of theme
47 (e.g., Ivory, #780043, (120,0,67))
48 --config=KEY=VALUE set config parameter (e.g., h1=RD, FILE=...)
49 --cm --colormap=L=SPEC override color for element (e.g., h1=RD)
50 --hm --heading-markup=# enable markup in headings (all/bold/...)
51 --show=# set field visibility (e.g., italic=1)
52 -C --pane=#[,#] number of columns, and rows
53 -R --row=# number of rows
54 -G --grid=# grid layout (e.g., 2x3)
55 -P --page=# page height in lines
56 -S --pane-width=# pane width (default: 85)
57 --bs --border-style=# border style
58 --[no-]page-number page number on border (default: on)
59 --[no-]filename file name label (default: on)
60 --[no-]pager[=#] pager command
61 -T --device=# output device: tty, pdf, or a paper for PDF
62 (e.g., a4, a4p, a3l)
63 -o --output=FILE output file (PDF when it ends with .pdf)
64  
65 =head1 VERSION
66  
67 Version 1.20
68  
69 =cut
70 =head1 DESCRIPTION
71  
72 B<em·dee> (command: C<mdee>) is a terminal-based multi-column
73 Markdown text viewer with syntax highlighting, particularly
74 useful for reading documents generated by LLMs.
75  
76 =begin html
77  
78 <p><img width="1000" src="https://raw.githubusercontent.com/tecolicom/App-mdee/main/images/3-column.png">
79  
80 =end html
81  
82 It presents Markdown content in a clean, readable form: syntax
83 highlighting distinguishes document structure, line folding wraps
84 long list items, and tables are aligned with proper column
85 formatting. By default, markup characters (C<**>, C<`>,
86 C<[>...C<]>, etc.) are hidden so that the text reads naturally,
87 while color and styling preserve the structural information.
88 Closing hashes are appended to h3-h6 headers to make heading
89 levels visually distinct. On terminals supporting OSC 8, links
90 remain clickable.
91  
92 Use C<--no-theme> to display the original Markdown source with
93 markup characters intact.
94  
95 The same view is printed to PDF with C<-o file.pdf>. See
96 L</Printing to PDF>.
97  
98 =head2 Concept
99  
100 B<em·dee> began as a viewer for Markdown I<text>, not as a Markdown
101 renderer. The idea was to show a C<.md> file as it is written, line
102 for line, only made easier on the eyes with color: the Markdown is
103 not interpreted or reformatted. Some formatting has been added since
104 because it made the text more readable: tables are aligned, long
105 list items are folded, the default themes hide markup characters,
106 and closing hashes are appended to lower-level headings. With
107 C<--refill>, the lines that a Markdown parser has found to be
108 one paragraph are joined as well. Everything else is still the
109 source text. This is why backslash escapes such as C<\*> are shown
110 as written, and why C<--no-theme> gives back the original file, in
111 color.
112  
113 For full Markdown rendering, many other viewers are available, such
114 as C<glow> and C<mdcat>. Combine them with L<nup(1)|App::nup> for
115 similar paged output (e.g., C<nup glow README.md>, C<nup mdcat README.md>).
116  
117 The pipeline combines L<greple(1)|App::Greple> for colorization and
118 L<nup(1)|App::nup> for multi-column paged output.
119  
120 The following elements are highlighted. Elements marked with
121 C<--show> can be individually disabled via the C<--show> option.
122 Others are always processed for structural integrity.
123  
124 --show bold (**bold**, __bold__)
125 --show italic (*italic*, _italic_)
126 --show strike (~~strike~~)
127 --show code_inline (`code`)
128 --show header, h1-h6 (# heading)
129 --show horizontal_rule (---, ***, ___)
130 --show blockquote (> quote)
131 always code_mark (``` or ~~~)
132 code_block
133 code_info
134 always meta_mark (--- or +++ at the top)
135 meta_block
136 always comment (<!-- ... -->)
137 always link ([text](url))
138 image (![text])
139 image_link (![text](url))
140  
141 Tables and list item folding are controlled by C<--table> and
142 C<--fold> options, not by C<--show>.
143  
144 =head2 Multi-column Layout and Pagination
145  
146 By default, B<mdee> calculates the number of display columns by
147 dividing the output width (the terminal width unless C<--width>
148 is given) by the pane width (default 85 characters). This determines how the output is laid out and
149 paginated.
150  
151 When two or more columns fit, L<nup(1)|App::nup> arranges output
152 in multi-column layout with page-by-page pagination — content is
153 split into terminal-height pages viewed through a pager.
154  
155 When only one column fits, B<mdee> still uses nup for formatting
156 (borders, document layout) but disables page-by-page splitting,
157 so the content scrolls continuously in the pager. This avoids
158 wasted space from page breaks on narrow terminals while
159 maintaining the same visual appearance.
160  
161 To force page-by-page pagination even in single-column layout,
162 specify C<--nup> explicitly. The C<--pane-width> (C<-S>) option
163 adjusts the column width used for this calculation, and
164 C<--pane> (C<-C>) sets the number of columns directly. The
165 C<--width> (C<-w>) option replaces the terminal width in this
166 calculation and limits the output to that width.
167  
168 With two or more files, C<--parallel> shows the files side by side,
169 one pane per file, instead of one after another. Each file is
170 folded to its pane width, and the panes scroll together in the
171 pager. The screen shows as many files as fit, as many as the pages
172 of a single file, and the files that do not fit in one row continue
173 on the next, or on the right with C<--lateral>; C<--pane> (C<-C>)
174 sets the number of panes.
175  
176 Use C<-p> (C<--style=pager>) for a simpler view without nup
177 formatting — highlighted output is piped directly through a
178 pager. Use C<-f> (C<--style=filter>) to write highlighted
179 output to stdout without a pager, suitable for piping into
180 other commands.
181  
182 =head2 Printing to PDF
183  
184 B<mdee> prints the document to PDF when the output file ends with
185 C<.pdf>, or when a paper is given as the device with C<-T>.
186  
187 mdee -o README.pdf README.md # A4 in landscape
188 mdee -T a4p -o README.pdf README.md # A4 in portrait
189 mdee -T a3 README.md > README.pdf # A3, to the standard output
190  
191 The paper takes the place of the terminal. The number of columns is
192 the width of the paper in characters divided by the pane width, and
193 the text is folded for it, in the same way as on the terminal: A4 in
194 landscape is 206 characters wide and has two panes, and A4 in
195 portrait is 100 characters wide and has one. C<-C> and C<-S> work
196 as on the terminal. The mode is C<light> unless C<--mode> is given,
197 because the paper is white.
198  
199 A paper is given by its name, with the letter C<p> or C<l> for
200 portrait or landscape, and the margin in millimeters after C<:m>.
201 The default is landscape with a margin of 5 mm.
202  
203 mdee -T a4p:m10 -o README.pdf README.md
204  
205 A sheet has 60 lines. The rows of C<-C> divide the sheet, and the
206 size of the characters is kept: C<-C2,2> gives four pages of 30
207 lines on a sheet. C<-P> sets the lines of a page instead, and the
208 characters become smaller or larger to put the pages on the sheet:
209 C<-C2,2 -P60> prints four pages of 60 lines on a sheet in half the
210 size, as a printer does for 4-up.
211  
212 mdee -C2,2 -o README.pdf README.md
213 mdee -C2,2 -P60 -o README.pdf README.md
214  
215 L<nup(1)|App::nup> and
216 L<ansi2pdf(1)|https://github.com/tecolicom/App-ansi2pdf> make the
217 PDF, so C<ansi2pdf> has to be installed, and the output style has to
218 be C<nup>, which is the default. See C<-T> and C<-o> in
219 L</Output Options>.
220  
221 =head1 INSTALLATION
222  
223 =head2 Homebrew
224  
225 Use L<tecolicom/tap|https://github.com/tecolicom/homebrew-tap>:
226  
227 brew tap tecolicom/tap
228 brew install app-mdee
229  
230 =head2 CPAN
231  
232 cpanm -n App::mdee
233  
234 =head1 OPTIONS
235  
236 =head2 General Options
237  
238 =over 4
239  
240 =item B<-h>, B<--help>
241  
242 Show help message.
243  
244 =item B<--version>
245  
246 Show version.
247  
248 =item B<-d>, B<--debug>
249  
250 Set debug level. Can be repeated for increasing verbosity.
251  
252 =over 4
253  
254 =item C<-d>
255  
256 Show theme values (C<theme_light[]>/C<theme_dark[]>, C<md_config[]>)
257 and pipeline stage names.
258  
259 =item C<-dd>
260  
261 Above, plus full command lines for each pipeline stage.
262  
263 =back
264  
265 =item B<-x>, B<--trace>, B<--no-trace>
266  
267 Enable or disable shell trace mode (C<set -x>). Useful for
268 debugging script execution. Can be toggled: C<-x --no-x> enables
269 then disables tracing.
270  
271 =item B<-n>, B<--dryrun>
272  
273 Dry-run mode. Print the commands that would be run, one pipeline
274 stage per line joined with C<|>, without running them. Arguments
275 are quoted so that the output can be pasted into a shell. The
276 environment that B<mdee> sets (C<LESS>, C<LESSANSIENDCHARS>) is not
277 shown. With C<-d>, the stage names are printed to stderr as well.
278  
279 =back
280  
281 =head2 Processing Options
282  
283 =over 4
284  
285 =item B<-s> I<STYLE>, B<--style>=I<STYLE>
286  
287 Set the output style. Default is C<nup>. Available styles:
288  
289 =over 4
290  
291 =item C<nup> - Full pipeline: fold + table + nup paged output (default)
292  
293 =item C<pager> - Fold + table, output to pager (C<$PAGER> or C<less>)
294  
295 =item C<cat> - Fold + table, output to stdout
296  
297 =item C<filter> - Table only (no fold, no nup), suitable for piping
298  
299 =item C<raw> - Highlight only (no fold, no table, no nup)
300  
301 =back
302  
303 The style sets the initial state of C<--fold>, C<--table>, and
304 C<--nup> options. Subsequent options can override individual
305 settings:
306  
307 mdee -s filter --fold file.md # filter + fold
308 mdee -p --no-fold file.md # pager without fold
309  
310 =item B<-f>, B<--filter>
311  
312 Shortcut for C<--style=filter>. Reads from stdin (or files) and
313 outputs highlighted Markdown to stdout. Disables line folding and
314 nup paged output, but keeps table formatting enabled. Useful for
315 piping Markdown content through mdee for syntax highlighting.
316  
317 =item B<-p>, B<--plain>
318  
319 Shortcut for C<--style=pager>. Enables fold and table formatting,
320 outputs through a pager (C<$PAGER> or C<less>) instead of nup.
321  
322 =item B<--[no-]fold>
323  
324 Enable or disable line folding for list items, definition lists,
325 block quotes and, with C<--refill>, paragraphs. When enabled, long
326 lines are wrapped with proper indentation using
327 L<ansifold(1)|App::ansifold>: the continuation lines of a list item
328 are indented under its text, those of a block quote start with the
329 quote marker again. Default is enabled.
330  
331 Supported list markers: C<*>, C<+>, C<->, C<1.>, C<1)>, C<#.>, C<#)>.
332 The C<#.> and C<#)> forms are the auto-numbered lists of Pandoc's
333 Markdown.
334  
335 =item B<-r>, B<--[no-]refill>
336  
337 Join the lines of each paragraph into one line. Default is disabled;
338 C<default[refill]=1> in the configuration file enables it.
339  
340 What a paragraph is, a Markdown parser decides: a run of lines at the
341 top level, in a block quote, in a list item or in a definition body.
342 Those lines are joined in the original text. Headings, tables, code
343 blocks, front matter and everything else stay as written. A hard
344 line break (two or more spaces or a backslash at the end of a line)
345 is kept.
346  
347 Lines are joined with one space, or with nothing after a fullwidth
348 punctuation character and between two characters of a script that is
349 written without spaces, as L<ansifold(1)|App::ansifold> does. When
350 fold is enabled, the joined paragraphs are folded to the fold width
351 like list items; otherwise each is one long line.
352  
353 The parser is L<Markdown::Perl>, which is installed with B<mdee>, or
354 the L<CommonMark> module (an interface to libcmark) when it is there,
355 which is faster. C<--config refill_parser=pandoc> uses pandoc 2.11.3
356 or later instead.
357  
358 Front matter at the top of the file, TOML between C<+++> lines or
359 YAML between C<---> lines (or ended by C<...>), is left as it is
360 and shown as a code block; C<--config front_matter=0> takes its lines
361 as Markdown.
362  
363 =item B<--[no-]table>
364  
365 Enable or disable table formatting. When enabled, Markdown tables
366 are formatted using L<ansicolumn(1)|App::ansicolumn> for aligned column display.
367 Column alignment specified in the separator line (C<:---> for left,
368 C<:---:> for center, C<---:> for right) is respected.
369 Default is enabled.
370  
371 When folding is enabled, a table wider than the fold width is fit into
372 that width: columns that fit keep their width, and the cells of
373 over-wide columns are wrapped. A table that already fits is not
374 changed. Use C<--config table_width=0> to disable wrapping, or
375 C<--config table_width=N> to use a different width. Per-column
376 widths can be given with C<--config table_cell=SPEC>, where SPEC
377 is a colon-separated list passed to ansicolumn's C<--cell> option
378 (for example C<0:10> fixes the second column at 10 columns, and
379 C<< '<30' >> caps every column at 30). Marks can be put at the
380 start of cell lines, in place of the cell's leading space so that
381 column widths do not change. C<--config table_cell_mark=STRING>
382 marks the first line of every body cell in a column that has a
383 wrapped cell; the header row and columns that fit are left alone.
384 The default theme C<markcell> sets it to C<‣> (U+2023).
385 C<--config table_wrap_mark=STRING> marks the second and later
386 lines of a wrapped cell, so that they are not read as new rows;
387 the theme C<markwrap> sets it to C<›> (U+203A). Without these
388 themes no mark is used.
389  
390 =item B<--[no-]trim>
391  
392 Trim whitespace from table cell content before formatting.
393 This is useful when the source table is pre-formatted with
394 aligned spacing, which would otherwise prevent column alignment
395 directives from working correctly. Default is enabled.
396  
397 =item B<--[no-]nup>
398  
399 Enable or disable L<nup(1)|App::nup> for multi-column paged output.
400 When disabled, output goes directly to stdout without formatting.
401 Default is enabled. When explicitly specified, forces nup's
402 native pagination even in single-column layout (which normally
403 uses the pager instead).
404  
405 =item B<--[no-]rule>
406  
407 Enable or disable Unicode rule characters for table borders.
408 When enabled, ASCII pipe characters (C<|>) are replaced with
409 Unicode box-drawing characters (C<│>, C<├>, C<┤>, C<┼>) and
410 dashes (C<->) in separator lines are replaced with horizontal
411 rules (C<─>). Default is enabled.
412  
413 =item B<--table-style>=I<STYLE>, B<--ts> I<STYLE>
414  
415 Select how tables are drawn. C<lattice> (default) keeps a separator
416 between the columns, C<│> or C<|> depending on C<--rule>. C<pipe> is
417 another name of it, kept for compatibility:
418  
419 Left │ Center │ Right │ Default
420 ──────┼────────┼───────┼─────────
421 a │ b │ c │ d
422  
423 C<3line> separates the columns by spaces only and draws three rules: a
424 rule the width of the table above and below it, and a rule per column
425 below the header.
426  
427 ─────────────────────────────────
428 Left Center Right Default
429 ────── ──────── ─────── ─────────
430 a b c d
431 ─────────────────────────────────
432  
433 C<simple> also separates the columns by spaces only, and draws the
434 rule per column below the header and below the table.
435  
436 Left Center Right Default
437 ────── ──────── ─────── ─────────
438 a b c d
439 ────── ──────── ─────── ─────────
440  
441 The rules are drawn with C<-> with C<--no-rule>.
442  
443 =item B<--cat-v>
444  
445 Pass the output through L<cat-v(1)|App::cat::v> to visualize
446 whitespace and special characters. Spaces are shown as C<·>
447 and other invisible characters are made visible. Newline
448 visualization is disabled by default.
449  
450 =item B<-w> I<N>, B<--width>=I<N>
451  
452 Set the output width in characters. Default is the terminal
453 width. With nup, this width is used in place of the terminal
454 width to calculate the number of columns, and it is passed to
455 L<ansicolumn(1)|App::ansicolumn> so that the panes fit into it:
456  
457 mdee -w 170 file.md # two 85-column panes on a wide terminal
458 mdee -V -w 170 a.md b.md # two files in 85 columns each
459  
460 Without nup (C<--style=cat>, C<pager>, C<filter>, or C<--no-nup>),
461 the text itself is the output, so this is the fold width.
462  
463 =item B<--fold-width>=I<N>
464  
465 Set the fold width for text wrapping directly. Default is the
466 pane width (output width divided by the number of columns) minus
467 3 for borders and padding and the run-in width (see C<--runin>),
468 which gives 78 when pane-width is 85.
469 Only effective when C<--fold> is enabled. The same width is used
470 to fit tables (see C<--table>).
471  
472 =item B<--runin>=I<N>, B<--runout>=I<N>, B<--runlen>=I<N>
473  
474 Set the run-in and run-out widths that L<ansicolumn(1)|App::ansicolumn>
475 uses for line breaking (kinsoku) when nup folds the panes.
476 C<--runlen> sets both; options given later override earlier ones.
477 Default is 4. A run-in character may go past the fold width, so
478 ansicolumn keeps the run-in width free at the end of the pane, and
479 the default fold width is made narrower by the same amount. These
480 values are given to nup, and they take precedence over the values
481 in F<~/.ansicolumnrc>. The same values are given to the md module
482 as C<fold_runin> and C<fold_runout>, so that the lines it folds run
483 in by the width kept free, not more.
484  
485 =item B<--boundary>=C<word>|C<space>|C<none>
486  
487 Set where L<ansicolumn(1)|App::ansicolumn> may break a line when nup
488 folds the panes, as its C<--boundary> option: C<word> (default) does
489 not break inside an alphanumeric word, C<space> not inside a sequence
490 of non-space characters, and C<none> breaks anywhere. Lists, tables
491 and the paragraphs joined by C<--refill> are folded by the md module
492 at word boundaries, and this option keeps the other paragraphs, which
493 are folded by nup, in step with them. The value is given to nup,
494 which gives it to ansicolumn after F<~/.ansicolumnrc>, so it takes
495 precedence over the value there.
496  
497 =back
498  
499 =head2 Theme Options
500  
501 B<em·dee> supports color themes for customizing syntax highlighting.
502 Themes define colors for various Markdown elements (headers, code blocks,
503 bold text, etc.).
504  
505 =over 4
506  
507 =item B<-t> I<NAME>, B<--theme>=I<NAME>[,I<NAME>,...]
508  
509 Select color themes. The default is C<hashed,nomark,markcell,doubleline>,
510 which appends closing hashes to h3-h6 headers, hides markup
511 characters for a clean reading experience, marks the rows of
512 tables whose cells are wrapped, and gives h4 a double underline.
513  
514 Themes specified with C<--theme> are added to the default, not
515 replacing it (C<default[theme]> in the configuration file replaces
516 it). Multiple themes can be specified as comma-separated names or
517 by repeating the option. Each theme is applied in order as a
518 transformation, and when two themes set the same value the later
519 one wins:
520  
521 mdee --theme=warm file.md # the default themes + warm
522 mdee --no-theme --theme=warm # warm only (clear default first)
523 mdee --no-theme file.md # no theme (show all markup)
524  
525 Use C<--no-theme> to clear the default theme. It can be combined
526 with C<--theme> to start fresh.
527  
528 See L</THEMES> for the themes that come with B<mdee> and how to
529 write one.
530  
531 Use C<-d> to dump current theme values in sourceable format.
532  
533 =item B<-m> I<MODE>, B<--mode>=I<MODE>
534  
535 Select light or dark mode. Default is C<light>.
536  
537 If the terminal supports background color detection (via
538 L<Getopt::EX::termcolor>), the mode is automatically selected based on
539 terminal luminance.
540 When the environment variable C<TERM_LUMINANCE> is set (0 to 100, as
541 L<Getopt::EX::termcolor> uses it), its value is taken instead and the
542 terminal is not asked; below 50 is dark.
543  
544 Each theme has light and dark variants optimized for different terminal
545 backgrounds. The built-in C<default> theme uses RoyalBlue as the base
546 color with automatic luminance adjustment:
547  
548 =over 4
549  
550 =item C<light> - RoyalBlue with luminance 25 (dark text for light backgrounds)
551  
552 =item C<dark> - RoyalBlue with luminance 80 (bright text for dark backgrounds)
553  
554 =back
555  
556 =item B<-B> I<COLOR>, B<--base-color>=I<COLOR>
557  
558 Override the theme's base color. The base color determines the overall
559 color scheme because all heading colors (h1, h2, h3, etc.) are derived
560 from it by adjusting luminance. For example, h2 might be C<${base}+y20>
561 (base color with luminance increased by 20).
562  
563 B<Simple color name> - luminance is adjusted automatically:
564  
565 When you specify just a color name (without C<E<lt>E<gt>> brackets or
566 other syntax), the default luminance adjustment is applied based on
567 the current mode:
568  
569 -B RoyalBlue # becomes <RoyalBlue>=y25 in light mode
570 # becomes <RoyalBlue>=y80 in dark mode
571  
572 This makes it easy to try different colors without worrying about
573 luminance values. The default adjustments (C<=y25> for light, C<=y80>
574 for dark) are designed to provide good contrast against typical terminal
575 backgrounds.
576  
577 B<Full color specification> - used exactly as specified:
578  
579 If you include C<E<lt>E<gt>> brackets, luminance modifiers, or use RGB
580 notation, the value is used as-is without any automatic adjustment:
581  
582 -B '<Ivory>' # original color, no adjustment
583 -B '<Ivory>=y50' # explicit luminance 50
584 -B '#780043' # burgundy in hex
585 -B '(120,0,67)' # same color in RGB decimal
586  
587 B<Customizing the default adjustment>:
588  
589 The automatic luminance adjustment values can be customized with the
590 C<--adjust> option:
591  
592 --adjust light='=y30' # use =y30 instead of =y25 for light mode
593 --adjust dark='=y70' # use =y70 instead of =y80 for dark mode
594  
595 B<Note>: Basic ANSI color codes (C<R>, C<G>, C<B>, etc.) cannot be used
596 because heading variations require luminance adjustment, which only works
597 with full color specifications (X11 names, RGB hex, or RGB decimal).
598  
599 =item B<--config>=I<KEY>=I<VALUE>
600  
601 Set config parameters from the command line. Parameters are
602 passed to the L<App::Greple::md> module via
603 L<Getopt::EX::Config>. Theme keys recognized by mdee (C<base>,
604 C<FILE>, C<FILE_FORMAT>) are consumed locally and applied to both
605 light and dark themes; all other parameters are forwarded to the
606 md module.
607  
608 Color labels (C<h1>, C<bold>, C<italic>, etc.) are accepted as
609 config parameters and override default colors. The C<${base}>
610 placeholder can be used and will be expanded at runtime.
611  
612 mdee --config h1=RD # red h1
613 mdee --config bold=GD --config italic=YI # green bold, yellow italic
614 mdee --config h1='L25D/R;E' # custom h1 with background
615 mdee --config FILE='L25D/R;E' # red file label
616 mdee --config FILE_FORMAT=%s: # simple format
617 mdee --config hashed.h3=1 # enable h3 closing hashes
618 mdee --config cjk_friendly=1 # see LIMITATIONS, Emphasis
619  
620 Theme keys consumed by mdee:
621  
622 =over 4
623  
624 =item C<base> - Base color (equivalent to C<--base-color>)
625  
626 =item C<FILE> - Color spec for file label (default: C<L25D/${base};E> for light, C<L00D/${base};E> for dark). This is passed to greple's C<FILE> label and cannot be set via C<--cm>.
627  
628 =item C<FILE_FORMAT> - Format string for file label passed to greple's C<--format FILE=> (default: C<\n %s\n\n>). Cannot be set via C<--cm>.
629  
630 =back
631  
632 All other keys are passed to the md module as config parameters.
633 See L</Highlight Options> for the list of available color labels.
634 The md module also accepts operational parameters such as
635 C<table_trim>, C<table_width>, C<table_cell>, C<rule>, C<osc8>,
636 C<tick_open>, C<tick_close>, etc.
637  
638 =back
639  
640 =head2 Highlight Options
641  
642 =over 4
643  
644 =item B<--colormap>=I<LABEL>=I<SPEC>, B<--cm> I<LABEL>=I<SPEC>
645  
646 Override the color for a specific element. I<LABEL> is one of the
647 color labels listed below. I<SPEC> follows
648 L<Term::ANSIColor::Concise> format.
649  
650 --colormap h1=RD # red bold headings
651 --colormap code_block=/L20;E # dark background for code blocks
652 --colormap bold='${base}D' # base color bold
653  
654 This option is passed to the L<App::Greple::md> module, as a module
655 option before C<--> in the B<greple> command line (see it with C<-n>).
656 It is not the C<--cm> option of B<greple>, so C<FILE> and C<FILE_FORMAT>
657 are set by C<--config> instead.
658  
659 Available labels:
660  
661 h1 - h6 Heading levels 1 through 6
662 bold Bold (**text** or __text__)
663 italic Italic (*text* or _text_)
664 strike Strikethrough (~~text~~)
665 emphasis_mark Emphasis markers (**, *, __, _, ~~)
666 bold_mark Bold markers only (overrides emphasis_mark)
667 italic_mark Italic markers only (overrides emphasis_mark)
668 strike_mark Strike markers only (overrides emphasis_mark)
669 link Inline links [text](url)
670 image Images ![alt](url)
671 image_link Image links [![alt](img)](url)
672 link_mark Link/image brackets (overrides emphasis_mark)
673 blockquote Blockquote marker (>)
674 horizontal_rule Horizontal rules (---, ***, ___)
675 comment HTML comments (<!-- ... -->)
676 code_mark Code block delimiters (``` and ~~~)
677 code_tick Inline code backtick markers
678 code_info Fenced code block info string
679 code_block Fenced code block body
680 code_inline Inline code body
681 meta_mark Front matter delimiter lines
682 meta_block Front matter body
683  
684 This option can be specified multiple times. Color labels can
685 also be set via C<--config>. When both are
686 specified, C<--cm> takes priority over C<--config>.
687  
688 =item B<--heading-markup>=I<STEPS>, B<--hm> I<STEPS>
689  
690 Control inline markup processing inside headings. By default,
691 headings are rendered with uniform heading color without processing
692 bold, italic, strikethrough, or inline code inside them. Links
693 are always processed as OSC 8 hyperlinks regardless of this option.
694  
695 Use C<all> or C<1> to enable all inline formatting within headings
696 using cumulative coloring. To select specific steps, list them
697 separated by colons.
698  
699 Available steps: C<inline_code>, C<horizontal_rules>, C<bold>,
700 C<italic>, C<strike>.
701  
702 mdee --hm all file.md # all markup
703 mdee --hm bold file.md # bold only
704 mdee --hm bold:italic file.md # bold and italic
705  
706 =item B<--show>=I<FIELD>[=I<VALUE>],...
707  
708 Control field visibility for highlighting. Empty value or C<0> disables
709 the field; any other value (including C<1>) enables it.
710  
711 --show italic # enable italic
712 --show bold=0 # disable bold
713 --show all # enable all fields
714 --show all= --show bold # disable all, then enable only bold
715  
716 Multiple fields can be specified with commas or by repeating the option.
717 The special field C<all> affects all fields and is processed first.
718  
719 See L</DESCRIPTION> for the list of available fields and
720 elements that are always active.
721 All controllable fields are enabled by default.
722  
723 =back
724  
725 =head2 Layout Options (passed to nup)
726  
727 =over 4
728  
729 =item B<-V>, B<--parallel>
730  
731 Show two or more files side by side, one pane per file, instead of
732 one after another. The screen shows as many files as fit, as many
733 as the pages of a single file, but not more than there are, and the
734 rest continue below; C<--pane> gives the number. Ignored with a
735 single file.
736  
737 With C<--lateral>, the rest go on to the right in one row instead,
738 and are scrolled sideways, a file at a time:
739  
740 mdee -LV *.md
741 mdee -LVC3 *.md
742  
743 =item B<-L>, B<--[no-]lateral>
744  
745 Put all the pages in one row, given to L<nup(1)|App::nup> as its
746 C<--lateral>. The screen shows as many pages as without it, and
747 space and C<b> of C<less> move by the screen as usual, while C<h> and
748 C<l> move by one page; see L<nup(1)|App::nup> for the keys and the
749 build of C<less> that keeps the pages at the edge of the screen. A
750 single pane goes to nup as well, so that the pages can be shifted one
751 by one. It cannot be used with C<--width>,
752 and nup refuses it with rows (C<-C2,2>, C<-R>, C<-G>) and PDF output.
753 With C<--parallel>, the files go on to the right in the same way,
754 each file a column scrolled up and down as usual; see C<--parallel>.
755 C<default[lateral]=1> in the configuration file makes it the default;
756 the default is left out where the option cannot be used, and
757 C<default[width]> is not used with it.
758  
759 =item B<-C> I<C>[,I<R>], B<--pane>=I<C>[,I<R>]
760  
761 Set the number of columns (panes). The number of rows may follow
762 after a comma: C<-C2,2> is 2 columns and 2 rows on a page, the same
763 as C<-C2 -R2>. When not specified (or 0),
764 the number of columns is calculated from the output width
765 (C<--width>, default terminal width) and C<--pane-width>. If only 1 column fits, nup formatting (borders
766 etc.) is preserved but pagination is handled by the pager instead.
767 Use C<--nup> to force nup's native pagination even in single column.
768  
769 =item B<-R> I<N>, B<--row>=I<N>
770  
771 Set the number of rows. C<-C> takes it as well, as C<-C2,2>.
772  
773 =item B<-G> I<CxR>, B<--grid>=I<CxR>
774  
775 Set grid layout. For example, C<-G2x3> creates 2 columns and 3 rows.
776 The text is folded for the number of columns of C<-C>, which this
777 option does not tell to mdee, so C<-C2,3> is better.
778  
779 =item B<-P> I<N>, B<--page>=I<N>
780  
781 Set the page height in lines.
782  
783 =item B<-S> I<N>, B<--pane-width>=I<N>
784  
785 Set the pane width in characters. Default is 85. This value is
786 used to calculate the number of columns from the output width,
787 and the default fold width. It has no effect when the number of
788 columns is given by C<--pane> or C<--parallel>.
789  
790 =item B<--bs>=I<STYLE>, B<--border-style>=I<STYLE>
791  
792 Set the border style.
793  
794 =item B<-->[B<no->]B<page-number>
795  
796 Show page number on the bottom border of each column. Enabled by
797 default. Use C<--no-page-number> to disable.
798  
799 =item B<-->[B<no->]B<filename>
800  
801 Show the file name label at the top of each file. Enabled by
802 default. Use C<--no-filename> to hide it, for example when files are
803 shown side by side with C<--parallel> and the panes should start with
804 the text. The label format and color are set by the C<FILE_FORMAT>
805 and C<FILE> theme keys (see C<--config>).
806  
807 =back
808  
809 =head2 Output Options
810  
811 =over 4
812  
813 =item B<--[no-]pager>[=I<COMMAND>]
814  
815 Set the pager command. Use C<--pager=less> to specify a pager,
816 or C<--no-pager> to disable paging.
817  
818 =item B<-T> I<DEVICE>, B<--device>=I<DEVICE>
819  
820 Set the device to show the output on, which is given to
821 L<nup(1)|App::nup>. The default is C<tty>, the terminal. Any other
822 device is a paper, and the output is printed to PDF by
823 L<ansi2pdf(1)|https://github.com/tecolicom/App-ansi2pdf>: C<a4> is A4
824 in landscape, C<a4p> is A4 in portrait and C<a3l> is A3 in landscape.
825 The device C<pdf> is the default paper, A4.
826  
827 mdee -T a4 README.md > README.pdf
828 mdee -T a4p -o README.pdf README.md
829  
830 The paper takes the place of the terminal, as described in
831 L</Printing to PDF>, and the pager is not used.
832  
833 This requires the nup style, and C<ansi2pdf>
834 0.1.3 or later for PDF (0.1.4 or later for the margin).
835  
836 =item B<-o> I<FILE>, B<--output>=I<FILE>
837  
838 Write the output to I<FILE>, which is given to L<nup(1)|App::nup>.
839 When the name ends with C<.pdf>, the output is PDF without C<-T> as
840 well. Otherwise, what is shown on the terminal is written to the
841 file as it is.
842  
843 mdee -o README.pdf README.md
844  
845 =back
846  
847 =head1 THEMES
848  
849 A theme changes how the document looks: the colors, the marks that
850 are shown or hidden, and the decoration of headings and tables.
851 Themes are chosen with C<--theme> (see L</Theme Options>), and each
852 is applied in order as a transformation of the default.
853  
854 =head2 Built-in Themes
855  
856 =over 4
857  
858 =item C<hashed> (default)
859  
860 Append closing hashes to h3-h6 headers.
861  
862 =item C<nomark> (default)
863  
864 Hide emphasis markers (C<**>, C<*>, C<__>, C<_>, C<~~>),
865 inline code backticks, and link brackets (C<[>, C<]>).
866 Content text keeps its formatting (bold, italic,
867 strikethrough, code, clickable links) but the surrounding
868 markers are not displayed. Table marks (C<markcell>,
869 C<markwrap>) are independent of this theme.
870  
871 =item C<doubleline> (default)
872  
873 Give h4 headers a double underline, which is C<ESC[4:2m>, in the
874 terminals known to take it, decided by environment variables: iTerm2,
875 Ghostty, cmux, VS Code, WezTerm, kitty, Alacritty, Konsole, Windows
876 Terminal and terminals based on VTE 0.52 or later. Elsewhere, inside
877 B<tmux> and B<screen>, and where the variables do not reach, as through
878 B<ssh>, this theme does nothing and h4 has a single underline, the same
879 as h5. Many terminals do not take the sequence: it becomes a background color in Terminal.app and
880 rxvt-unicode, and the Linux console and mosh drop the whole sequence
881 with its color.
882  
883 =item C<warm>
884  
885 Change base color to Coral.
886  
887 =item C<fatchap>
888  
889 Add decorative border lines (C<#>) above and below h1 headings,
890 using C<=+> to append a text transformation while preserving the
891 original heading color.
892  
893 With C<--refill>, the added lines are not counted, so paragraphs below
894 the h1 headings may not be folded properly by this module. The text
895 itself does not change. For this reason, this theme turns off
896 C<default[refill]> in the configuration file; C<--refill> given on the
897 command line still works.
898  
899 =item C<widen>
900  
901 Give circled digits and the wastebasket (U+1F5D1) a column of their
902 own, by adding a no-break space after them, for terminals that draw
903 them over two columns on top of the next character, as on macOS.
904 This gives the function of L<App::Greple::md::widen> to the C<--begin>
905 option of the md module.
906  
907 The characters are listed in the array C<widen_chars> of the theme, as
908 code points and ranges in hexadecimal. Add more in F<config.sh>:
909  
910 widen_chars+=(3248-324F) # circled numbers on black squares
911  
912 =item C<markcell> (default)
913  
914 In a table that has wrapped cells, mark the first line of every
915 body cell in the wrapped columns with C<‣> (U+2023), so that the
916 rows read like a bulleted list and the continuation lines stand
917 apart. The header row, columns that fit, and tables that fit are
918 not marked. Sets C<table_cell_mark>; C<nomark> does not affect it.
919 To use another character, set it in the configuration file or in a
920 theme of your own:
921  
922 md_config+=(table_cell_mark=∙) # U+2219
923  
924 =item C<markwrap>
925  
926 Mark the second and later lines of a wrapped table cell with C<›>
927 (U+203A). Sets C<table_wrap_mark>. It can be combined with
928 C<markcell>.
929  
930 =back
931  
932 =head2 Theme Files
933  
934 Theme files are searched in the following order:
935  
936 =over 4
937  
938 =item 1. User theme directory: C<${XDG_CONFIG_HOME:-~/.config}/mdee/theme/NAME.sh>
939  
940 =item 2. Share theme directory: installed with the distribution under C<auto/share/dist/App-mdee/theme/>
941  
942 =back
943  
944 Theme files are Bash scripts that can modify C<theme_light[]>,
945 C<theme_dark[]>, C<md_config[]>, and/or C<pass_md[]>:
946  
947 # theme/warm.sh — change base color
948 theme_light[base]='<Coral>=y25'
949 theme_dark[base]='<Coral>=y80'
950  
951 # theme/hashed.sh — enable closing hashes on h3-h6
952 md_config+=(hashed.h3=1 hashed.h4=1 hashed.h5=1 hashed.h6=1)
953  
954 # theme/nomark.sh — hide markers and brackets
955 pass_md+=(--cm 'emphasis_mark=sub{""}')
956 pass_md+=(--cm 'code_tick=sub{""}')
957 pass_md+=(--cm 'link_mark=sub{""}')
958  
959 =head1 CONFIGURATION
960  
961 User configuration is loaded from:
962  
963 ${XDG_CONFIG_HOME:-~/.config}/mdee/config.sh
964  
965 This is a shell script that can set defaults and override colors:
966  
967 # ~/.config/mdee/config.sh
968 default[mode]='dark' # set default mode
969 default[theme]='warm' # set default theme(s)
970 default[style]='pager' # set default style
971 default[width]=170 # set default output width
972 default[fold_width]=80 # set default fold width
973 default[refill]=1 # join paragraph lines
974 default[lateral]=1 # all pages in one row
975 default[base_color]='DarkCyan' # set default base color
976  
977 The C<default> associative array supports the following keys:
978  
979 =over 4
980  
981 =item C<default[mode]> - Corresponds to C<--mode> (e.g., C<dark>, C<light>)
982  
983 =item C<default[theme]> - Corresponds to C<--theme> (e.g., C<warm>, C<warm,hashed>)
984  
985 =item C<default[style]> - Corresponds to C<--style> (e.g., C<pager>, C<cat>)
986  
987 =item C<default[width]> - Corresponds to C<--width> (e.g., C<170>)
988  
989 =item C<default[fold_width]> - Corresponds to C<--fold-width> (e.g., C<80>)
990  
991 =item C<default[refill]> - Corresponds to C<--refill> (C<1> to enable)
992  
993 =item C<default[lateral]> - Corresponds to C<--lateral> (C<1> to enable)
994  
995 =item C<default[pane_width]> - Corresponds to C<--pane-width> (e.g., C<100>)
996  
997 =item C<default[pane]> - Corresponds to C<--pane> (e.g., C<2> or C<2,2>)
998  
999 =item C<default[base_color]> - Corresponds to C<--base-color> (e.g., C<DarkCyan>)
1000  
1001 =back
1002  
1003 B<Overriding theme colors>
1004  
1005 Config.sh can modify theme variables directly, using the same
1006 mechanism as theme files:
1007  
1008 # Change base color for both modes
1009 theme_light[base]='<DarkCyan>=y25'
1010 theme_dark[base]='<DarkCyan>=y80'
1011  
1012 # Enable md module features
1013 md_config+=(hashed.h3=1 hashed.h4=1 hashed.h5=1 hashed.h6=1)
1014  
1015 # Use another character for the table cell mark
1016 md_config+=(table_cell_mark=∙)
1017  
1018 These settings take precedence over the default themes.
1019  
1020 Changing the base color automatically affects all derived colors
1021 (h1, h2, bold, etc.) because the md module expands C<${base}>
1022 references.
1023  
1024 Use C<-d> to dump current theme values in sourceable format.
1025  
1026 B<Color specification format>
1027  
1028 Color specifications use L<Term::ANSIColor::Concise> format.
1029 The C<FG/BG> notation specifies foreground and background colors
1030 (e.g., C<L25D/${base};E> means gray foreground on base-colored background).
1031 The C<${base}> string is expanded to the base color value after loading.
1032  
1033 To change the text before it is formatted, give a function to the
1034 C<--begin> option of the md module:
1035  
1036 pass_md+=(--begin 'sub{ s/\(C\)/\x{A9}/g }')
1037  
1038 =head1 EXAMPLES
1039  
1040 mdee README.md # view markdown file
1041 mdee -C2 document.md # 2-column view
1042 mdee -C2,2 manual.md # 2x2 grid (4-up)
1043 mdee -w170 file.md # two 85-column panes on a wide terminal
1044 mdee -V -w170 a.md b.md # two files in 85 columns each
1045 mdee --fold-width=60 a.md # narrower text within the pane
1046 mdee --no-pager file.md # without pager
1047 mdee --no-nup file.md # output to stdout without nup
1048 mdee --no-fold file.md # disable line folding
1049 mdee --no-table file.md # disable table formatting
1050 mdee -r file.md # join paragraph lines
1051  
1052 # PDF
1053 mdee -o file.pdf file.md # A4 in landscape
1054 mdee -T a4p -o file.pdf file.md # A4 in portrait
1055 mdee -T a4p -C1,2 -o file.pdf file.md # two pages on a sheet
1056  
1057 # Output styles
1058 mdee -s pager file.md # fold + table, output to pager
1059 mdee -s cat file.md # fold + table, output to stdout
1060 mdee -s filter file.md # table only, no fold/nup
1061 mdee -s raw file.md # highlight only
1062  
1063 # Style shortcuts
1064 mdee -p file.md # same as --style=pager
1065 cat file.md | mdee -f # highlight stdin (filter mode)
1066 mdee -f file.md # highlighted output to stdout
1067  
1068 # Override individual settings
1069 mdee -f --fold file.md # filter + fold
1070 mdee -p --no-fold file.md # pager without fold
1071  
1072 # Theme examples
1073 mdee --mode=dark file.md # use dark mode
1074 mdee --mode=light file.md # use light mode
1075 mdee -B Ivory file.md # override base color
1076 mdee --mode=dark -B '#780043' file.md # dark mode with burgundy
1077 mdee --theme=warm file.md # warm (Coral) base color
1078 mdee --no-theme file.md # show all markup characters
1079  
1080 =head1 DEPENDENCIES
1081  
1082 This command requires the following:
1083  
1084 =over 4
1085  
1086 =item * L<App::Greple> - pattern matching and highlighting
1087  
1088 =item * L<App::Greple::tee> - filter integration
1089  
1090 =item * L<App::ansifold> - ANSI-aware text folding
1091  
1092 =item * L<App::ansicolumn> - ANSI-aware column formatting
1093  
1094 =item * L<App::nup> - N-up multi-column paged output
1095  
1096 =item * L<App::ansiecho> - ANSI color output
1097  
1098 =item * L<Getopt::Long::Bash> - bash option parsing
1099  
1100 =item * L<Getopt::EX::termcolor> - terminal background detection
1101  
1102 =back
1103  
1104 C<--refill> finds the paragraphs with L<Markdown::Perl> (pure Perl,
1105 installed with this distribution). The L<CommonMark> module, which
1106 needs the libcmark C library (C<brew install cmark>, C<apt-get install
1107 libcmark-dev>) and is only recommended, is used when it is there
1108 because it is faster; L<pandoc|https://pandoc.org> 2.11.3 or later is
1109 a third choice.
1110  
1111 =head1 LIMITATIONS
1112  
1113 =head2 HTML Comments
1114  
1115 Only HTML comments starting at the beginning of a line are highlighted.
1116 Inline comments are not matched to avoid conflicts with inline code
1117 containing comment-like text (e.g., C<< `<!-->` >>).
1118  
1119 =head2 Emphasis
1120  
1121 Emphasis patterns (bold and italic) do not span multiple lines.
1122 Multi-line emphasis text is not supported.
1123  
1124 C<***bold italic***> and C<___bold italic___> are supported.
1125 Other nested forms (e.g., C<< **bold _italic_** >>) are not.
1126  
1127 C<*> and C<**> start and end emphasis as in CommonMark: a delimiter
1128 with a letter on one side and punctuation on the other does not
1129 count, so C<L*=50, a*=68> is not italic. CommonMark counts Unicode
1130 punctuation, and this rejects some emphasis in Japanese text,
1131 such as C<日本語の*「強調」*です> and C<日本語の**強調。**です>. mdee
1132 shows them as the commonmark and gfm readers of pandoc and zenn.dev
1133 do, with the markers and without emphasis, so that such text can be
1134 found before it is published.
1135  
1136 With C<cjk_friendly=1> (C<--config cjk_friendly=1>, or
1137 C<md_config+=(cjk_friendly=1)> in F<config.sh>), the rules of
1138 L<markdown-cjk-friendly|https://github.com/tats-u/markdown-cjk-friendly>
1139 are used instead: CJK punctuation does not count, and a CJK character
1140 on the other side is as good as a space, so these are emphasis. This
1141 is a proposal, not part of CommonMark; use it for text that is
1142 processed by an implementation of it.
1143  
1144 =head2 Block Quotes
1145  
1146 A block quote is recognized by its C<E<gt>> markers at the start of a
1147 line, after up to three spaces. Only the markers are colored, not the
1148 quoted text. Headings, lists and code blocks inside a quote are not
1149 recognized, so they get no color of their own, and a code block in a
1150 quote does not protect its contents from inline highlighting.
1151  
1152 A line without a marker that continues a quoted paragraph (a lazy
1153 continuation in CommonMark) is shown as an ordinary line, unless
1154 C<--refill> joins it to the quote.
1155  
1156 =head2 Links
1157  
1158 Link patterns do not span multiple lines. The link text and URL must
1159 be on the same line.
1160  
1161 Reference-style links (C<[text][ref]> with C<[ref]: url> elsewhere)
1162 are not supported.
1163  
1164 =head2 Paragraph Refill
1165  
1166 C<--refill> joins lines by the rules of Markdown, as the parser
1167 reads them. Lines of verse, addresses or lyrics that rely on the line
1168 breaks without a hard line break (two spaces or a backslash at the
1169 end of the line) are joined as well, and so are the lines of a
1170 display math block between C<$$> lines. Do not use C<--refill>
1171 for such documents.
1172  
1173 =head2 Table Alignment
1174  
1175 Column alignment assumes that cell content in the source is not
1176 pre-padded. If the source table is already formatted with aligned
1177 spacing (e.g., C<| c |>), the embedded spaces become part of
1178 the cell content and alignment directives in the separator line
1179 will not produce the expected result. This is by design: pre-formatted
1180 tables are assumed to be correctly aligned as-is.
1181  
1182 =head2 OSC 8 Hyperlinks
1183  
1184 Links are converted to OSC 8 terminal hyperlinks for clickable URLs:
1185  
1186 =over 4
1187  
1188 =item C<[text](url)> - C<[text]> links to url
1189  
1190 =item C<![alt](url)> - C<![alt]> links to url (image)
1191  
1192 =item C<[![alt](img)](url)> - C<!> links to img, C<[alt]> links to url
1193  
1194 =back
1195  
1196 This requires terminal support. Compatible terminals include iTerm2,
1197 Kitty, WezTerm, Ghostty, and recent versions of GNOME Terminal.
1198 Apple's default Terminal.app does not support OSC 8.
1199  
1200 When using C<less> as pager, version 566 or later is required with
1201 C<-R> option.
1202  
1203 For OSC 8 specification, see:
1204 L<https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>
1205  
1206 =head2 Terminal Luminance
1207  
1208 Without C<--mode> or C<default[mode]>, B<mdee> asks the terminal for
1209 its background color (OSC 11) through L<Getopt::EX::termcolor> to
1210 choose between light and dark mode. Set C<TERM_LUMINANCE> to a value
1211 from 0 to 100 to give the answer yourself and skip the query, for
1212 example in scripts or tests, where a reply that arrives late would
1213 show up as terminal input.
1214  
1215 =head2 Less Environment Variables
1216  
1217 When C<less> is used as pager (either directly via C<--style=pager> or
1218 through C<nup>), the following environment variables affect behavior.
1219 B<mdee> sets defaults for these when they are not already defined:
1220  
1221 =over 4
1222  
1223 =item C<LESS>
1224  
1225 Default: C<-R>. The C<-R> option is required for ANSI color
1226 sequences to be displayed correctly.
1227  
1228 =item C<LESSANSIENDCHARS>
1229  
1230 Default: C<mK>. This tells C<less> to recognize ANSI sequences
1231 ending with C<m> (SGR color) and C<K> (erase line). The erase line
1232 sequence is used for background color rendering.
1233  
1234 =back
1235  
1236 If you already have these variables set in your environment, B<mdee>
1237 does not override them.
1238  
1239 =head1 SEE ALSO
1240  
1241 =over 4
1242  
1243 =item L<Implementation of em·dee|https://github.com/tecolicom/App-mdee/blob/main/IMPLEMENTATION.md>
1244  
1245 How the pipeline, the themes and the colors work inside.
1246  
1247 =item L<App::Greple::md>
1248  
1249 Greple module for Markdown syntax highlighting, table formatting,
1250 and text folding. Bundled with this distribution.
1251  
1252 =item L<greple>
1253  
1254 General-purpose extensible grep tool used for pattern matching.
1255  
1256 =item L<nup>
1257  
1258 Multi-column paged output formatter.
1259  
1260 =item L<ansi2pdf|https://github.com/tecolicom/App-ansi2pdf>
1261  
1262 Renders the output to PDF.
1263  
1264 =item L<ansifold|https://metacpan.org/dist/App-ansifold/view/script/ansifold>
1265  
1266 ANSI-aware text folding for line wrapping.
1267  
1268 =item L<ansicolumn>
1269  
1270 ANSI-aware column formatting for table alignment.
1271  
1272 =item L<CommonMark>, L<Markdown::Perl>, L<pandoc|https://pandoc.org>
1273  
1274 One of them finds the paragraphs for C<--refill>.
1275  
1276 =item L<CommonMark Spec 0.31.2, Emphasis and strong emphasis|https://spec.commonmark.org/0.31.2/#emphasis-and-strong-emphasis>
1277  
1278 The rules that C<*> and C<**> follow by default (see L</Emphasis>).
1279  
1280 =item L<CommonMark CJK-friendly Amendments|https://github.com/tats-u/markdown-cjk-friendly/blob/main/specification.md>
1281  
1282 The rules that C<cjk_friendly=1> follows. The proposal comes from
1283 L<commonmark-spec issue #650, Emphasis with CJK punctuation|https://github.com/commonmark/commonmark-spec/issues/650>,
1284 open since 2020.
1285  
1286 =item L<https://github.com/tecolicom/App-mdee>
1287  
1288 Repository and bug tracker.
1289  
1290 =back
1291  
1292 =head1 AUTHOR
1293  
1294 Kazumasa Utashiro
1295  
1296 =head1 LICENSE
1297  
1298 Copyright 2026 Kazumasa Utashiro.
1299  
1300 This software is released under the MIT License.
1301 L<https://opensource.org/licenses/MIT>
1302  
1303 =cut
« blib/lib/App/Greple/md/widen.pm ↑ Summary