Skip to content
Permalink
Browse files

BUG: Add return type annotations in text & pdf templates

What was left out in 4faccce
  • Loading branch information...
kernc committed May 1, 2019
1 parent 92c6a8a commit d6e7a6ea4457674b3f663b5e5a097f2c76b7643f
Showing with 12 additions and 2 deletions.
  1. +6 −1 pdoc/templates/pdf.mako
  2. +6 −1 pdoc/templates/text.mako
@@ -31,7 +31,12 @@ ${('#' * level) + ' ' + string + id}
</%def>

<%def name="funcdef(f)">
> `${f.funcdef()} ${f.name}(${', '.join(f.params(annotate=show_type_annotations))})`
<%
returns = show_type_annotations and f.return_annotation() or ''
if returns:
returns = ' -> ' + returns
%>
> `${f.funcdef()} ${f.name}(${', '.join(f.params(annotate=show_type_annotations))})${returns}`
</%def>

<%def name="classdef(c)">
@@ -12,7 +12,12 @@
</%def>

<%def name="function(func)" buffered="True">
`${func.name}(${", ".join(func.params())})`
<%
returns = show_type_annotations and f.return_annotation() or ''
if returns:
returns = ' -> ' + returns
%>
`${func.name}(${", ".join(func.params(annotate=show_type_annotations))})${returns}`
${func.docstring | deflist}
</%def>

0 comments on commit d6e7a6e

Please sign in to comment.
You can’t perform that action at this time.