Merge pull request #715 from protream/master
Python: add a snippet to generate pocoo style module doc string
This commit is contained in:
commit
f98b1c09ac
@ -245,6 +245,9 @@ def write_function_docstring(t, snip):
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += triple_quotes(snip)
|
||||
|
||||
def get_dir_and_file_name(snip):
|
||||
return os.getcwd().split('/')[-1] + '.' + snip.basename
|
||||
|
||||
endglobal
|
||||
|
||||
########################################
|
||||
@ -687,4 +690,18 @@ ${1:${VISUAL:doc}}
|
||||
`!p snip.rv = triple_quotes(snip)`
|
||||
endsnippet
|
||||
|
||||
snippet pmdoc "pocoo style module doc string" 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:
|
||||
|
Loading…
Reference in New Issue
Block a user