markdown
Convert Markdown files to HTML
SYNOPSIS
markdown [file ...]
markdown < input.md > output.html
DESCRIPTION
The `markdown` command is a utility designed to convert text formatted with Markdown syntax into HyperText Markup Language (HTML). It adheres to the original Markdown specification created by John Gruber, aiming for a simple and readable plain text format that can be easily transformed into web-ready content.
Typically, this command operates as a script (often a Perl script like `Markdown.pl` or a similar wrapper) that reads Markdown-formatted input from standard input (stdin) or one or more specified files. The resulting HTML output is then written to standard output (stdout). This design makes it highly versatile for use in shell pipelines, allowing users to chain it with other commands for tasks such as creating static web pages, processing documentation, or generating reports.
While it excels at straightforward conversions, it generally offers a minimalistic set of features compared to more comprehensive document converters like `pandoc`, which support numerous input and output formats and extended Markdown syntaxes.
CAVEATS
The `markdown` command, especially in its most common form (like `Markdown.pl`), typically offers a very limited set of command-line options. It focuses solely on the core Markdown-to-HTML conversion without support for extended Markdown syntax (e.g., tables, footnotes, task lists), different output formats, or advanced customization of the HTML.
Its functionality is generally basic, often lacking features like template integration, syntax highlighting, or the ability to embed external resources. For more complex document processing, `pandoc` or similar tools are often required.
INPUT/OUTPUT STREAM
The `markdown` command is highly effective when used with standard input and output streams. This allows it to be easily integrated into shell scripts and command pipelines. For instance, you can pipe the content of a file into `markdown`, or pipe the output of another command into `markdown` for conversion.
SIMPLICITY AND PORTABILITY
The command's strength lies in its simplicity and the portability of its underlying implementations (often simple scripts). It's typically lightweight and has minimal dependencies, making it a good choice for straightforward conversions in environments where more complex tools might be overkill or unavailable.
HISTORY
The `markdown` command's lineage traces back to John Gruber's original Markdown language and its reference implementation, `Markdown.pl`, a Perl script released in 2004. This script was designed to be a simple, portable tool for converting Markdown to HTML.
Over time, various reimplementations and wrappers in different programming languages (Python, Ruby, C, etc.) emerged, but the core functionality of reading Markdown and outputting HTML remained central. On many Linux distributions, the `markdown` command often directly refers to or symlinks to a version of this original Perl script or a close derivative, preserving its minimalist approach.