A Complete Guide to Markdown: The Lightweight Markup Language

  • It emerged in 2004 as a simple and readable alternative to HTML for writing web content.
  • It allows you to convert plain text into formatted documents using a minimal syntax of symbols.
  • It has various extensions or flavors, such as GitHub Flavored Markdown, to expand its capabilities.
  • It is the preferred tool for programmers, writers, and academics due to its compatibility and longevity.

Markdown markup language

If you create content online, you've probably come across this at some point. files that end in .mdDon't worry if you don't know what they are, because basically we're talking about a writing style that allows you to format your text without having to struggle with complicated codes or use cumbersome word processors. It's a tool that aims to make writing flow smoothly and the final result look professional effortlessly.

Essentially, it's a system that uses simple symbols to indicate whether something should be bold, a title, or a list. Unlike programming languages, there are no variables or mathematical calculations; it's simply a layer of visual rules which is then translated into HTML by software so that any browser in the world can display it correctly.

The origin and philosophy of Markdown

Origin of Markdown

This system was born around 2004, the result of the work of John Gruber and the collaboration of Aaron Swartz. The idea was to break down the barrier to entry posed by HTML; while to make a word bold in HTML you need to write tags like <strong>In this language, a couple of asterisks are enough. They were based on the email conventions of the time so that anyone, whether or not they had technical knowledge, could write with style.

.md files
Related article:
.md files: everything you need to know about them

The philosophy rests on three fundamental pillars: immediacy, compatibility, and longevity. The goal is for the author to be able to write No distractionsthat the file can be opened on any device since it is plain text and that, even decades later, the content remains readable even if the software that processes it disappears.

Basic syntax: How to format text

Markdown syntax

To begin writing, the first thing we need to master is headings. These are created by placing the hash symbol (#) at the beginning of the line. The more hash symbols you use, the smaller the heading will be, down to a maximum of six levelsThere is also an alternative way to use hyphens or equal signs below the text for main titles, although the pound sign is the most common nowadays.

As for emphasis, it's a piece of cake. If you want something to appear in italics, simply surround it with a single asterisk or underscore. If you're looking for greater impact with bold, use two asterisks or two underscores. For those cases where we make a mistake and want to strikethrough a word, we use... two lateral accentsIf you need to write a special character that the system would interpret as code, simply put a backslash before it so that it is displayed literally.

Direct quotations are managed with the greater-than symbol (>), allowing you to even nest one quotation within another by placing several symbols in a row. To visually separate sections, you can insert a horizontal line by writing three or more asterisks, hyphens, or underscores on a separate line.

Data organization: Lists, Links, and Images

Organizing information is vital. For unordered lists, you can use asterisks, plus signs, or hyphens at the beginning of each line. If you need a hierarchical order, numbered lists are created simply by typing the number followed by a period. Interestingly, software often correct the numbering automatically, regardless of the number you put at the beginning.

When we want to add hyperlinks, we use square brackets for the text the user will see and parentheses for the URL. Images follow almost the same logic, but an exclamation mark is added at the beginning. The text inside the square brackets serves as... alternative text (alt)which is fundamental for accessibility and search engine ranking.

For those who are more technical, there are code blocks. If you want to highlight a technical word within a paragraph, use a backtick. If you need to insert a longer code snippet, enclose the entire block in three backticks, even specifying the programming language so the editor can apply the appropriate formatting. appropriate color highlighting.

Flavors, extensions, and tools

Markdown variants

Something very important is that there is no single, closed standard. Because the original specification left some things to chance, so-called "flavors" emerged. The best known is the GitHub Flavored Markdown (GFM)which adds very useful features such as tables, which were not in the original version. There are also implementations like CommonMark, which aims to unify criteria to avoid rendering errors.

When it comes to writing, you have a huge range of options. You can use the simple Windows Notepad, but ideally you should use specialized editors like Visual Studio Code, Obsidian, or Zettlr. These programs offer a real-time preview screen, allowing you to see what the final document will look like while you continue writing in plain text.

In academic and data environments, it is very common to combine this language with programming languages ​​such as R or Python. This allows the creation of documents where text and code coexist, facilitating the reproducibility of research scientific and the generation of automatic graphs or tables that are inserted directly into the article flow.

This writing system has established itself as the ideal bridge between the simplicity of plain text and the power of the web, allowing anyone to create technical documentation, blogs, or personal notes that are durable, easy to edit, and fully compatible with modern digital publishing standards.