Markdown, reStructured Text and their different elements

I'll go over the various components of markdown and restructured text in this article, as well as some practical applications.

What Is Markdown and How Does It Work?

Markdown is one of the world's most popular markup languages. It is a lightweight markup language for adding formatting elements to plaintext text documents.

It was created in 2004 by John Gruber and Aaron Swartz as a markup language that is appealing to human readers in its source code form. Markdown is a popular programming language used for blogging, instant messaging, online forums, collaborative software, documentation pages, and readme files.

When creating a markdown-formatted file, it is necessary to add markdown syntax to the text to indicate which words and phrases should look different. Text in Markdown files can be read even if it is not rendered because its syntax is designed to be readable and unobtrusive.

Markdown is a portable text format, and files containing markdown-formatted text can be opened in almost any application. It's everywhere, and websites like Reddit and GitHub, as well as many desktop and web-based applications, support it.

In markdown, the text is saved in a plaintext file that has a .md or .markdown extension.

The learning curve for formatting text in Markdown is very gentle. It doesn’t do anything fancy like change the font size, color, or type. All you have control over is the display of the text, like making things bold, creating headers, and organizing lists.

To effectively display the words and phrases in different ways, I will be explaining some different markdown elements and how to use them below. The following are the different elements:

  • Italics: To display a word in italics, the word or phrase to be italicized is inserted between two underscores. For example, " _come_" will make the text appear as this "come".

  • Bold: To make a word appear bold, the word or phrase to be made bold, should be inserted between four asterisks. For example, "** come **" will make the text appear as this "come".

  • Headers: Markdown has six(6) headers which are H1 through to H6. H1 is the biggest and generally the main header, and each header after H1 gets smaller.

    To display headers in markdown, you begin the phrase with a hash mark(#). Place the same number of hash marks as the size of the header you want. For example, for header one, you'd use one hash mark(# Header one), while for header four, you would use four hash marks (#### Header four).

  • Links: To make links to other websites on the world wide web, markdown has two different link types and both of them render the same way.

    The first style is called an inline link and to create an inline link, you wrap the link text in a square bracket "[ ]", and then wrap the link in parenthesis "()".

    For example, to create a hyperlink to google.com, with a link text that says, Search for it !, you'd write this in Markdown: [Search for it !](google.com).

    The second link is called a reference link. The link is a reference to another place in the document. To create a reference link, you wrap the link text in a square bracket "[ ]", and then wrap the references in a second set of square bracket "[]", and at the bottom of a Markdown document, these brackets are defined as proper links to an outside website.

    For example, to create some reference links to zombo.com and stumbleupon.com, you wrap the link text in a square bracket and on the second bracket, you input another word and after that at the bottom of the markdown, the second square bracket is followed by a colon before the website actual link.

    Do you want to [see something fun][a fun place]?

    Well, do I have [the website for you][another fun place]!

    [a fun place]: zombo.com

    [another fun place]: stumbleupon.com

  • Lists: To display both unordered lists and ordered lists in markdown, you begin each item in the list with an asterisk or dash. Each list item also gets its line and this will make the list items be displayed as an unordered list. While for ordered lists, you begin each item with a number followed by a period and a space.

  • Blockquotes: A blockquote is a sentence or paragraph that's been specially formatted to draw attention to the reader. To display a paragraph as a blockquote, you begin the paragraph that you want to make as blockquotes with a greater than symbol and that will convert the paragraph to the blockquote.

What Is reStructured Text?

reStructuredText is a lightweight markup language that is used in static site generators like Sphinx. It is an easy-to-read, what-you-see-is-what-you-get plaintext markup, syntax, and parser system.

It contains robust tools for semantic markup, reusing content, and content filters for different kinds of outputs. It’s also easily extendible using custom directives that you can create yourself, allowing you to satisfy a wide variety of documentation needs.

reStructuredText is widely used for Python documentation, both for the Python language itself and Python libraries. It is a revision and reinterpretation of the StructuredText and Setext lightweight markup systems.

Compared to some other lightweight markup languages like MarkDown, reStructuredText contains stronger semantic markup tools.

How To Use reStructured Text

Just like Markdown, it has similar ways to effectively display words and phrases in italics, bold, and lists.

But to display headers, it's different with restructured text. Headers are demarcated by non-alphanumeric characters like dashes, equal signs, or tildes. While displaying code samples or any text that should not be formatted, end the paragraph before the code sample with two colons (::).

In conclusion, I hope I have been able to explain what Markdown and reStructured Text are and how they can be effectively used.