From 30fb2fcf703a2e1285349a2be7e2f24980b1767a Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel Date: Thu, 9 Jan 2025 07:56:39 +0100 Subject: [PATCH] Sort the docstrings before creating the documentation --- .../sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py b/python/sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py index 32418f1..7b1cfd0 100644 --- a/python/sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py +++ b/python/sphinx_docs/src/opm_python_docs/sphinx_ext_docstrings.py @@ -8,8 +8,9 @@ def read_doc_strings(directive, docstrings_path): print(docstrings_path) with open(docstrings_path, 'r') as file: docstrings = json.load(file) + sorted_docstrings = sorted(docstrings.items(), key=lambda item: item[1].get('signature', item[0])) result = [] - for name, item in docstrings.items(): + for name, item in sorted_docstrings: # Create a ViewList instance for the function signature and docstring rst = ViewList()