From fe599f21c6b93b0d96f0b4f56998994a624468c3 Mon Sep 17 00:00:00 2001 From: Rohan Batra <116573125+rohanbatrain@users.noreply.github.com> Date: Wed, 26 Nov 2025 12:54:09 +0530 Subject: [PATCH 1/2] chore: update sbd-mkdocs submodule and add docs generation script --- scripts/generate_docs_structure.py | 76 ++++++++++++++++++++++++++++++ submodules/sbd-mkdocs | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 scripts/generate_docs_structure.py diff --git a/scripts/generate_docs_structure.py b/scripts/generate_docs_structure.py new file mode 100644 index 0000000..ddffc1b --- /dev/null +++ b/scripts/generate_docs_structure.py @@ -0,0 +1,76 @@ +import os + +BASE_DOCS_DIR = "submodules/sbd-mkdocs/docs" + +MODULES = { + "micro-frontends": [ + "blog-platform", + "chat", + "digital-shop", + "family-hub", + "ipam", + "landing-page", + "memex", + "myaccount", + "raunak-ai", + "university-clubs-platform", + ], + "integrations": [ + "n8n", + ], + "backend": [ + "." # Root of backend + ] +} + +SECTIONS = ["users", "developers", "maintainers"] + +TEMPLATES = { + "users": { + "index.md": "# {module_name} - User Guide\n\nWelcome to the user guide for {module_name}.\n\n## Getting Started\n\nCheck out the [Getting Started](getting-started.md) guide.", + "getting-started.md": "# Getting Started with {module_name}\n\nStep-by-step guide to get started with {module_name}." + }, + "developers": { + "index.md": "# {module_name} - Developer Guide\n\nWelcome to the developer guide for {module_name}.\n\n## Topics\n\n- [Setup](setup.md)\n- [Architecture](architecture.md)", + "setup.md": "# Local Development Setup\n\nHow to set up {module_name} locally.", + "architecture.md": "# Architecture of {module_name}\n\nTechnical design and architecture details." + }, + "maintainers": { + "index.md": "# {module_name} - Maintenance Guide\n\nWelcome to the maintenance guide for {module_name}.\n\n## Topics\n\n- [Deployment](deployment.md)", + "deployment.md": "# Deploying {module_name}\n\nInstructions for deploying {module_name}." + } +} + +def create_structure(): + for category, modules in MODULES.items(): + for module in modules: + if module == ".": + module_path = os.path.join(BASE_DOCS_DIR, category) + module_name = "Second Brain Database Backend" + else: + module_path = os.path.join(BASE_DOCS_DIR, category, module) + module_name = module.replace("-", " ").title() + + print(f"Processing {module_name} at {module_path}") + os.makedirs(module_path, exist_ok=True) + + # Create root index if missing + if not os.path.exists(os.path.join(module_path, "index.md")): + with open(os.path.join(module_path, "index.md"), "w") as f: + f.write(f"# {module_name}\n\nOverview of {module_name}.\n") + + for section in SECTIONS: + section_path = os.path.join(module_path, section) + os.makedirs(section_path, exist_ok=True) + + for filename, content in TEMPLATES[section].items(): + file_path = os.path.join(section_path, filename) + if not os.path.exists(file_path): + with open(file_path, "w") as f: + f.write(content.format(module_name=module_name)) + print(f" Created {file_path}") + else: + print(f" Skipped {file_path} (exists)") + +if __name__ == "__main__": + create_structure() diff --git a/submodules/sbd-mkdocs b/submodules/sbd-mkdocs index bfb8d21..a064a19 160000 --- a/submodules/sbd-mkdocs +++ b/submodules/sbd-mkdocs @@ -1 +1 @@ -Subproject commit bfb8d21528ff0b3b9adc782e1d4a420de846347c +Subproject commit a064a1921c1fb8461470775e4867e42a9054a483 From 377d6591f6d01d11cb4c8c6251dba8b96d4223ec Mon Sep 17 00:00:00 2001 From: Rohan Batra <116573125+rohanbatrain@users.noreply.github.com> Date: Wed, 26 Nov 2025 12:56:42 +0530 Subject: [PATCH 2/2] chore: move docs script to submodule --- scripts/generate_docs_structure.py | 76 ------------------------------ submodules/sbd-mkdocs | 2 +- 2 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 scripts/generate_docs_structure.py diff --git a/scripts/generate_docs_structure.py b/scripts/generate_docs_structure.py deleted file mode 100644 index ddffc1b..0000000 --- a/scripts/generate_docs_structure.py +++ /dev/null @@ -1,76 +0,0 @@ -import os - -BASE_DOCS_DIR = "submodules/sbd-mkdocs/docs" - -MODULES = { - "micro-frontends": [ - "blog-platform", - "chat", - "digital-shop", - "family-hub", - "ipam", - "landing-page", - "memex", - "myaccount", - "raunak-ai", - "university-clubs-platform", - ], - "integrations": [ - "n8n", - ], - "backend": [ - "." # Root of backend - ] -} - -SECTIONS = ["users", "developers", "maintainers"] - -TEMPLATES = { - "users": { - "index.md": "# {module_name} - User Guide\n\nWelcome to the user guide for {module_name}.\n\n## Getting Started\n\nCheck out the [Getting Started](getting-started.md) guide.", - "getting-started.md": "# Getting Started with {module_name}\n\nStep-by-step guide to get started with {module_name}." - }, - "developers": { - "index.md": "# {module_name} - Developer Guide\n\nWelcome to the developer guide for {module_name}.\n\n## Topics\n\n- [Setup](setup.md)\n- [Architecture](architecture.md)", - "setup.md": "# Local Development Setup\n\nHow to set up {module_name} locally.", - "architecture.md": "# Architecture of {module_name}\n\nTechnical design and architecture details." - }, - "maintainers": { - "index.md": "# {module_name} - Maintenance Guide\n\nWelcome to the maintenance guide for {module_name}.\n\n## Topics\n\n- [Deployment](deployment.md)", - "deployment.md": "# Deploying {module_name}\n\nInstructions for deploying {module_name}." - } -} - -def create_structure(): - for category, modules in MODULES.items(): - for module in modules: - if module == ".": - module_path = os.path.join(BASE_DOCS_DIR, category) - module_name = "Second Brain Database Backend" - else: - module_path = os.path.join(BASE_DOCS_DIR, category, module) - module_name = module.replace("-", " ").title() - - print(f"Processing {module_name} at {module_path}") - os.makedirs(module_path, exist_ok=True) - - # Create root index if missing - if not os.path.exists(os.path.join(module_path, "index.md")): - with open(os.path.join(module_path, "index.md"), "w") as f: - f.write(f"# {module_name}\n\nOverview of {module_name}.\n") - - for section in SECTIONS: - section_path = os.path.join(module_path, section) - os.makedirs(section_path, exist_ok=True) - - for filename, content in TEMPLATES[section].items(): - file_path = os.path.join(section_path, filename) - if not os.path.exists(file_path): - with open(file_path, "w") as f: - f.write(content.format(module_name=module_name)) - print(f" Created {file_path}") - else: - print(f" Skipped {file_path} (exists)") - -if __name__ == "__main__": - create_structure() diff --git a/submodules/sbd-mkdocs b/submodules/sbd-mkdocs index a064a19..80b663d 160000 --- a/submodules/sbd-mkdocs +++ b/submodules/sbd-mkdocs @@ -1 +1 @@ -Subproject commit a064a1921c1fb8461470775e4867e42a9054a483 +Subproject commit 80b663d51b6f97ed80f4bc09d3c609e84c183365