Skip to content

Commit 8b4e3fe

Browse files
committed
v2.0.1
1 parent 360b14c commit 8b4e3fe

3 files changed

Lines changed: 29 additions & 26 deletions

File tree

generate_mkdocs.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,37 +89,38 @@ def generate_api_docs(root_folder: str, output_folder: str, index_file: str, mkd
8989

9090
# Process tutorials folder only if no existing Tutorials nav found
9191
tutorials_folder = 'tutorials'
92-
if existing_tutorials_nav is None and os.path.exists(tutorials_folder):
92+
if os.path.exists(tutorials_folder):
9393
# Copy tutorials folder to docs
9494
tutorials_output = os.path.join(output_folder, 'tutorials')
9595
if os.path.exists(tutorials_output):
9696
shutil.rmtree(tutorials_output)
9797
shutil.copytree(tutorials_folder, tutorials_output)
98-
99-
# Build tutorials navigation structure
100-
for root, dirs, files in os.walk(tutorials_folder):
101-
relative_root = os.path.relpath(root, tutorials_folder)
102-
for file in files:
103-
if file.endswith('.md'):
104-
file_path = os.path.join(root, file)
105-
relative_path = os.path.relpath(file_path, tutorials_folder)
106-
output_path = os.path.join('tutorials', relative_path).replace('\\', '/')
107-
108-
# Build nested structure
109-
current_nav = tutorials_structure
110-
parts = relative_path.split(os.sep)
111-
112-
# Handle nested directories
113-
for part in parts[:-1]: # All parts except the filename
114-
if part:
115-
current_nav = current_nav.setdefault(part, {})
116-
117-
# Add the markdown file
118-
file_name_without_ext = os.path.splitext(parts[-1])[0]
119-
if isinstance(current_nav, dict):
120-
current_nav[file_name_without_ext] = output_path
121-
else:
122-
current_nav = {file_name_without_ext: output_path}
98+
99+
# Build tutorials navigation structure only if no existing Tutorials nav found
100+
if existing_tutorials_nav is None:
101+
for root, dirs, files in os.walk(tutorials_folder):
102+
relative_root = os.path.relpath(root, tutorials_folder)
103+
for file in files:
104+
if file.endswith('.md'):
105+
file_path = os.path.join(root, file)
106+
relative_path = os.path.relpath(file_path, tutorials_folder)
107+
output_path = os.path.join('tutorials', relative_path).replace('\\', '/')
108+
109+
# Build nested structure
110+
current_nav = tutorials_structure
111+
parts = relative_path.split(os.sep)
112+
113+
# Handle nested directories
114+
for part in parts[:-1]: # All parts except the filename
115+
if part:
116+
current_nav = current_nav.setdefault(part, {})
117+
118+
# Add the markdown file
119+
file_name_without_ext = os.path.splitext(parts[-1])[0]
120+
if isinstance(current_nav, dict):
121+
current_nav[file_name_without_ext] = output_path
122+
else:
123+
current_nav = {file_name_without_ext: output_path}
123124

124125
# Copy assets folder if exists
125126
if os.path.exists(ex_assets_folder):

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ license = {file = "LICENSE"}
1515
requires-python = ">=3.6"
1616
dependencies = [
1717
"numpy",
18+
"numba",
1819
"scipy",
1920
"matplotlib",
2021
"osqp",

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
numpy # >=1.26.3
2+
numba # >=0.65.1
23
scipy # >=1.11.4
34
matplotlib # >=3.10.6
45
cvxopt # >=1.3.2

0 commit comments

Comments
 (0)