diff --git a/.gitignore b/.gitignore index 69d7cde35e..c32cc5b341 100755 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ docs/source/_images/Scenarios/* docs/source/breathe.data docs/source/externalTools/* docs/source/examples/* +docs/source/supportData.rst src/tests/scenarios/data bsk-dev-env/ bin/ diff --git a/docs/source/conf.py b/docs/source/conf.py index bc22116909..c926831090 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,6 +18,73 @@ import numpy as np +# +# create RST showing supportData folder information +# +folder_path = "../../supportData" +output_file = "supportData.rst" +# Files to exclude +excluded_files = {".DS_Store", "__init__.py"} +# loop over supportData folder and list all files + +# Dictionary to store files grouped by folder +folder_files = {} + +# Collect files grouped by folder +for root, dirs, files in os.walk(folder_path): + # Get the relative folder path + folder_relative_path = os.path.relpath(root, folder_path) + if folder_relative_path == ".": + folder_relative_path = "" + + # Collect files for this folder + folder_files[folder_relative_path] = sorted( + [file_name for file_name in files if file_name not in excluded_files] + ) + +with open(output_file, "w") as f: + f.write("Support Data Files\n") + f.write("==================\n\n") + f.write(".. note::\n\n") + f.write(" This folder contains a listing of all the data files in the folder ``basilisk/supportData`` " + "that are packaged into Basilisk.\n\n") + + # Sort folders alphabetically and write each section + for folder in sorted(folder_files.keys()): + f.write(f"**{folder}**\n\n") + for file_name in folder_files[folder]: + f.write(f"- {file_name}\n") + f.write("\n") + + # for root, dirs, files in os.walk(folder_path): + # # Get the relative folder path + # folder_relative_path = os.path.relpath(root, folder_path) + # if folder_relative_path == ".": + # folder_relative_path = "" + # + # # Write folder name as a section + # f.write(f"**{folder_relative_path}**\n\n") + # + # # Process files in the current directory + # for file_name in sorted(files): + # if file_name not in excluded_files: + # f.write(f"- {file_name}\n") + # f.write("\n") + + # for root, dirs, files in os.walk(folder_path): + # # Write the current folder name as a heading + # folder_relative_path = os.path.relpath(root, folder_path) + # if folder_relative_path == ".": + # folder_relative_path = "" + # f.write(f"**{folder_relative_path}**\n\n") + # + # # Process files in the current directory + # for file_name in files: + # if file_name not in excluded_files: + # f.write(f"- {file_name}\n") + # f.write("\n") + + # -- Project information ----------------------------------------------------- now = datetime.datetime.now() @@ -502,6 +569,7 @@ def run(self, srcDir): # breathe_projects_source = fileCrawler.run(officialSrc+"/simulation/vizard") # breathe_projects_source = fileCrawler.run(officialSrc+"/architecture") breathe_projects_source = fileCrawler.run("../../examples") + # breathe_projects_source = fileCrawler.run("../../supportData") # breathe_projects_source = fileCrawler.run("../../externalTools") with open("breathe.data", 'wb') as f: pickle.dump(breathe_projects_source, f) diff --git a/docs/source/index.rst b/docs/source/index.rst index 1b9b04cc7d..f060c950ac 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -200,6 +200,7 @@ Related Publications Learn Support Documentation/index + supportData ExternalSites .. toctree::