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

Resize image in the wiki of GitHub using Markdown

I'm writing a wiki page on GitHub, and I'm using Markdown. My problem is that I'm putting a large image (this image is in its own repository) and I need resize it. I have tried different solutions, but they do not…
fhuertas
  • 4,764
  • 2
  • 17
  • 28
405
votes
4 answers

What is the difference between README and README.md in GitHub projects?

I've noticed some GitHub projects have not only a README file, but also a README.md file. What is the difference between these files? I know README serves also as introductory text in the project repository page but I have no idea what README.md…
Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189
404
votes
12 answers

Print Directory & File Structure with icons for representation in Markdown

I want a Linux command to print directory & file structures in the form of a tree, possibly with Unicode icons before each file, and some hint for the best syntax to include the output in a Markdown document, without spaces between…
Matt Rowles
  • 7,721
  • 18
  • 55
  • 88
369
votes
13 answers

How to add footnotes to GitHub-flavoured Markdown?

I am just trying to add footnotes in my GitHub Gist, but it doesn't work: Some long sentence. [^footnote] [^footnote]: Test, [Link](https://google.com). I am following this guide and I don't think I'm doing anything wrong. Can someone point out my…
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156
362
votes
17 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
  • 36,732
  • 85
  • 259
  • 481
345
votes
28 answers

How can I test what my readme.md file will look like before committing to github?

I am writing a readme for my github project in the .md format. Is there a way can I test what my readme.md file will look like before committing to github?
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
339
votes
9 answers

Get underlined text with Markdown

How can I underline text in Markdown?
Peter
  • 3,399
  • 2
  • 16
  • 3
288
votes
9 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
  • 20,476
  • 22
  • 97
  • 168
285
votes
20 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,953
  • 2
  • 16
  • 8
278
votes
6 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
  • 16,227
  • 24
  • 89
  • 132
276
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.
  • 19,226
  • 53
  • 154
  • 253
276
votes
15 answers

Markdown `native` text alignment

Does markdown support native text-alignment without usage html + css?
fat
  • 6,435
  • 5
  • 44
  • 70
262
votes
20 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
  • 16,610
  • 17
  • 73
  • 112
259
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
  • 9,814
  • 18
  • 71
  • 101
253
votes
15 answers

How can I create a text box for a note in markdown?

I am writing a document in markdown. I am using the wonderful pandoc to create docx and tex files from the markdown source. I would like to have a textbox for tips and notes to readers the way programming books often do. I cannot figure out how to…
TJB
  • 3,493
  • 4
  • 23
  • 20