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
5
votes
1 answer

Using an R Markdown style document (.Rmd) as input for Pweave

I'm trying to run a basic R Markdown document (that calls python in code chunks) through Pweave. In the Pweave documentation it states that you can declare code chunks using the style ```{python}. However when I try to compile using, for example,…
James Owers
  • 7,948
  • 10
  • 55
  • 71
5
votes
1 answer

Is there a markdown friendly alternative to "truncatechars:x"?

The classic task is to display the list of blog-posts, including a short summary of each post. As I have seen on the web, the most common approach is to truncate the content of the original blog post. So my post_list.html template looks like…
ionescu77
  • 1,150
  • 10
  • 14
5
votes
1 answer

Markdown reference to a code/output cell in Jupyter notebooks?

Suppose I have executed some code snippet: In [16]: print "hello" Out [16]: hello Is there a way to refer to that in/out cell in my markdown text, like: See the results in $ACell where $ACell evaluates to 16 (in this case).
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217
5
votes
1 answer

R Markdown: plots within a loop going out of margin when typesetting to PDF

When typesetting an R Markdown document to PDF, if a function draws multiple plots, those plots often appear side-by-side, with only the first plot fully within the margins of the page. Minimal R Markdown example: --- title: "Example re plotting…
Daniel Weeks
  • 53
  • 1
  • 4
5
votes
2 answers

Image won't show up on NPM, but shows up on Github

Working on this repo for an NPM module the image shows up on Github (scroll down) https://github.com/ORESoftware/suman but on NPM, despite an HTTP 200 to retrieve the image from Github, it doesn't show up https://www.npmjs.com/package/suman this is…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
5
votes
3 answers

How to automatically create README.md markdown of directory tree listing

I want to create markdown with a directory tree listing automatically, in order to be shown in online repos like GitHub in every directory. So, given that I'm going to use the Linux tree command that can be installed on MacOS X using brew install…
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
5
votes
1 answer

Wrapping pandoc table column names in r markdown

I am creating a pandoc.table with long column name that I want to wrap so my table does not go off the pdf page. I know you can use split.tables, but that takes away the clarity of the table. Using split.cells doesn't seem to do anything, even…
Killian
  • 89
  • 2
  • 10
5
votes
3 answers

R Markdown Template Creation

So I am just curious if anybody knows how to change the default R Markdown Creation file with the following output: --- title: "Untitled" author: "Cody Glickman" date: "February 27, 2016" output: html_document --- This is an R Markdown document.…
Cody Glickman
  • 514
  • 1
  • 8
  • 30
5
votes
1 answer

How to use numbered LaTeX equations using kramdown in jekyll

Would it be possible to use equation numbers with the kramdown engine in jekyll? It seems that the previous engine maruku had supported equation numbering. I wanted to use equation numbering and cross-referencing supported by MathJax. I have…
Chang
  • 846
  • 10
  • 23
5
votes
1 answer

Combining Visual Studio Code Build Tasks

The Visual Studio Code documentation provides example tasks.json configuration that allows either typescript compilation, or markdown compilation. It does not clarify how to achieve both simultaneously. How can that be done? Here is a summary of…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
5
votes
1 answer

R markdown figure legend is cut off

I'm generating some graphs in markdown file, but the graph does not look right in the html file. In RStudio, it works well, and looks like this: But in the markdown html file, the legend box on the right side is cut off: I tried adjusting…
LovelyVV
  • 75
  • 1
  • 5
5
votes
1 answer

How to export R shiny presentation to pdf or html

I built an interactive shiny presentation in Rstudio. Header of the .Rmd file is: --- title: "title" author: "author" date: "date" output: ioslides_presentation: mathjax:…
madcap
  • 61
  • 1
  • 5
5
votes
1 answer

Converting markdown text to ipython notebook

I have some (over 100) notes take down as mark down text file (with .md extension). Recently I discovered ipython notebook. Barring no Vim keybinding, it looks perfect. So would like to convert all those .md files into .ipynb files. Is there such a…
lang2
  • 11,433
  • 18
  • 83
  • 133
5
votes
2 answers

Pandoc inline .class and .id elements

My Question: Is there a way in Pandoc markdown to mark inline class (or id) elements that could then be output to LaTeX and html and if so, how? I am looking for a "one input many outputs" publication solution with needed output of LaTeX and epub,…
BrianWilson
  • 1,653
  • 2
  • 12
  • 16
5
votes
1 answer

How to set the value of GhostDown Markdown editor

I'm working on a simple note taking application and using GhostDown Markdown editor. It's pretty nice, I like it, but I am stuck trying to set it's value programatically. I can get values out pretty easily. $('.entry-markdown-content…
Serhiy
  • 2,505
  • 3
  • 33
  • 49