Skip to content

Instantly share code, notes, and snippets.

@MaddyGuthridge
Last active September 8, 2022 05:29
Show Gist options
  • Save MaddyGuthridge/9d3a071f452b382c6777146634178a8e to your computer and use it in GitHub Desktop.
Save MaddyGuthridge/9d3a071f452b382c6777146634178a8e to your computer and use it in GitHub Desktop.
A docstring template based on Google's template, modified to read better with Markdown formatting
{{! Google Docstring Template }}
{{! Modified to be markdown-friendly}}
{{! Originally sourced from: https://github.com/NilsJPWerner/autoDocstring/blob/master/src/docstring/templates/google.mustache}}
{{summaryPlaceholder}}
{{extendedSummaryPlaceholder}}
{{#parametersExist}}
## Args:
{{#args}}
* `{{var}}` (`{{typePlaceholder}}`): {{descriptionPlaceholder}}
{{/args}}
{{#kwargs}}
* `{{var}}` (`{{typePlaceholder}}`, optional): {{descriptionPlaceholder}}. Defaults to `{{&default}}`.
{{/kwargs}}
{{/parametersExist}}
{{#exceptionsExist}}
## Raises:
{{#exceptions}}
* `{{type}}`: {{descriptionPlaceholder}}
{{/exceptions}}
{{/exceptionsExist}}
{{#returnsExist}}
## Returns:
{{#returns}}
* `{{typePlaceholder}}`: {{descriptionPlaceholder}}
{{/returns}}
{{/returnsExist}}
{{#yieldsExist}}
## Yields:
{{#yields}}
* `{{typePlaceholder}}`: {{descriptionPlaceholder}}
{{/yields}}
{{/yieldsExist}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment