DEV Community

Cover image for How to render markdown in terminal using pandoc
Israel-Lopes
Israel-Lopes

Posted on • Edited on

How to render markdown in terminal using pandoc

To render a markdown file through the terminal, you can use the pandoc command to convert the markdown file into a format that can be easily displayed by the terminal, such as HTML or ANSI. For example, if you want to convert a file called file.md to HTML and display the result in your browser, you can use the following command:

Before that do:

sudo apt install pandoc

later

pandoc -o file.html file.md && xdg-open file.html

To list in markdown do:

pandoc -t asciidoc file.md | cat

Here is a list of other possibilities that pandoc can offer.

pandoc --list-output-formats

Texto alternativo da imagem

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay