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 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.

Stack Overflow 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").

8667 questions
3228
votes
44 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
  • 103,496
  • 31
  • 153
  • 200
2095
votes
23 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
  • 26,448
  • 9
  • 23
  • 28
1640
votes
38 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
  • 31,949
  • 17
  • 74
  • 114
1113
votes
16 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
  • 13,448
  • 6
  • 34
  • 45
965
votes
18 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
  • 27,509
  • 28
  • 97
  • 164
862
votes
20 answers

How to apply color on text in Markdown

I want to use Markdown to store textual information. But quick googling says Markdown does not support color. Also Stack Overflow does not support color. Same as in case of GitHub markdown. Is there any flavor of markdown that allows colored text?
Mahesha999
  • 22,693
  • 29
  • 116
  • 189
808
votes
8 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
  • 10,313
  • 10
  • 40
  • 49
780
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,860
  • 7
  • 40
  • 71
770
votes
13 answers

How to draw checkbox or tick mark in GitHub Markdown table?

I am able to draw checkbox in Github README.md lists using - [ ] (for unchecked checkbox) - [x] (for checked checkbox) But this is not working in table. Does anybody know how to implement checkbox or checkmark in GitHub Markdown table?
Gaurav Bishnoi
  • 7,963
  • 2
  • 13
  • 12
760
votes
24 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
  • 121,420
  • 116
  • 450
  • 651
738
votes
16 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
  • 19,847
  • 19
  • 64
  • 95
728
votes
20 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
  • 22,498
  • 29
  • 129
  • 265
690
votes
15 answers

Cross-reference (named anchor) in markdown

Is there markdown syntax for the equivalent of: Take me to pookie ... this is pookie
Synesso
  • 37,610
  • 35
  • 136
  • 207
687
votes
22 answers

How do I display local image in markdown?

Does anyone know how to display a local image in markdown? I don't want to set up a webserver for that. I try the following in markdown, but it doesn't work: ![image](files/Users/jzhang/Desktop/Isolated.png)
zjffdu
  • 25,496
  • 45
  • 109
  • 159
1
2 3
99 100