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

R code chunk printing extra line in Markdown

I'm creating a data analysis report using Markdown, knitr. When I run a code chunk containing a table, addmargins(table(x$gender, exclude=NULL)) This is what I get: ## ## Female Male Sum ## 49 53 0 102 This is what I…
Tammy Pham
  • 75
  • 3
5
votes
1 answer

Markdown-it not working, Throwing errors on page load

I am trying to use markdown-it js to take the markdown content out of an HTML element on a page, and render it back as HTML (say, during page load). In the document ready function below, I have used code similar to the way described in the…
Higher-Kinded Type
  • 1,964
  • 5
  • 27
  • 44
5
votes
1 answer

PageDown through ScriptEngine incorrectly parsing Markdown

I am trying to use PageDown on the client side as an editor, and on the server side to then parse that Markdown to HTML. It seems to work fine on the client side, but on the server side, tickmarks are only "codifying" the character that follows, not…
Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
5
votes
4 answers

How do I display the base of logarithms in Markdown?

Is there a way to display the base of a logarithm in (GitHub-flavored) Markdown so that it will be shown below the line? I mean the number 2 in this expression: log2 n.
moodcheerful
  • 195
  • 2
  • 7
5
votes
2 answers

Support for adding lazy load for images in Markdown

I'm using kramdown parser to convert markdown to html. I want to use lazy load for images without modifying original markdown syntax. I can achieve this by editing link.rb file in kramdown gems. But I don't want to follow this way. Because if…
Arasu RRK
  • 1,078
  • 16
  • 28
5
votes
3 answers

Is it possible to desaturate a ggplot easily?

Is it possible to desaturate a ggplot easily? In principle, there could be two possible strategies. First, apply some function to a ggplot object (or, possibly, Grob object) to desaturate all colors. Second, some trick to print ggplot desaturated…
ikashnitsky
  • 2,941
  • 1
  • 25
  • 43
5
votes
1 answer

Markdown headers not displayed correctly in npm

Can somebody explain why headers in README.md, displayed correctly in github, are not rendered in npm (they are displayed like "#title")? example: https://github.com/Cerealkillerway/versionUpdater (ok) https://www.npmjs.com/package/version-updater…
Cereal Killer
  • 3,387
  • 10
  • 48
  • 80
5
votes
1 answer

Laravel 5 Parsedown returning plain html tags to browser

I've installed parsedown (am using laravel 5) for parsing markdown and when I run it it is changing the markdown to html but the browser is plainly showing the parsed markdown instead of applying those particular styles for example when I run the…
user3714932
  • 1,253
  • 2
  • 16
  • 29
5
votes
5 answers

hexo change folder structure when generate static files

First of all, thanks Hexo. Here is my question: I set post_asset_folder to true in the Hexo configuration file. Then I run: $ hexo new first. then: $ ls source/_posts/ first/ first.md hello-world.md I added a pic named pic.png into…
seekkAn
  • 51
  • 3
5
votes
2 answers

How can I install packages in knitr?

Till now, I was using this chunk of code to load R packages and write .R files. But I am trying to use knitr rm (list=ls(all=TRUE)) kpacks <- c('ggplot2','install_github','devtools','mapdata') new.packs <- kpacks[!(kpacks %in%…
maximusdooku
  • 5,242
  • 10
  • 54
  • 94
5
votes
1 answer

Generating a link with Markdown (BlueCloth) that opens in a new window

I'd like to have a link generated with BlueCloth that opens in a new window. All I could find was the ordinary [Google](http://www.google.com/) syntax but nothing with a new window. Ideas? Regards Tom
Tom
  • 51
  • 3
5
votes
4 answers

Jekyll Markdown, compiling images with paragraph tags

This is just a simple problem but it's one that I can't find on Google to solve this. Basically what is happening is that I have a Jekyll website, and I'm using kramdown for the markdown compiling. When I add an image to a markdown file like…
j-mes
  • 253
  • 4
  • 18
5
votes
3 answers

Access name of .rmd file and use in R

I am knitting a markdown file called MyFile.rmd. How can I access the string MyFile during the knitting and use it for: use in the title section of the YAML header? use in subsequent R chunk? --- title: "`r rmarkdown::metadata$title`" author: "My…
user2030503
  • 3,064
  • 2
  • 36
  • 53
5
votes
1 answer

Is it possible to have custom numbers in ordered lists in markdown?

Say, I need a list (for indentation purposes) of the following format: (1a) Bla (1b) Bla (2a) Bla (2b) Bla Is there a way to do this in markdown?
lord.garbage
  • 5,884
  • 5
  • 36
  • 55
5
votes
1 answer

Display .R script in output of .Rmd file

Is it possible to include or display an .r script in the output of .rmd file? Important - just want to display the .r file! Tried source(filename.r); source does not display it. Any ideas? **knitr Global Options** ```{r…
Cyrus Lentin
  • 163
  • 1
  • 7
1 2 3
99
100