From b2dbd2ac4bf9dacad3583b40765e3e88f9b75ecf Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Fri, 31 May 2013 09:45:28 +0800 Subject: [PATCH 1/4] add CJK support --- snippets/rst.snippets | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snippets/rst.snippets b/snippets/rst.snippets index 97845de..46405f7 100644 --- a/snippets/rst.snippets +++ b/snippets/rst.snippets @@ -19,4 +19,10 @@ snippet - ${3} snippet cont: .. contents:: - + +# CJK optimize, CJK has no space between charaters +snippet *c + \ *${1:Emphasis}*\ +snippet **c + \ **${1:Strong emphasis}**\ + From b6074fab15ac8cdaa44cef8eaf313e86dff1346c Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Fri, 31 May 2013 11:06:43 +0800 Subject: [PATCH 2/4] add some directives --- snippets/rst.snippets | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/snippets/rst.snippets b/snippets/rst.snippets index 46405f7..b99f6d4 100644 --- a/snippets/rst.snippets +++ b/snippets/rst.snippets @@ -3,9 +3,9 @@ snippet : :${1:field name}: ${2:field body} snippet * - *${1:Emphasis}* + *${1:Emphasis}* ${2} snippet ** - **${1:Strong emphasis}** + **${1:Strong emphasis}** ${2} snippet _ \`${1:hyperlink-name}\`_ .. _\`$1\`: ${2:link-block} @@ -17,12 +17,45 @@ snippet - ${1:Title} -----${2:-} ${3} +#some directive +snippet img: + .. |${2:alias}| image:: ${1:img} snippet cont: .. contents:: - + ${1:content} +snippet code: + .. code:: ${1:type} + ${2:write some code} +snippet tip: + .. tip:: + ${1:my tips} +snippet not: + .. note:: + ${1:my notes} +snippet war: + .. warning:: + ${1:attention!} +snippet imp: + .. important:: + ${1:this is importatnt} +snippet att: + .. attention:: + ${1:hey!} +snippet dan: + .. danger:: + ${1:ah!} +snippet err: + .. error:: + ${1:Error occur} +snippet cau: + .. caution:: + ${1:Watch out!} +snippet sid: + .. sidebar:: ${1:Title} + # CJK optimize, CJK has no space between charaters snippet *c - \ *${1:Emphasis}*\ + \ *${1:Emphasis}*\ ${2} snippet **c - \ **${1:Strong emphasis}**\ + \ **${1:Strong emphasis}**\ ${2} From 12e4eab2a7f76a0ec48cc18b52c958f2ef5de222 Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Fri, 31 May 2013 11:12:17 +0800 Subject: [PATCH 3/4] fix code section failed --- snippets/rst.snippets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/rst.snippets b/snippets/rst.snippets index b99f6d4..ca0c155 100644 --- a/snippets/rst.snippets +++ b/snippets/rst.snippets @@ -25,6 +25,7 @@ snippet cont: ${1:content} snippet code: .. code:: ${1:type} + ${2:write some code} snippet tip: .. tip:: @@ -50,9 +51,11 @@ snippet err: snippet cau: .. caution:: ${1:Watch out!} +#Spinx only snippet sid: .. sidebar:: ${1:Title} - + + ${2} # CJK optimize, CJK has no space between charaters snippet *c \ *${1:Emphasis}*\ ${2} From 20d65b0617b4580f19f15c6e22b82b55888454d0 Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Fri, 31 May 2013 11:18:29 +0800 Subject: [PATCH 4/4] add figure --- snippets/rst.snippets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/rst.snippets b/snippets/rst.snippets index ca0c155..d97fa57 100644 --- a/snippets/rst.snippets +++ b/snippets/rst.snippets @@ -20,6 +20,11 @@ snippet - #some directive snippet img: .. |${2:alias}| image:: ${1:img} +snippet fig: + .. figure:: ${1:img} + :alt: ${2:alter text} + + $2 snippet cont: .. contents:: ${1:content}