Formatting Demo

Started by glebm

glebm

All of the basic Markdown formatting is supported (powered by kramdown).

Additionally, Markdown is extended to support the following:

Math

f(n)={n2,if n is even3n+1,if n is oddf(n) = \begin{cases} \frac{n}{2}, & \text{if } n \text{ is even} \\ 3n+1, & \text{if } n \text{ is odd} \end{cases}

The code for the example above is:

$$
f(n) = \begin{cases}
  \frac{n}{2}, & \text{if } n \text{ is even} \\
  3n+1,        & \text{if } n \text{ is odd}
\end{cases}
$$

Both inline and display modes are supported. Math is rendered server-side and does not require JavaScript. Powered by KaTeX.

Syntax highlighting

Specify the language of a code block and the syntax will be highlighted:

1puts "Hello, #{user}"
2add_5 = -> x { x + 5 }
3
4class Greeter
5  # ...
6end

Powered by CodeRay.

Spoiler tags

<spoiler>Spoiler content</spoiler>:

Oneboxes

URLs of supported resources are replaced with boxes like these:

Twitter https://twitter.com/glebm/status/1116031103863803904:

https://twitter.com/glebm/status/1116031103863803904

GitHub https://github.com/google/dart-scissors/pull/67:

StackExchange http://codegolf.stackexchange.com/questions/45701:

Amazon https://www.amazon.co.uk/dp/0521797071:

YouTube https://www.youtube.com/watch?v=dQw4w9WgXcQ:

Google Maps https://goo.gl/maps/R6nj3Qwf2LR2:

https://goo.gl/maps/R6nj3Qwf2LR2

Many more resources are supported. Powered by the onebox library.