Skip to content

Instantly share code, notes, and snippets.

@simonmysun
Last active December 25, 2015 23:09
Show Gist options
  • Save simonmysun/7055342 to your computer and use it in GitHub Desktop.
Save simonmysun/7055342 to your computer and use it in GitHub Desktop.
renren-markdown test
//renren-markdown test
//第二次: 编辑测试
这是@钟音.git(261213653) 巨巨写的renren-markdown, 我来体验下.
代码在[此处](https://gist.github.com/smilekzs/6045615), Chrome下安装至Tampermonkey即可, 同时也希望大家积极参与贡献该项目([fork it!](https://github.com/smilekzs/renren-markdown)).
本文的markdown源码在[此处](https://gist.github.com/simonmysun/7055379). 在本文的最后, 也有本文的源码(好像点搞出无尽的递归).
下面测试开始
# 一级标题
内容
## 二级标题
内容
### 三级标题
内容
#### 四级标题
内容
##### 五级标题
内容
###### 六级标题
内容
# 一级标题的另一种写法 #
一级标题的另一种写法
===
二级标题的另一种写法
---
## 表格(html兼容)
<table>
<tr>
<td>Foo</td>
<td>Foo</td>
</tr>
<tr>
<td>Foo</td>
<td>Foo</td>
</tr>
<tr>
<td>Foo</td>
<td>Foo</td>
</tr>
<tr>
<td>Foo</td>
<td>Foo</td>
</tr>
</table>
## 分割线
分割线
* * *
分割线
***
分割线
*****
分割线
- - -
分割线
---------------------------------------
分割线
## 区块引用
> Markdown 标记区块引用是使用类似 email 中用 > 的引用方式。如果你还熟悉在 email 信件中的引言部分,你就知道怎么在 Markdown 文件中建立一个区块引用,那会看起来像是你自己先断好行,然后在每行的最前面加上 > :
> > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> >
> > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> > id sem consectetuer libero luctus adipiscing.
>
> Markdown 也允许你偷懒只在整个段落的第一行最前面加上 > :
>
> > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
>
> 区块引用可以嵌套(例如:引用内的引用),只要根据层次加上不同数量的 > :
>
> > This is the first level of quoting.
> >
> > > This is nested blockquote.
> >
> > Back to the first level.
>
> 引用的区块内也可以使用其他的 Markdown 语法,包括标题、列表、代码区块等:
>
> > ## 这是一个标题。
> >
> > 1. 这是第一行列表项。
> > 2. 这是第二行列表项。
> >
> > 给出一些例子代码:
> >
> > return shell_exec("echo $input | $markdown_script");
>
> 任何像样的文本编辑器都能轻松地建立 email 型的引用。例如在 BBEdit 中,你可以选取文字后然后从选单中选择增加引用阶层。
## 列表
* Red
* Green
* Blue
+ Red
+ Green
+ Blue
- Red
- Green
- Blue
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
1. Bird
2. McHale
1. Parish
1. This is a list item with two paragraphs.
This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.
2. Another item in the same list.
## 代码
一句话以内的代码`printf("%d\n",result);`.
一句话以内的代码<code>printf("%d\n",result);</code>.
整段代码:
<pre>
#include<stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
</pre>
#include<stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
## 超链接
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
This is [an example][id] reference-style link.
[id]: http://example.com/ "Optional Title Here"
[Google][]
[Google]: http://google.com/
## 强调
*single asterisks*
_single underscores_
**double asterisks**
__double underscores__
## 图片
![Alt text](http://s.xnimg.cn/imgpro/v6/logo.png)
![Alt text](http://s.xnimg.cn/imgpro/v6/logo.png "Optional title")
![Alt text][id]
[id]: http://s.xnimg.cn/imgpro/v6/logo.png "Optional title attribute"
### 图片与链接嵌套
[![Alt text](http://s.xnimg.cn/imgpro/v6/logo.png "Optional title")](http://www.renren.com/)
## 自动链接
<http://example.com/>
## 圈人
renren-markdown的作者为@钟音.git(261213653) .
## TeX支持
这是一个式子: $$\sum_{i=1}^n a_i=0$$. 这是一个式子: $$f(x)=x^{x^x}$$. 这是一个式子: $$\mbox{对任意的 $\epsilon>0$ , 存在 $N>0$ , 使得任意的$n>N$, $\left\vert a_n-a\right\vert<\epsilon$ }$$. 这是一个式子: $$\frac{numerator}{denominator}$$. 这是一个式子: $$\sqrt{x}$$. 这是一个式子: $$\sqrt[n]{x}$$. 这是一个式子: $$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$. 这是一个式子: $$f(x,y,z) = 3y^2 z \left( 3 + \frac{7x+5}{1 + y^2} \right).$$. 这是一个式子: $$\left. \frac{du}{dx} \right|_{x=0}.$$
$$$
J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}
$$$
洛伦兹变换:
$$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{aligned}
$$$
The Cauchy-Schwarz Inequality:
$$$
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
$$$
A Cross Product Formula:
$$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}
$$$
The probability of getting k heads when flipping n coins is:
$$$
P(E) = {n \choose k} p^k (1-p)^{ n-k}
$$$
An Identity of Ramanujan:
$$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }
$$$
A Rogers-Ramanujan Identity:
$$$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}.
$$$
Maxwell’s Equations:
$$$
\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
$$$
## 试试从gist导进来一段代码怎么样
本文源码:
https://gist.github.com/simonmysun/7055342
@lisu60
Copy link

lisu60 commented Oct 19, 2013

拿回去学习学习

@lisu60
Copy link

lisu60 commented Oct 19, 2013

听说这个comment也支持markdown?

让我悄悄试一下

@simonmysun
Copy link
Author

@lisu60 哈哈是的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment