Over the years, several extensions or variants have been developed to enhance and adapt Markdown to different needs and platforms.
These variants are sometimes referred to as “flavor”. Some of the main Markdown variants are CommonMark or GitHub Flavored Markdown (GFM).
These variants modify the standard (which is somewhat in a “no man’s land”) and add functionalities, or standardize some of the existing ones.
In any case, it’s important to know which 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 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 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 Markdown variant 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 for easy table creation.
- Footnotes: Although not natively supported in GFM, third-party extensions can be used to add footnotes.
Example of GFM syntax,
# Level 1 Header
- [x] Completed task
- [ ] Pending task
| Column 1 | Column 2 |
|-----------|-----------|
| Value 1 | Value 2 |
| Value 3 | Value 4 |
```python
def greeting():
print("Hello, World!")
```
[Link to GitHub](https://github.com)
Markdown Extra
Markdown Extra is a Markdown extension 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.
- Blockquotes with Additions: Allows the inclusion of additional elements in blockquotes.
Example of Markdown Extra syntax,
# Level 1 Header
## Table
Name | Age
-------|-----
Luis | 25
Ana | 30
## Definition List
Term
: Definition of the term
MultiMarkdown
MultiMarkdown is a Markdown extension 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,
- Metadata Support: 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 MultiMarkdown syntax,
% 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 Markdown variant 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 including R code directly in the document and generating results dynamically.
- Document Formatting: Supports generating documents in formats like HTML, PDF, and Word.
- Code Cells: Allows the inclusion of code cells to execute scripts and display results in the document.
Example of R Markdown syntax
---
title: "Document Title"
author: "Author"
output: html_document
---
# Data Analysis
```{r}
summary(cars)
```
The analysis of the car data is presented above.
