Python: add a snippet to generate pocoo style module doc string
This commit is contained in:
parent
e055cf9a71
commit
3532786cd0
@ -245,6 +245,9 @@ def write_function_docstring(t, snip):
|
|||||||
snip.rv += '\n' + snip.mkline('', indent='')
|
snip.rv += '\n' + snip.mkline('', indent='')
|
||||||
snip += triple_quotes(snip)
|
snip += triple_quotes(snip)
|
||||||
|
|
||||||
|
def get_dir_and_file_name(snip):
|
||||||
|
return os.getcwd().split('/')[-1] + '.' + snip.basename
|
||||||
|
|
||||||
endglobal
|
endglobal
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@ -687,4 +690,18 @@ ${1:${VISUAL:doc}}
|
|||||||
`!p snip.rv = triple_quotes(snip)`
|
`!p snip.rv = triple_quotes(snip)`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet pmdoc "pocoo style module doc sting" b
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
`!p snip.rv = get_dir_and_file_name(snip)`
|
||||||
|
`!p snip.rv = '~' * len(get_dir_and_file_name(snip))`
|
||||||
|
|
||||||
|
${1:YOURDOCSTRING}
|
||||||
|
|
||||||
|
:copyright: (c) `date +Y%` by ${2:YOURNAME}.
|
||||||
|
:license: ${3:YOURLICENSE}, see LICENSE for more details.
|
||||||
|
"""
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
# vim:ft=snippets:
|
# vim:ft=snippets:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user