Skip to content

Commit 30fb2fc

Browse files
author
Lisa Julia Nebel
committed
Sort the docstrings before creating the documentation
1 parent a15cca6 commit 30fb2fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ def read_doc_strings(directive, docstrings_path):
88
print(docstrings_path)
99
with open(docstrings_path, 'r') as file:
1010
docstrings = json.load(file)
11+
sorted_docstrings = sorted(docstrings.items(), key=lambda item: item[1].get('signature', item[0]))
1112
result = []
12-
for name, item in docstrings.items():
13+
for name, item in sorted_docstrings:
1314
# Create a ViewList instance for the function signature and docstring
1415
rst = ViewList()
1516

0 commit comments

Comments
 (0)