Formatting Demo

Started by glebm
729f685b8e8d7e9feed18c177c82e59b?s=128&d=mm

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.

Oneboxes

URLs of supported resources are replaced with boxes like these:

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

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=1QP7elXwpLw:

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

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

729f685b8e8d7e9feed18c177c82e59b?s=128&d=mm

glebm

Source code of the post above:

 1All of the basic [Markdown](https://kramdown.gettalong.org/quickref.html) formatting is supported (powered by [kramdown](https://kramdown.gettalong.org)).
 2
 3Additionally, Markdown is extended to support the following:
 4
 5#### Math
 6
 7$$f(n) = \begin{cases}
 8  \frac{n}{2}, & \text{if } n \text{ is even} \\
 9  3n+1,        & \text{if } n \text{ is odd}
10\end{cases}
11$$
12
13The code for the example above is:
14
15```
16$$f(n) = \begin{cases}
17  \frac{n}{2}, & \text{if } n \text{ is even} \\
18  3n+1,        & \text{if } n \text{ is odd}
19\end{cases}
20$$
21 ```
22
23Both inline and display modes are [supported](https://kramdown.gettalong.org/syntax.html#math-blocks). Math is rendered server-side and does **not** require JavaScript. Powered by [KaTeX](https://github.com/Khan/KaTeX).
24
25#### Syntax highlighting
26
27Specify the [language](https://kramdown.gettalong.org/syntax.html#language-of-code-blocks) of a code block and the syntax will be highlighted:
28
29```ruby
30puts "Hello, #{user}"
31add_5 = -> x { x + 5 }
32
33class Greeter
34  # ...
35end
36 ```
37
38Powered by [CodeRay](https://github.com/rubychan/coderay).
39
40#### Oneboxes
41
42URLs of supported resources are replaced with boxes like these:
43
44**Twitter** `https://twitter.com/glebm/status/836237442747228162`:
45https://twitter.com/glebm/status/836237442747228162
46**GitHub** `https://github.com/google/dart-scissors/pull/67`:
47https://github.com/google/dart-scissors/pull/67
48**StackExchange** `http://codegolf.stackexchange.com/questions/45701`:
49http://codegolf.stackexchange.com/questions/45701
50**Amazon** `https://www.amazon.co.uk/dp/0521797071`:
51https://www.amazon.co.uk/dp/0521797071
52**YouTube** `https://www.youtube.com/watch?v=1QP7elXwpLw`:
53https://www.youtube.com/watch?v=1QP7elXwpLw
54**Google Maps** `https://goo.gl/maps/R6nj3Qwf2LR2`:
55https://goo.gl/maps/R6nj3Qwf2LR2
56
57Many more resources are [supported](https://github.com/discourse/onebox/tree/master/lib/onebox/engine). Powered by the [onebox](https://github.com/discourse/onebox) library.