Skip to content
Permalink
Browse files

feat: 增加帮助页,调整日志位置

  • Loading branch information...
douo committed Feb 13, 2019
1 parent aab3d52 commit 372034a68259806e5cb500d173109dc415ca79eb
Showing with 291 additions and 18 deletions.
  1. +6 −8 _assets/javascripts/index.js
  2. +7 −0 _config.yml
  3. +267 −0 _pages/help.md
  4. +11 −10 {_notes → _pages}/log.md
@@ -7,13 +7,11 @@ import Pretty from './pretty';
import mermaid from 'mermaid';

mermaid.initialize({
// theme: 'forest',
gantt: { axisFormatter: [
['%Y-%m-%d', (d) => {
return d.getDay() === 1
}]
] }
})
// theme: 'forest',
gantt: {
axisFormatter: [['%Y-%m-%d', d => d.getDay() === 1]]
}
});

// Detect touch screen and enable scrollbar if necessary
function isTouchDevice() {
@@ -123,7 +121,7 @@ function processArticleImg() {
}

$(document).ready(() => {
// mermaid.initialize();
// mermaid.initialize();
processArticleImg();
initScoll();
initFab();
@@ -102,10 +102,17 @@ nav :
- title: tags
url: /tags
describe: 标签
- title: log
url: /log
describe: 日志
- title: help
url: /help
describe: 帮助
- title: about
url: /about
describe: 关于


links:
- title: MAGICALBOY
url: https://magicalboy.com/
@@ -0,0 +1,267 @@
---
title: 帮助
permalink: /help/
layout: page
math : true
graphviz : true
---

## Markdown

基于 [kramdown](https://kramdown.gettalong.org/syntax.html)。同时支持 [Liquid](https://jekyllrb.com/docs/liquid/) 模板语言进行扩展


### Math

math 基于 mathjax,启用 mathjax 脚本,需要在 Front Matter 加入:

```
---
...
math: true
---
```

####

`$$` 包围的块:

```
$$
\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*}
$$
```

$$
\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*}
$$

#### 行内

```
The following is a math block:
$$ 5 + 5 $$
But next comes a paragraph with an inline math statement: $$ 5 + 5 $$
This is block: \$$ 5 + 5 $$
This is block: \$\$ 5 + 5 $$
```
The following is a math block:

$$ 5 + 5 $$

But next comes a paragraph with an inline math statement: $$ 5 + 5 $$

This is block: \$$ 5 + 5 $$

This is block: \$\$ 5 + 5 $$

#### FIX:表格

强制 Kramdown 把 `|` 开头的行才作为表格处理,相关讨论 https://github.com/gettalong/kramdown/issues/151

## Liquid

### 标签逃逸

```
{% raw %}用 {% raw %} 标签{% endraw %}
```

### Graphviz


要支持 [graphviz](https://www.graphviz.org/documentation/) 需要在 Front Matter 加入

```
---
...
graphviz: true
---
```

```
{% raw %}{% graphviz %}
digraph G {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0 -> a1 -> a2 -> a3;
label = "process #1";
}
subgraph cluster_1 {
node [style=filled];
b0 -> b1 -> b2 -> b3;
label = "process #2";
color=blue
}
start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> end;
start [shape=Mdiamond];
end [shape=Msquare];
}
{% endgraphviz %}{% endraw %}
```

{% graphviz %}
digraph G {

subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0 -> a1 -> a2 -> a3;
label = "process #1";
}

subgraph cluster_1 {
node [style=filled];
b0 -> b1 -> b2 -> b3;
label = "process #2";
color=blue
}
start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> end;

start [shape=Mdiamond];
end [shape=Msquare];
}
{% endgraphviz %}



### Mermaid

[Mermaid](https://mermaidjs.github.io/) 与 graphviz 有一定的重复,默认启用无需 Front Matter。

```
{% raw %}{% mermaid %}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
click A "http://google.com" "This is a link"
click B "http://google.com" "This is a link"
click C "http://google.com" "This is a link"
click D "http://google.com" "This is a link"
{% endmermaid %}
{% mermaid %}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{% endmermaid %}
{% mermaid %}
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
another task : 24d
{% endmermaid %}{% endraw %}
```

{% mermaid %}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;

click A "http://google.com" "This is a link"
click B "http://google.com" "This is a link"
click C "http://google.com" "This is a link"
click D "http://google.com" "This is a link"
{% endmermaid %}


{% mermaid %}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{% endmermaid %}

{% mermaid %}
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
another task : 24d
{% endmermaid %}
@@ -1,19 +1,18 @@
---
title: '站点日志'
date: '2012-10-23'
permalink: /log/
layout: page
description:
---

这里只记录一些比较大的改动和想法,更详细的记录请查看[这里](https://github.com/douo/douo.ruhoh.com/commits/master)和[这里](https://github.com/douo/ruhoh.rb/commits/2.0plus)
这里只记录一些比较大的改动和想法,更详细的记录请查看[这里](https://github.com/douo/douo.github.com/commits/develop)

### TODO


#### 博客

- Material Design
- 使用 html 的简化模板 haml>slim(支持haml似乎更好)
- 利用 staticfile.org 为 js/css 资源做加速,参考[Asset Pipeline][1]
- 用 [swiftype][2] 做站内搜索,分为 posts 和 notes,设计 schema

#### 筆記
@@ -22,15 +21,17 @@ description:
- 反向链接
- 看看能不能利用 Evernote api ,把笔记输出到 evernote 中

#### Ruhoh
[1]: https://swiftype.com/

### 2019-02-13

ruhoh commit resources [message] #提交 resources 的变更到本地仓库 ex: git add -A :/notes ; git commit -m 'update notes'
ruhoh sync # 同步代码到远程仓库,未提交到本地仓库的则自动提交
ruhoh publish # 发布,需远程仓库hook支持
支持 mermaid

### 2018-01-02

[1]: http://ruhoh.com/docs/2/asset-pipeline/
[2]: https://swiftype.com/
用 Jekyll 重新实现,见 [新年新博客](/2018/01/02/new-year-new-blog/)

### 2015-04-10

### 2015-04-10

0 comments on commit 372034a

Please sign in to comment.
You can’t perform that action at this time.