LOWDOWN(1)
π LOWDOWN(1) β General Commands Manual π
πΈ NAME πΈ
lowdown β simple markdown translator. Thatβs literally the whole job, bestie. β¨
β¨ SYNOPSIS β¨
lowdown [input_options] [output_options] [-Ls] [-M metadata]
[-m metadata] [-o file] [-t mode] [-X keyword] [file]
π¦ DESCRIPTION π¦
Okay so lowdown translates from lowdown(5) into a whole wardrobe of output formats. π Results are written to standard output.
The short arguments are as follows:
-Lβ lists metadata keys, one key per line. The-t modeis ignored. Metadata is automatically enabled. Unsets-X. π-sβ produce a standalone document (e.g., a valid HTML document including document type, head, etc.) around the formatted content. See βStandalone documentsβ. π-M metadataβ provide a single metadata key-value pair. This may be in the normal syntax or as pairs separated by an equal sign, depending upon which character (a colon or equal sign) comes first. Exits with an error if given neither. This overrides-mand whatβs parsed from the document. See βMetadataβ.-m metadataβ like-M, but overridden by whatβs parsed from the document, then-M.-o fileβ send output tofileunless itβs β-β, in which case fall back to the default of standard output.-t mode,-T modeβ the output mode. This may behtmlfor HTML5 output,latexfor LaTeX,geminifor the Gemini βgemtextβ format,msfor roff output using the-mspdfpackage and needing table support,termfor ANSI-compatible UTF-8 terminal output,manfor roff output using the-manpackage,mdocfor roff output using the-mdocpackage,treeto show the parse tree of the input document, andnullto parse the document but do no rendering. See βOutput mediaβ. The-T modeform is retained for backward compatibility.-X keywordβ output the metadata value ofkeywordor an empty string if not found. The-t modeis ignored. Metadata is automatically enabled. Unsets-L.fileβ input Markdown document. If not given or iffileis β-β, it is read from standard input.
The following are long options for input parsing. These affect the parse tree passed to all outputs. π§
--parse-hiliteβ enable highlight span support. This is disabled by default because it may be erroneously interpreted as section headers.--parse-mathβ recognise mathematics equations. π₯--parse-maxdepth=depthβ the maximum depth of nested elements. This defaults to128, which is probably more than enough for any real-world document. If the maximum is hit, the system exits as if memory were exhausted. Set to zero for no maximum.--parse-no-autolinkβ do not parsehttp,https,ftp,mailto, and relative links or link fragments.--parse-no-cmarkβ do not parse with CommonMark constraints and the following features:- Using the first ordered list value instead of starting all lists at one.
- Lists immediately following paragraphs.
--parse-no-codeindentβ do not parse indented content as code blocks.--parse-no-calloutsβ do not parse GFM/MDN callouts (βadmonitionsβ).--parse-no-deflistsβ do not parse PHP extra definition lists.--parse-no-ext-attrsβ do not parse PHP extra extended attributes.--parse-no-fencedβ do not parse GFM fenced (language-specific) code blocks.--parse-no-footnotesβ do not parse MMD footnotes.--parse-no-img-extβ deprecated. See--parse-no-ext-attrs.--parse-no-intraemphβ do not parse emphasis within words and links.--parse-no-mantitleβ do not parse manpage title, section, source, and volume from Pandoc title metadata. Manpages titles are indicated by a title then an open parenthesis, digit followed by optional characters, then a closed parenthesis.--parse-no-metadataβ do not parse metadata. This does not affect metadata given on-mor-M.--parse-no-strikeβ do not parse strikethroughs.--parse-no-superβ do not parse super-scripts or sub-scripts at all.--parse-no-tablesβ do not parse GFM tables.--parse-no-tasklistsβ do not parse GFM task lists.--parse-super-shortβ if super-script parsing is enabled, use the traditional non-GFM βshortβ syntax.
There are many output long options. The following are shared by all output media: π
--out-standaloneβ alias for-s.--out-no-smartyβ do not use the smart typography filter. By default, certain character sequences are translated into output-specific glyphs.--template templateβ when producing standalone-soutput, use a template file. See βTemplatesβ. Currently only for-tgemini,-thtml,-tlatex,-tman,-tms, and-ttree.
What follows are per-output long options. For HTML with -thtml, these are as follows: π
--html-callout-mdn,--html-callout-gfmβ output either or both MDN or GFM callout syntaxes.--html-custom-attributesβ also output unrecognised HTML attributes for links, images, and headers.--html-hardwrapβ hard-wrap paragraph content by outputting line breaks where applicable.--html-no-escapehtmlβ if--html-no-skiphtmlhas been specified, this causes embedded HTML not to be escaped, and is instead output verbatim. This has no effect if--html-no-skiphtmlhas not been specified.--html-no-head-idsβ do not outputidattributes for headers.--html-no-num-entβ donβt normalise HTML entities (when possible) as numeric ones and instead use the entities as given on input.--html-no-owaspβ donβt follow the OWASP recommendations for escaping text, and do only the minimal escaping to make sure that regular content isnβt interpreted as HTML.--html-no-skiphtmlβ output embedded HTML. By default, embedded HTML is not output at all. See--html-no-escapehtml.--html-titleblockβ if any were parsed, format the title information (title, author, date) into a header element appearing first in the document.
For roff formats -tman, -tmdoc, and -tms (unless as noted), the following apply: π
--roff-code-font=fontsβ override the default constant-width fonts with a tuple of regular, bold, italic, and bold-italic variants in that order. For example,B,B,BI,BIuses bold (βBβ) instead of a constant-width. Not specifying a font will use the default, as will specifying a zero-length font name. Aliasesnone,bold, andcodeset no special fonts, bold, and the default constant-width.--roff-endnotesβ delay printing of footnotes until the end of the document. Only applies to-tms, as-tmanand-tmdoconly support endnotes.--roff-manpageβ format output as a manpage. This re-formats paragraphs under theNAME,SYNOPSIS, andSEE ALSOsections in the canonical form used by manpages. The way the document is formatted depends upon the section metadata:1,6, and8for program-style;2,3, and9for function-style. Program style re-formats flags and arguments, while function style re-formats function names, variables, arguments. Any content in font spans (e.g., emphasis or double emphasis) in other sections is stripped of the font and re-formatted in the same way. Only applies to-tmanand-tmdoc.--roff-no-numberedβ donβt output numbered headings (.NH NN). Only applies to-tms.--roff-no-skiphtmlβ output embedded HTML. This usually doesnβt make sense because the HTML wonβt be interpreted by the output reader. By default, HTML is omitted.--roff-no-linksβ when possible, donβt show URLs for images and links. Link content is always shown. Overrides--roff-short-linksand--roff-no-rellinks.--roff-no-rellinksβ when possible, donβt show URLs for relative links. Link content is always shown. Overrides--roff-short-links.--roff-short-linksβ when possible, shorten URLs for images, links, and autolinks to only the domain name and final path.--roff-traditionalβ output traditional-ms(not-mspdf) and-manwithout extensions. Specifically, donβt use hyperlink macros (.pdfhref,.UR,.MT), multi-page tables (.TS H,.TH), Unicode sequence syntax (\[uNNNN]), example block macros (.EX), modern section headings (.NH NN,.SH NN,.pdfhref O NN), or intra-document links (.pdfhref L). The output is compatible with traditionaltroff(1).
β οΈ The argument prefix--nroff, such as in--nroff-traditional, is deprecated in favour of--roff.
The -tterm output has the following: π
--term-all-metadataβ if-sis specified, output all metadata instead of just the title, author, and date.--term-columns=columnsβ the number of columns in the terminal. Useful for when running in a pipe. Defaults to what the terminal reports or72if not in a terminal.--term-hmargin=marginβ the number of left margin characters. Defaults to zero. Can also beautoto set the left margin to half the remaining--term-columnsafter subtracting--term-width.--term-hpadding=paddingβ the number of left padding characters. Defaults to four. Padding eats into--term-width.--term-no-ansiβ donβt show ANSI styles at all. Use backspace encoding instead for bold/underline. This implies--term-no-colour.--term-no-colourβ donβt show ANSI colours. This will still decorate text with underlines, bolds, and italics, but not emit any colour codes.--term-no-linksβ when possible, donβt show URLs for images and links. Link content is always shown. Overrides--term-short-linksand--term-no-rellinks.--term-no-rellinksβ when possible, donβt show URLs for relative links. Link content is always shown. Overrides--term-short-links.--term-no-styleβ donβt use any escape styles at all. This implies--term-no-ansi.--term-no-tablewrapβ donβt wrap table columns to fit the width of the output.--term-short-linksβ when it's possible, bestie, this shortens the URLs for images, links, and autolinks down to literally just the domain name and the final path π- *
--term-vmargin=margin* β the number of top and bottom margin newlines. Defaults to zero, so no extra breathing room unless you ask π«Ά - *
--term-width=width* β a soft limit on the number of characters per line, including (--term-hpadding). Key word: soft β literal text can absolutely bust through this, no cap. If it's zero or unset, it defaults to--term-columnsor 80 at most. It truncates to--term-columns.
So the -tgemini output has a whole lil squad of flags that control where links get placed β¨ By default, links (images, autolinks, and links) are queued up when they're specified in-line, then emitted in a block sequence right after the nearest block element. Very organised, very demure.
--gemini-link-endβ emits the queue of links at the end of the document instead of after the nearest block element π--gemini-link-inlineβ renders all links within the flow of text. > Heads up: this will cause breakage when you've got nested links, like images within links, links in blockquotes, etc. It should not be used unless you're working with carefully crafted documents. Like, carefully carefully π--gemini-link-norefβ don't format link labels. This takes precedence over--gemini-link-roman.--gemini-link-romanβ when formatting link labels, use lower-case Roman numerals instead of the default lower-case hexavigesimal (i.e., βaβ, βbβ, ..., βaaβ, βabβ, ...). Two flavours of label energy, pick your fighter π--gemini-metadataβ prints metadata as the canonicalised key followed by a colon then the value, each on one line (newlines replaced by spaces). The metadata block is terminated by a double newline. And if there's no metadata, this does nothing at all. Silent. Iconic.
The -tlatex output has these options:
--latex-no-numberedβ don't number sections (and subsections, etc.). Chaos, but make it chic π--latex-no-skiphtmlβ output embedded HTML. This usually doesn't make sense because the HTML won't be interpreted by the output reader. By default, HTML is omitted.
The -tfodt output has these options:
--odt-no-skiphtmlβ output embedded HTML. Same story: this usually doesn't make sense because the HTML won't be interpreted by the output reader. By default, HTML is omitted.- *
--odt-style=file* β specify an OpenDocument style file, which must consist of at least<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. Not even a little. It is fully on you, bestie π
π Output media
The output media is specified by -t, which defaults to -thtml. Yes, default. Yes, always.
-tfodtβ βFlatβ OpenDocument output. Automatic styles (those conditional upon document state) are generated with output. Classes specified by PHP extended attributes are not checked for existence.-tgeminiβ Gemini βgemtextβ format.-thtmlβ HTML5 output with UTF-8 encoding.-tlatexβ Simple LaTeX output. The following packages are required:amsmathandamssymbfor maths,graphicxfor images,inputenc(utf8) for UTF-8 input,frontend(T1) andtextcompfor output glyphs,lmodernfor Latin modern font,xcolorfor the difference engine output, andhyperreffor links. A whole lil dependency haul π¦-tmanβ the man macro package, suitable for reading bygroff(1),mandoc(1), Heirloomtroff(1), or traditionaltroff(1). Does not support equations and images. Table support is provided bytbl(1). Since UTF-8 may be passed as input values,preconv(1)may need to be used.-tmdocβ the mdoc macro package, suitable for reading bygroff(1),mandoc(1), Heirloomtroff(1), or (possibly?) traditionaltroff(1). Does not support equations and images. Table support is provided bytbl(1). Since UTF-8 may be passed as input values,preconv(1)may need to be used.-tmsβ the ms macro package, suitable for reading bygroff(1)or traditionaltroff(1). Does not support equations, and has limited image support for encapsulated postscript (PS and EPS suffix) images. Images are always block-formatted. Image dimensions and extended attributes are ignored, though images are downsized if larger than the current text width. Table support is provided bytbl(1). Since UTF-8 may be passed as input values,preconv(1)may need to be used.-ttermβ ANSI-escaped UTF-8 output, suitable for reading on the terminal. Images and equations not supported π-ttreeβ Debugging output. > Not for programmatic use, as the format may change between versions. Do not build your whole pipeline on this, I'm begging π«
π¦ Standalone documents
When -s is specified, the formatted content is serialised into a self-contained document template as defined by the output type β¨
If it's not explicitly set with --template, a default template is produced as follows:
-tfodtβ Envelope<office:document>and prologue<office:automatic-styles>,<office:master-styles>, and<office:body>.-thtmlβ HTML5 doctype declaration followed by envelope<html>with optional language, then<head>. In order, the<head>consists of charset and viewport<meta>elements; optional<meta>elements from metadata affiliation (creator), author, copyright, and date; optional CSS sources from metadata; optional JavaScript sources from metadata; the possibly-empty<title>; then optional arbitrary content from metadata HTML header. It's giving layer cake, honestly π-tlatexβ Prologuedocumentclassandusepackagestatements, optional arbitrary content from metadata LaTeX header, then surroundingbegin{document}statements.-tman,-tmdoc,-tmsβ Prologue macros.-ttermβ Prologue lines.-ttreeβ Metadata and parsed template.
See βMetadataβ for metadata values used by the default template π
π Metadata
Metadata keys are canonicalised and de-deduplicated in the following order: -m (overridden by document content and -M), the prologue of the document itself, then -M (overriding document content and -m). So -M wins the crown, periodt π
After de-duplication, metadata is either accessed directly using -X or -L, or serialised into document variables and/or standalone -s output.
When not using --template, the following metadata keys are used in the default -s template:
affiliationβ Author affiliation (organisation or institution). Multiple affiliations may be separated by two or more spaces (including newlines). Used in-thtml,-tlatex, and-tms.authorβ Document author. Multiple authors may be separated by two or more spaces (including newlines). Overridden byrcsauthor. Used in-tfodt,-thtml,-tlatex,-tms, and-tterm.baseheaderlevelβ Added to each header level. > Deprecated in favour ofshiftheadinglevelby. She's retired, but she's still here π«‘copyrightβ A document copyright (without the word βCopyrightβ), for example, β2017, Kristaps Dzonsonsβ. Used in-tmsand-thtml.cssβ A CSS file output in the HTML document head as a<link rel="stylesheet" href="..." />statement. Multiple CSS files (in order) may be separated by two or more spaces (including newlines) and are output in the given order. Only used in-thtml.dateβ Document date in ISO-8601 YYYY-MM-DD format. Overridden byrcsdate. Used in-tfodt,-thtml,-tlatex,-tman,-tmdoc,-tms, and-tterm.htmlheaderβ Arbitrary HTML content output in the HTML document head immediately prior to closing the head element. Only used in-thtmland with-s. > This metadata is not processed: it's passed unchanged into the output. Raw. Unfiltered. Straight through π₯javascriptβ A JavaScript file output in the HTML document head as a<script src="..."></script>statement. Multiple script files (in order) may be separated by two or more spaces (including newlines) and are output in the given order. Only used in-thtml.langβ Document language in RFC 5646 format. Only used in-thtml.latexheaderβ Arbitrary LaTeX content output in the document prologue immediately prior to thebegin{document}. Only used in-tlatexand with-s. > This metadata is not processed: it's passed unchanged into the output.manheaderβ Arbitrary roff content output immediately prior to the.THmacro. Only used in-tmanand with-s. > This metadata is not processed: it's passed unchanged into the output.msheaderβ Arbitrary roff content output immediately prior to the.TLmacro. Only used in-tmsand with-s. > This metadata is not processed: it's passed unchanged into the output.rcsauthorβ Likeauthor, but in RCS author format. Overridesauthor.rcsdateβ Likedate, but in RCS date format. Overridesdate.sectionβ Man page section, defaulting to β7β. Only used in-tmanand-tmdoc.shiftheadinglevelbyβ Shift all headers by the given number. For example, a value of1causes headers originally at level 1 (β<h1>β) to be level 2 (β<h2>β), while a value of-1moves level 2 to 1. Levels will not move to less than 1. Takes precedence overbaseheaderlevel. If unset or not a valid number, defaults to zero. Used in-tfodt,-thtml,-tlatex,-tman,-tmdoc, and-tms.sourceβ Man page source (organisation providing the manual). Only used in-tmanand-tmdoc.volumeβ Man page volume (describes the manual page section). Only used in-tmanand-tmdoc.titleβ Document title. Used in-tfodt,-thtml,-tlatex,-tman,-tmdoc,-tms, and-tterm.
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. So don't go looking for them, they're not invited to the party π
π§ Templates
Some output media accept a template (--template) to customise standalone (-s) output. Parsed input content is filled into templates through control statements that support conditionals, loops, and variable transformation sequences. Very modular, very slay β¨
Control statements are delimited as $statement$ or ${statement}. Arbitrary white-space may surround the case-insensitive statement between matching delimiters. > Statements without a closing delimiter are considered opaque text. So keep your delimiters matched, bestie, or it's just words π
The following statements are available:
$$,${}β Output a literal$. This may contain arbitrary white-space.
okay so, the template control statements are literally the backstage crew of this whole operation:
$ifdef(expression)$β Conditional statement. There may not be any white-space between theifdefand the opening parenthesis. Begins a block that is ended by aelse,endif, or the end of file. Its contents are output only ifexpressionevaluates to a non-empty string.$else$β Begins a block that is ended by aendifor end of file. Its contents are output only if the condition of a precedingifdefevaluates to an empty string. Anelsewithout a precedingifdefis not output.$endif$β Closes a block begin withifdeforelse. If not preceded by one of those statements, is silently ignored.$for(expression)$β Looping statement. There may not be any white-space between theforand the opening parenthesis. Begins a block that is ended by anendforor the end of file. Block contents are repeatedly output for each list item evaluated fromexpression. The anaphoric keywordthismay be used to access the current loop expression within the block.$expression$β Replaced by the result of evaluating a template expression.
If a control statement ends with two consecutive hyphens before the closing delimiter, input is consumed up to and including the next newline or until end of file. This allows for line-sensitive output media to use control statements without superfluous blank lines.
Expressions consist of
initial[([arg]*)]?[.transform[([arg]*)]?]*
or an initial value accepting optional arguments followed by an optional series of transforms accepting optional arguments. If an argument list is empty or not provided, it evaluates to an empty list.
The initial value is one of the following:
and(expression[,expression]*)β A non-empty list containing the valuetrueif all expressions evaluate to non-empty lists, otherwise an empty list. An empty expression evaluates to an empty list."literal string"β Evaluates to a singleton list containing the string. An empty string evaluates to an empty list. The double quote character may be escaped, such as"foo\"bar".bodyβ The parsed input document body.canonicalised metadata keyβ The value for the given metadata key, if found, otherwise an empty list.bodyβ yes, itβs listed again: the parsed input document body.meta(key)β Produce the metadata value for the canonicalised metadata key. Allows for keys that are also keywords likebodyorendif.not(expression)β A non-empty list containing the valuetrueif the expression evaluates as an empty list, otherwise an empty list.or(expression[,expression]*)β A non-empty list containing the valuetrueif one expression evaluates to non-empty lists, otherwise an empty list. An empty expression evaluates to an empty list.thisβ The value of a current loop context or an empty list.
If a metadata key is not specified in the input, or if the anaphoric this has not initialised by a looping context, the initial value evaluates to an empty list. Otherwise, the value is a singleton list.
If transforms are invalid, they will transform into an empty list.
The following transformations are available:
escapegemini,escapegeminilineβ Escape list items for gemini (-tgemini), either for multiple lines or compressed to a single line.escapehtml,escapehtmlattr,escapehtmlurlβ Escape list items for HTML (-thtml) body content, attributes, and URL attributes, respectively.escapelatexβ Escape list items for LaTeX (-tlatex) body content.escaperoff,escaperofflineβ Escape list items for roff (-tms,-tman,-tmdoc), either for multiple lines or compressed to a single line.escaperoffalso escapes initial roff delimiters and those after newlines.joinβ Join a list into a singleton list using two spaces as a join delimiter.lowercaseβ Lowercase all list items.splitβ Split list items on sequences of two or more white-space tokens (space, newline, tab). This is usually invoked on a singleton, but may be repeatedly invoked on a pre-split list. Invokestrimprior to the first split. The resulting list has no items that are only white-space.trimβ Trim white-space from the beginning and end of all list items. If an item has no non-white-space, it is discarded.uppercaseβ Uppercase all list items.
π ENVIRONMENT π
NO_COLORβ Do not emit colours when in-ttermmode. Synonym forNO_COLOUR. Same as--term-no-colour.
π FILES π
share/html/default.htmlβ The default template used if--templateis not provided to-thtml.share/latex/default.latexβ The default template used if--templateis not provided to-tlatex.share/man/default.manβ The default template used if--templateis not provided to-tman.share/ms/default.msβ The default template used if--templateis not provided to-tms.share/odt/styles.xmlβ Default styles used when generating standalone-tfodtdocuments. Template for--odt-stylestyles.
π EXIT STATUS π
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.
π¦ EXAMPLES π¦
To view a Markdown file on an ANSI-compatible, UTF-8 terminal:
lowdown -tterm foo.md | less -R
To emit a standalone HTML5 document:
lowdown -s foo.md > foo.html
To use groff(1) to format as a PS file:
lowdown -stms foo.md | groff -itk -mspdf > 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 -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
Manpages may be converted and viewed on the terminal using groff(1) or mandoc(1):
lowdown -stmdoc foo.md | mandoc | less
lowdown -stman foo.md | groff -itk -man -Tutf8 | less -R
To list all metadata keys, then to extract the βtitleβ metadata value from foo.md:
lowdown -L foo.md
lowdown -X title foo.md
β SEE ALSO β
π AUTHORS π
lowdown was forked from hoedown: https://github.com/hoedown/hoedown by Kristaps Dzonsons, kristaps@bsd.lv. It has been considerably modified since.
and thatβs the whole iconic page, bestie: LOWDOWN(1) from Debian, dated $Mdocdate$, with source/version energy and absolutely no skips π
π¦ where this page comes from
- arch rolling: lowdown 3.2.1-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms