33Post Syntax
44=============
55
6+ Catsup currently supports 3 types of post: :ref: `Markdown <post-markdown-syntax >`, :ref: `Text <post-text-syntax >` and :ref: `HTML <post-html-syntax >`.
7+
8+ .. _post-markdown-syntax :
9+
10+ Markdown Post
11+ --------------
12+
613Overview
7- -----------
14+ ~~~~~~~~~
815
9- A post 's extension should be either ``.md `` or ``.markdown `` .
16+ Post 's extension should be either ``.md `` or ``.markdown `` .
1017
1118A sample post looks like ::
1219
@@ -29,21 +36,80 @@ A sample post looks like ::
2936A post consists of three parts:
3037
3138+ Title
32- + Meta
39+ + :ref: ` Meta < post-meta >`
3340+ Content
3441
3542Title
36- --------
43+ ~~~~~~~~~~~~~~~~~~~~~~
3744
3845Title should always on the first line and starts with ``# ``
3946
47+ Content
48+ ~~~~~~~~~~~~~~~~~~~~~~
49+
50+ Everything below the separator is the content. Content should be written in Markdown.
51+
52+ Code Highlight
53+ ~~~~~~~~~~~~~~~~~~~~~~
54+
55+ Catsup supports GitHub's style code highlight, like this ::
56+
57+ ```python
58+ print("Hello World!")
59+ ```
60+
61+ .. _post-text-syntax :
62+
63+ Text Post
64+ --------------
65+
66+ Sometimes you may just want to write something without considering the syntax. Then you should use Text Post.
67+
68+ Text post's extension should be ``.txt `` .
69+
70+ The simplest text post looks like ::
71+
72+ Hello!
73+ This is a text post.
74+
75+ If you want to write meta in a text post, write the meta in YAML format ::
76+
77+ ---
78+ title: Hello, World!
79+ tags: Hello, World
80+ time: 2014-01-04 20:56
81+ ---
82+
83+ Hello, World! I'm a text post.
84+
85+
86+ .. _post-html-syntax :
87+
88+ HTML Post
89+ --------------
90+
91+ HTML post is like :ref: `Text <post-text-syntax >`, but you can use HTML in the content.
92+
93+ HTML post's extension should be ``.txt `` .
94+
95+ A HTML post looks like ::
96+
97+ ---
98+ title: Hello, World!
99+ tags: Hello, World
100+ time: 2014-01-04 20:56
101+ ---
102+
103+ <p>I'm writing HTML in catsup</p>
104+
105+
40106.. _post-meta :
41107
42108Meta
43- -------
44-
45- Meta is some information about the post. It's below title and above the separator.
109+ --------
46110
111+ Meta is some information about the post.
112+ Note that meta is optional, and if your post have meta, remember to put a :ref: `separator <post-separator >` below the meta.
47113
48114+ time: When the post is written. like ``2013-08-25 11:10 ``
49115+ tags: Tags of the post. Separated by comma, like ``Python, Program ``
@@ -52,8 +118,10 @@ Meta is some information about the post. It's below title and above the separato
52118+ comment: Set to ``disabled `` to forbid comment
53119+ permalink: Permalink to the post, link ``/this-post ``
54120
121+ .. _post-separator :
122+
55123The separator
56- ---------------
124+ ----------------
57125
58126The separator separates meta and content. It should be at least *three * ``- `` ::
59127
@@ -63,21 +131,6 @@ It's okay to make it longer ::
63131
64132 ----------------
65133
66- Content
67- -----------
68-
69- Everything below the separator is the content. Content should be written in Markdown.
70-
71- Code Highlight
72- -----------------
73-
74- Catsup supports GitHub's style code highlight, like this ::
75-
76- ```python
77- print("Hello World!")
78- ```
79-
80-
81134Page
82135--------
83136
0 commit comments