Skip to content

Commit 12db73a

Browse files
authored
Merge pull request #9 from lisajulia/feature/sort-docstrings
Sort the docstrings before creating the documentation
2 parents 892f35c + 30fb2fc commit 12db73a

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

+2-1
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)