| LOWDOWN(1) | General Commands Manual | LOWDOWN(1) |
lowdown — simple
markdown translator
lowdown |
[input_options] [output_options] [-Ls]
[-M metadata]
[-m metadata]
[-o file]
[-t mode]
[-X keyword]
[file] |
Translate from lowdown(5) into diverse output formats. Results are written to standard output.
The arguments are as follows:
-L-t mode
is ignored. Metadata is automatically enabled. Unsets
-X.-s-tgemini,
-thtml,
-tlatex,
-tms,
-tman, and
-tfodt.-M
metadata-m and what's parsed from the document.-m
metadata-M, but is overridden by what's parsed the
document, then -M.-o
file-t
mode, -T
mode-ms package and
needing table support, term for ANSI-compatible
UTF-8 terminal output, man for roff output using the
classic -man package, tree,
to show the parse tree of the input document, and
null to parse the document but do no rendering. See
Output modes. The
-T mode form is retained for
backward compatibility.-X
keyword-t mode is ignored.
Metadata is automatically enabled. Unsets -L.The following are options for input parsing. These affect the parse tree passed to all outputs.
--parse-hilite--parse-math--parse-maxdepth=depth--parse-no-autolinkhttp, https,
ftp, mailto, and relative
links or link fragments.--parse-no-cmark--parse-no-codeindent--parse-no-callouts--parse-no-deflists--parse-no-ext-attrs--parse-no-fenced--parse-no-footnotes--parse-no-img-ext--parse-no-ext-attrs.--parse-no-intraemph--parse-no-mantitle--parse-no-metadata-m or -M.--parse-no-strike--parse-no-super--parse-no-tables--parse-no-tasklists--parse-super-shortThere are many output options. The following are shared by all output modes:
--out-standalone-s.--out-no-smartyWhat follows are per-output options. For HTML with
-thtml, these are as
follows:
--html-callout-mdn,
--html-callout-gfm--html-hardwrap--html-no-escapehtml--html-no-skiphtml has been specified, this
causes embedded HTML not to be escaped, and is instead output verbatim.
This has no effect if --html-no-skiphtml has not
been specified.--html-no-head-idsid attributes for headers.--html-no-num-ent--html-no-owasp--html-no-skiphtml--html-no-escapehtml.For both -tman and
-tms, the following apply:
--nroff-code-font=fontsB,B,BI,BI uses bold ("B") instead of a
constant-width. Not specifying a font will use the default, as will
specifying a zero-length font name. Aliases none,
bold, and code set no
special fonts, bold, and the default constant-width.--nroff-no-groff-tms mode and
-mspdf passed to
groff(1)), or Unicode sequence syntax. The output is
compatible with traditional troff(1).--nroff-no-numbered-tms.--nroff-no-skiphtml--nroff-nolinks--nroff-shortlinks for images and links. Applies
to -tman or when
-nroff-no-groff is specified.--nroff-shortlinks-tman
or when -nroff-no-groff is specified.The -tterm output
has the following:
--term-all-metadata-s is specified, output all metadata instead of
just the title, author, and date.--term-columns=columns--term-hmargin=margin--term-no-ansi--term-no-colour.--term-no-colour--term-nolinks--term-shortlinks for images and links.--term-shortlinks--term-vmargin=margin--term-width=widthThe -tgemini output
has several flags that control the placement of links. By default, links
(images, autolinks, and links) are queued when specified in-line then
emitted in a block sequence after the nearest block element.
--gemini-link-end--gemini-link-inline--gemini-link-noref--gemini-link-roman.--gemini-link-roman--gemini-metadataThe -tlatex output
has the following options:
--latex-no-numbered--latex-no-skiphtmlThe -tfodt output
has the following options:
--odt-no-skiphtml--odt-style=file<office:font-face-decls>,
<office:scripts>, and
<office:styles> XML elements in the root of
the document. This is not syntax-checked in any way.The output media is specified by -t, which
defaults to -thtml.
-tfodt-tgemini-thtml-tlatexamsmath and amssymb for
maths, graphicx for images,
inputenc (utf8) for UTF-8 input,
fontend (T1) and textcomp
for output glyphs, lmodern for Latin modern font,
xcolor for the difference engine output, and
hyperref for links.-tman-tms-tterm-ttreeWhen -s is specified, additional content
may be added to output:
-tfodt<office:document> and prologue
<office:automatic-styles>,
<office:master-styles>, and
<office:body>.-thtml<html> and prologue
<head>.-tlatexdocumentclass and
usepackage statements, and surrounding
begin{document} statements.-tman,
-tms-ttermIf parsed from the document or as given by
-m or -M, the following
metadata keys are used by additional content. The metadata keys are
canonicalised in lowercase and without spaces.
Metadata values should not be encoded in their output format, e.g., “css: foo&bar”. The renderer will perform any necessary output encoding.
affiliation-thtml,
-tlatex, and
-tms.rcsauthor.
Used in -tfodt,
-thtml,
-tlatex,
-tms, and
-tterm.baseheaderlevelshiftheadinglevelby.copyright-tms and
-thtml.css-thtml.datercsdate. Used in
-tfodt,
-thtml,
-tlatex,
-tman,
-tms, and
-tterm.javascript-thtml.lang-thtml.author, but in RCS author format. Overrides
author.rcsdatedate, but in RCS date format. Overrides
date.section-tman.shiftheadinglevelbybaseheaderlevel. If unset or not a valid number,
defaults to zero. Used in
-tfodt,
-thtml,
-tlatex,
-tman, and
-tms.source-tman.volume-tman.title-tfodt,
-thtml,
-tlatex,
-tman,
-tms, and
-tterm.Metadata values are parsed and may be used as variables in
markdown documents regardless of whether -s is
specified or not.
Default values, such “7” for the
section, are not set as metadata values, and will
not appear if the metadata key is used as a variable.
NO_COLOR-tterm mode. Synonym for
NO_COLOUR. Same as
--term-nocolour.-tfodt documents. Template
for --odt-style styles.The lowdown utility exits 0 on
success, and >0 if an error occurs.
If the -X flag is used,
lowdown exits with an error if the given keyword is
not found.
To view a Markdown file on an ANSI-compatible, UTF-8 terminal:
lowdown -tterm foo.md | less
-RThe terminal may also be used with groff(1) or mandoc(1) rendering:
lowdown -stms foo.md | groff -itk -mspdf -Tutf8 | less -R lowdown -stman foo.md | groff -itk -man -Tutf8 | less -R lowdown -stman foo.md | mandoc | less
To emit a standalone HTML5 document:
lowdown -s foo.md >
foo.htmlTo use groff(1) or mandoc(1) to format as a PS file:
lowdown -stms foo.md | groff -itk -mspdf > foo.ps lowdown -stman foo.md | mandoc -Tps > foo.ps
Or with LaTeX:
lowdown -stlatex foo.md > foo.latex pslatex foo.latex
PDF generation follows similar logic:
lowdown -stms foo.md | pdfroff -itk -mspdf > foo.pdf lowdown -stman foo.md | mandoc -Tpdf > foo.pdf lowdown -stlatex foo.md > foo.latex pdflatex foo.latex
UTF-8 support for groff(1) PDF or PS output requires appropriate fonts, such as the Unicode Times font. This and other Unicode fonts are not always installed by default. They may be found, for PDF output, in the devpdf set of the groff(1) font directory and are prefixed with ‘U’.
lowdown -stms foo.md | pdfroff -itk -mspdf -FU-T > foo.pdf
To list all metadata keys, then to extract the "title" metadata value from foo.md:
lowdown -L foo.mdlowdown -X title foo.mdlowdown was forked from
hoedown by
Kristaps Dzonsons,
kristaps@bsd.lv. It has been
considerably modified since.
| January 31, 2025 | Debian |