From: Vladimír Vondruš Date: Sat, 13 Jul 2019 15:52:16 +0000 (+0200) Subject: documentation/python: doc++ X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=c8fdf0aba92325767e244819720f97b9ea64fa3f;p=blog.git documentation/python: doc++ --- diff --git a/documentation/python.py b/documentation/python.py index 2e0362bc..b62e1315 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -847,7 +847,7 @@ def extract_function_doc(state: State, parent, path: List[str], function) -> Lis # TODO: external summary for functions out.summary = summary - # Don't show None return type for void functions + # Don't show None return type for functions w/o a return out.type = None if type == 'None' else type if out.type: out.type = make_name_link(state, path, out.type) @@ -1372,6 +1372,8 @@ def run(basedir, config, templates): if urllib.parse.urlparse(path).netloc: return path path = [path] entry = state.name_map['.'.join(path)] + # TODO: this will blow up if linking to something that's not a module, + # class or a page return state.config['URL_FORMATTER'](entry.type, entry.path)[1] env.filters['basename_or_url'] = basename_or_url