Questions tagged [markdown]

Markdown is a plain text formatting syntax designed so that it can be converted to HTML using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz, allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”. The language takes many cues from existing conventions for marking up plain text in email.

Markdown is also a Perl script written by Gruber, “Markdown.pl”, which converts marked-up text input to valid, well-formed XHTML or HTML and replaces left-pointing angle brackets (<) and ampersands with their corresponding character entity references. It can be used as a standalone script, as a plugin for Blosxom or Movable Type, or as a text filter for BBEdit.

Markdown has since been re-implemented by others as a Perl module available on CPAN (Text::Markdown), and in a variety of other programming languages. It is distributed under a BSD-style license and is included with, or available as a plugin for, several content-management systems.

StackOverflow uses Markdown.

This wiki entry was copied from Wikipedia.

Formatting using markdown

Different markdown dialects use slightly different formatting, but here are the general ideas:

You can use ** or __ to start and end bold text.

**Danger:** you need to prepare user inputs to avoid SQL injection.

You can use * or _ to start and end italic text.

_A Christmas Carol_ is a book written by Charles Dickens.

You can use backticks to format code text.

An `if` statement checks a condition, and runs code if it is true.

You can use ``` to format entire code blocks (like the one below)

Here is some code:
```
for (i = 0; i < 10; i++) {
    print "hi";
}
```

You can use > at the start of a line to insert a quote.

The specification says:
> You need to put x and y in brackets

Markdown dialects

A number of Markdown dialects are in widespread use, most of which add or enhance support for things like tables and links. Notable examples include

Babelmark may be used to compare the output generated by different implementations of Markdown.

Since 2014, you also have CommonMark, a strongly defined, highly compatible specification of Markdown (see "Standard Markdown is now Common Markdown").

7087 questions
2361
votes
34 answers

How to add images to README.md on GitHub?

Recently I joined GitHub. I hosted some projects there. I need to include some images in my README File. I don't know how to do that. I searched about this, but all I got was some links which tell me to "host images on web and specify the image path…
Midhun MP
  • 90,682
  • 30
  • 147
  • 191
1636
votes
18 answers

Comments in Markdown

How do you write a comment in Markdown, i.e. text that is not rendered in the HTML output? I found nothing on the Markdown project.
Betamos
  • 20,216
  • 9
  • 21
  • 27
1178
votes
31 answers

Changing image size in Markdown

I just got started with Markdown. I love it, but there is one thing bugging me: How can I change the size of an image using Markdown? The documentation only gives the following suggestion for an image: ![drawing](drawing.jpg) If it is possible I…
cantdutchthis
  • 24,764
  • 14
  • 64
  • 105
918
votes
16 answers

What file uses .md extension and how should I edit them?

On GitHub, several projects have README.md files. It seems like a simple format file to express text and pictures. I guess there is an editor or syntax explanation somewhere. Where can I find an introduction to .md files?
Lai Yu-Hsuan
  • 25,828
  • 23
  • 91
  • 156
747
votes
3 answers

GitHub satanically messing with Markdown - changes 666 to DCLXVI

My GitHub repository has nothing but a readme in it. In this readme, locally I wrote this: Factoids: - There are about six different ways to do everything in Forked. - There are actually six different ways to enter loops. - There are six…
MD XF
  • 7,062
  • 7
  • 34
  • 64
676
votes
14 answers

How to link to part of the same document in Markdown?

I am writing a large Markdown document and would like to place a table of contents of sorts at the beginning that will provide links to various locations in the document. How can I do this? I tried using: [a link](# MyTitle) where MyTitle is a…
recipriversexclusion
  • 8,930
  • 5
  • 29
  • 44
643
votes
34 answers

View markdown files offline

Is there a way to display .md files offline so we know what it will look like once it's uploaded in Github? I'm referring to showing the README.md file as it would come out in Github, and not as for editing purposes. Needs to work on Mac and Windows…
enchance
  • 25,010
  • 30
  • 75
  • 111
643
votes
17 answers

How to add screenshot to READMEs in github repository?

Is it possible to place a screenshot in README file in a GitHub repository? What's the syntax?
daisy
  • 19,459
  • 24
  • 111
  • 218
642
votes
7 answers

How to link to a named anchor in Multimarkdown?

I have come across a number of mentions of MultiMarkdown's support for internal links / named anchors but I am unable to find a single example of how to actually do it. So, what is the syntax for denoting the named anchor, and what is the syntax…
masukomi
  • 8,507
  • 8
  • 35
  • 45
592
votes
11 answers

Cross-reference (named anchor) in markdown

Is there markdown syntax for the equivalent of: Take me to pookie ... this is pookie
Synesso
  • 34,066
  • 32
  • 124
  • 194
581
votes
12 answers

Markdown: continue numbered list

In the following markdown code I want item 3 to start with list number 3. But because of the code block in between markdown starts this list item as a new list. Is there any way to prevent that behaviour? Desired output: 1. item 1 2. item…
orschiro
  • 15,631
  • 18
  • 54
  • 86
566
votes
19 answers

Can I create links with 'target="_blank"' in Markdown?

Is there a way to create a link in Markdown that opens in a new window? If not, what syntax do you recommend to do this. I'll add it to the markdown compiler I use. I think it should be an option.
ma11hew28
  • 106,283
  • 107
  • 420
  • 616
532
votes
13 answers

How to apply color in Markdown?

I want to use Markdown to store textual information. But quick googling says Markdown does not support color. Also StackOverflow does not support color. Same as in case of GitHub markdown. Is there any flavor of markdown that allows colored text?
Mahesha999
  • 17,254
  • 23
  • 89
  • 157
461
votes
3 answers

Superscript in markdown (Github flavored)?

Following this lead, I tried this in a Github README.md:
seinecle
  • 8,419
  • 13
  • 55
  • 107
1
2 3
99 100