Created
November 19, 2020 19:50
-
-
Save thmsklngr/e17acb43583120370fd14a89775c3b4a to your computer and use it in GitHub Desktop.
VSCode autodocstring template with alternative (and easy to read) syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{! Template according https://dorukkilitcioglu.com/2018/08/18/python-better-docstring.html }} | |
{{! Doruk Docstring Template }} | |
{{summaryPlaceholder}} | |
{{extendedSummaryPlaceholder}} | |
{{#argsExist}} | |
Args: | |
{{#args}} | |
{{&var}}::{{&typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/args}} | |
{{/argsExist}} | |
{{#kwargsExist}} | |
Keyword args: | |
{{#kwargs}} | |
{{var}}::{{typePlaceholder}}(={{&default}}) | |
{{descriptionPlaceholder}} | |
{{/kwargs}} | |
{{/kwargsExist}} | |
{{#returnsExist}} | |
Returns: | |
{{#returns}} | |
{{typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/returns}} | |
{{/returnsExist}} | |
{{#yieldsExist}} | |
Yields: | |
{{#yields}} | |
{{typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/yields}} | |
{{/yieldsExist}} | |
{{#exceptionsExist}} | |
Raises: | |
{{#exceptions}} | |
{{type}} | |
{{descriptionPlaceholder}} | |
{{/exceptions}} | |
{{/exceptionsExist}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created this mustache template for using it with Python Docstring Generator.
Just copy it to any directory and edit your settings.json: