Language: EN

variantes-flavors-de-markdown

Variants and Flavors of Markdown

Over the years, several extensions or variants have been developed to enhance and adapt Markdown to different needs and platforms.

Sometimes these variants are referred to as “flavors”. Some of the main variants of Markdown are CommonMark and GitHub Flavored Markdown (GFM).

These variants modify the standard (which is a bit “in no man’s land”) and add functionalities, or normalize some of the existing ones.

In any case, it is important to know what variants exist and, above all, which one we are using, or if we can use a functionality that is not implemented on that platform.

CommonMark

CommonMark is a Markdown specification developed to address the lack of standardization and consistency in existing Markdown implementations.

Its goal is to provide a unified and clear definition of the language, ensuring that content is interpreted consistently across different platforms and applications.

Main features of CommonMark,

  • Standardization: CommonMark provides a detailed and standardized specification that defines how Markdown should behave in various situations.
  • Compatibility: It offers a solid foundation for the development of additional extensions and variants, ensuring that content is displayed consistently across different implementations.
  • Extensibility: CommonMark allows the addition of extensions to cover additional functionalities without breaking the basic specification.

Example of CommonMark,

# Level 1 Header

This is a paragraph with **bold** and *italic*.

- Unordered list
  - Secondary item

1. Ordered list
2. Second item

[Link to Google](https://www.google.com)

GitHub Flavored Markdown (GFM)

GitHub Flavored Markdown is a variant of Markdown used on GitHub to format README files, comments, and other content. For this reason, it is very popular and widely adopted.

Main features of GFM,

  • Tasks and Checklists: Allows the creation of interactive task lists that can be marked as completed.
  • Tables: Supports tables with a specific syntax to create tables easily.
  • Footnotes: Although not natively supported in GFM, third-party extensions can be used to add footnotes.

Example of syntax in GFM,

# Level 1 Header

- [x] Completed task
- [ ] Pending task

| Column 1 | Column 2 |
|-----------|-----------|
| Value 1   | Value 2   |
| Value 3   | Value 4   |

```python
def greet():
    print("Hello, World!")
```

[Link to GitHub](https://github.com)

Markdown Extra

Markdown Extra is an extension of Markdown that adds new features to the original syntax. It was developed by Michel Fortin to provide greater functionality in content creation.

Main features of Markdown Extra,

  • Tables: Allows the creation of tables with a specific syntax.
  • Definition Lists: Supports definition lists.
  • Block Quotes with Additional Elements: Allows the inclusion of additional elements in block quotes.

Example of syntax in Markdown Extra,

# Level 1 Header

## Table

Name | Age
-------|-----
Juan   | 25
Ana    | 30

## Definition List

Term
: Definition of the term

MultiMarkdown

MultiMarkdown is an extension of Markdown that adds advanced features for creating more complex documents, such as academic papers and books. It was developed by Fletcher Penney.

Main features of MultiMarkdown,

  • Support for Metadata: Allows the inclusion of metadata in the document header.
  • Footnotes and References: Improves the handling of footnotes and bibliographic references.
  • Formulas and Equations: Allows the inclusion of mathematical formulas.

Example of syntax in MultiMarkdown,

% Document Title
% Author
% Date

# Level 1 Header

This is a paragraph with a mathematical formula: \( E = mc^2 \).

## Footnotes

Here goes a footnote[^1].

[^1]: This is a footnote in MultiMarkdown.

R Markdown

R Markdown is a variant of Markdown used in the R ecosystem to combine text with code in the context of data analysis and report generation.

Main features of R Markdown,

  • Integration with R: Allows the inclusion of R code directly in the document and generates results dynamically.
  • Document Formatting: Supports the generation of documents in formats such as HTML, PDF, and Word.
  • Code Chunks: Allows the inclusion of code chunks to run scripts and display results in the document.

Example of syntax in R Markdown

---
title: "Document Title"
author: "Author"
output: html_document
---

# Data Analysis

```{r}
summary(cars)
```

The analysis of the car data is presented above.