Rexdf

The devil is in the Details.

Octopress代码高亮

| Comments

语法高亮

语法

``` [language] [title] [url] [link text] [linenos:false] [start:#] [mark:#,#-#]
code snippet
```

说明

 [language] - Used by the syntax highlighter. Passing 'plain' disables highlighting.
 [title] - Add a figcaption to your code block.
 [url] - Download or reference link for your code.
 [Link text] - Text for the link, defaults to 'link'.

例子1

``` ruby Discover if a number is prime http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ Source Article
 class Fixnum
   def prime?
     ('1' * self) !~ /^1?$|^(11+?)\1+$/
   end
 end
```

显示成

Discover if a number is primeMyBlog
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end

例子2.

``` matlab MathJax Example http://blog.rexdf.org MyBlog
\begin{align*}
  & \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right)
  = \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\
  & (x_1, \ldots, x_n) \left( \begin{array}{ccc}
      \phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\
      \vdots & \ddots & \vdots \\
      \phi(e_n, e_1) & \cdots & \phi(e_n, e_n)
    \end{array} \right)
  \left( \begin{array}{c}
      y_1 \\
      \vdots \\
      y_n
    \end{array} \right)
\end{align*}
```

则为

MathJax ExampleMyBlog
\begin{align*}
& \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right)
= \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\
& (x_1, \ldots, x_n) \left( \begin{array}{ccc}
\phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\
\vdots & \ddots & \vdots \\
\phi(e_n, e_1) & \cdots & \phi(e_n, e_n)
\end{array} \right)
\left( \begin{array}{c}
y_1 \\
\vdots \\
y_n
\end{array} \right)
\end{align*}

例子3

这个

{ % jsfiddle 3h5A4/3 %}

神奇一些(说明markdown的bug,所以我在{和%之间加了空格,应该去掉)

例子4

这个也是

{ % gist 2436351 %}

显示为

例子5

更加神奇的

{ % gist 996818 %}

显示为

Comments