mdcat
cat
for CommonMark: Show CommonMark (a standardized Markdown dialect)
documents on text terminals.
$ mdcat sample.md
Installation and Requirements
Install Rust and run cargo install mdcat
.
To keep mdcat up to date install cargo-update and run cargo install-update mdcat
.
mdcat needs a decent modern terminal with a good font; in particular mdcat uses
- 256 colours,
- italic text, and
- iTerm2 escape codes for marks.
iTerm2 works; I do not know about other terminal emulators.
Status and future plans
mdcat
supports all checked features in the list below. For unsupported
syntax mdcat panics!
Version 1
- Inline formatting, with proper nesting of emphasis
- Headings
- Block quotes
- Code blocks
- Ordered lists
- Numbered lists
- Nested lists
- Links
- Syntax highlighting for code blocks
- Show inline HTML and block HTML literally
- iTerm2 integration: Set marks for headings to jump back and forth
- iTerm2 integration: Show images inline
Future plans
- Fetch remote images to show them inline.
- Use basic ANSI colour highlighting instead of 24 colours to better fit the terminal theme.
- Automatically select highlight theme according to terminal background GH-5.
- Figure out a better way to show HTML GH-3.
- CommonMark extensions: Footnotes GH-1.
- CommonMark extensions: Tables GH-2.
- Ignore soft wraps and wrap inline text a column limit instead GH-4.
License
Copyright 2018 Sebastian Wiesner sebastian@swsnr.de
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.