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
269
votes
8 answers

How to embed a video into GitHub README.md?

Is it possible to embed a flash video into README.md on GitHub? It isn't showing up: https://github.com/mattdipasquale/PicSciP
ma11hew28
  • 106,283
  • 107
  • 420
  • 616
250
votes
5 answers

How to markdown nested list items in Bitbucket?

I'm trying to see my markdown nested list items rendered with corresponding indentation when viewed in a browser live from the Bitbucket pages. But I can't figure out how it works even when using their examples (updated): * Item 1 * Item 2 * Item 3 …
Jeff Puckett
  • 28,726
  • 15
  • 96
  • 149
250
votes
16 answers

Create two blank lines in Markdown

I am adding Markdown support to my CMS editor. When writing Markdown content, how do I create two empty lines? I have been trying, but I always get only one line.
Miguel Moura
  • 28,129
  • 59
  • 187
  • 356
227
votes
17 answers

Automatic TOC in github-flavoured-markdown

Is it possible to generate an automatic Table of Contents using Github Flavoured Markdown?
Roberto Aloi
  • 28,818
  • 19
  • 65
  • 109
225
votes
12 answers

Using Sphinx with Markdown instead of reST

I hate reST but love Sphinx. Is there a way that Sphinx reads Markdown instead of reStructuredText?
digi604
  • 2,346
  • 2
  • 14
  • 5
225
votes
6 answers

How to write lists inside a markdown table?

Can one create a list (bullets, numbered or not) inside a markdown table. A table looks like this: | Tables | Are | Cool | | ------------- |:-------------:| -----:| | col 3 is | right-aligned | $1600 | | col 2 is |…
Gabriel Petrovay
  • 17,013
  • 19
  • 79
  • 142
223
votes
5 answers

Markdown vs markup - are they related?

I'm using markdown to edit this question right now. In some wikis I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackoverflow) what do I need to use?
Ron Harlev
  • 15,010
  • 24
  • 83
  • 128
222
votes
16 answers

Markdown and including multiple files

Is there any markdown fork that allows you to reference other files, something like an includes file? Specifically, I want to create a separate markdown file with links that I call often but not always (call this B.md), then when I link by reference…
David LaSpina
  • 2,323
  • 2
  • 14
  • 8
219
votes
4 answers

R - Markdown avoiding package loading messages

I have been using Knitr via R-Studio, and think it is pretty neat. I have a minor issue though. When I source a file in an R-Chunk, the knitr output includes external comments as follows: + FALSE Loading required package: ggplot2 + FALSE Loading…
Roark
  • 2,385
  • 2
  • 12
  • 8
216
votes
11 answers

How to add new line in Markdown presentation?

How to add new line in Markdown presentation? I mean, something like \newline in TeX.
max04
  • 2,375
  • 2
  • 10
  • 17
212
votes
14 answers

Markdown and image alignment

I am making a site that publishes articles in issues each month. It is straightforward, and I think using a Markdown editor (like the WMD one here in Stack Overflow) would be perfect. However, they do need the ability to have images right-aligned in…
Jedidja
  • 15,384
  • 16
  • 71
  • 109
209
votes
4 answers

How to style a JSON block in Github Wiki?

Is there a way to nicely format/style JSON code in Github Wiki (i.e Markdown preferred)? Something like this with few colors (or bold) and correct indentation: http://www.freeformatter.com/json-formatter.html#ad-output
HP.
  • 17,550
  • 43
  • 139
  • 240
207
votes
11 answers

Markdown `native` text alignment

Does markdown support native text-alignment without usage html + css?
fat
  • 5,038
  • 4
  • 37
  • 62
205
votes
3 answers

Set margin size when converting from Markdown to PDF with pandoc

I have created an RMarkdown file in RStudio and managed to knit it with knitr into an HTML and .md file. Next, I used pandoc to convert the .md file into a PDF file (I get an error if I try and convert from the .html file). However, the PDF that…
mchangun
  • 8,274
  • 18
  • 64
  • 94
199
votes
8 answers

Include an SVG (hosted on GitHub) in MarkDown

I know with that an image can be placed in a MD with the MD syntax of either ![Alt text](/path/to/img.jpg) or ![Alt text](/path/to/img.jpg "Optional title"), but I am having difficulty placing an SVG in MD where the code is hosted on…
chris Frisina
  • 17,689
  • 19
  • 75
  • 154