Skip to content

Commit 70e8ce2

Browse files
authored
Feature/readme (#83)
* Add formatter option * Fix cosmetic change * Fix typo * Fix can use relative template_path * Fix path should be absolute
1 parent 5522400 commit 70e8ce2

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

README.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,27 @@ If you want change default keymapping, set following to your `.vimrc`.
7272
7373
nmap <silent> <C-_> <Plug>(pydocstring)
7474
75+
Foramtter
76+
---------
77+
78+
You can set built-in formatter(Sphinx, Numpy, Google).
79+
80+
.. code::
81+
82+
leg g:pydocstring_formatter = 'numpy'
83+
84+
7585
Custom template
7686
---------------
7787

78-
You can set custom template
88+
You can set custom template. See `example <https://github.com/heavenshell/py-doq/tree/master/examples>`_.
89+
90+
Path should be absolute path.
7991

8092
.. code::
8193
8294
let g:pydocstring_template_path = '/path/to/custom/templates'
95+
let g:pydocstring_template_path = expand('~/path/to/custom/templates')
8396
8497
Exceptions
8598
----------
@@ -90,13 +103,13 @@ excptions add to docstring.
90103

91104
.. code::
92105
93-
def foo():
94-
"""Summary of foo.
106+
def foo():
107+
"""Summary of foo.
95108
96-
Raises:
97-
Exception:
98-
"""
99-
raise Exception('foo')
109+
Raises:
110+
Exception:
111+
"""
112+
raise Exception('foo')
100113
101114
Thanks
102115
------

autoload/pydocstring.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function! s:create_cmd(style, omissions) abort
122122
\ )
123123
endif
124124
if g:pydocstring_templates_path !=# ''
125-
let cmd = printf('%s --template_path=%s', cmd, g:pydocstring_templates_path)
125+
let cmd = printf('%s --template_path=%s', cmd, expand(g:pydocstring_templates_path))
126126
endif
127127

128128
return cmd

doc/pydocstring.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ pydocstring_formatter *g:pydocstring_formatter*
184184
'sphinx', 'google', 'numpy'
185185
Default value is 'sphinx'
186186

187-
g:pydocstring_templates_path *g:pydocstring_templates_dir*
188-
Path to your own template file.
187+
g:pydocstring_templates_path *g:pydocstring_templates_path*
188+
Absolute path to your own template file.
189189
Refer template/pydocstring/ about the default value.
190190

191191
g:pydocstring_doq_path *g:pydocstring_doq_path*
192-
Path to doq command.
192+
Absolute path to doq command.
193193
Default value is 'lib/doq'
194194

195195
g:pydocstring_enable_mapping *g:pydocstring_enable_mapping*

0 commit comments

Comments
 (0)