Mercurial > libervia-backend
comparison doc/_ext/docstring.py @ 3605:62e81b1058f8
doc: activate `autodoc` extension + extension to adapt Libervia docstring style to autodoc
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 29 Jul 2021 22:51:01 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3604:80815f2f12cf | 3605:62e81b1058f8 |
---|---|
1 #!/usr/bin/env python3 | |
2 | |
3 """Adapt Libervia docstring style to autodoc""" | |
4 | |
5 | |
6 def process_docstring(app, what, name, obj, options, lines): | |
7 lines[:] = [ | |
8 l.replace("@param", ":param").replace("@raise", ":raises") | |
9 for l in lines | |
10 ] | |
11 | |
12 | |
13 def setup(app): | |
14 app.connect("autodoc-process-docstring", process_docstring) | |
15 return { | |
16 'version': '0.1', | |
17 'parallel_read_safe': True, | |
18 'parallel_write_safe': True, | |
19 } |