commit f1d41a0c7e30c0be846a6d2f24bcdaf2a861e02e
parent 800581a0c2460c73a8341e3cc1fdab8dc6dae3e7
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Fri, 10 Oct 2025 20:41:24 +0530
docs for site
Diffstat:
4 files changed, 142 insertions(+), 124 deletions(-)
diff --git a/.github/workflows/generate-and-deploy.yml b/.github/workflows/generate-and-deploy.yml
@@ -0,0 +1,44 @@
+name: Generate Index and Deploy to GitHub Pages
+
+# Run this workflow on pushes to the 'main' branch
+on:
+ push:
+ branches:
+ - main
+
+# Permissions needed for the workflow to deploy to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+jobs:
+ build-and-deploy:
+ runs-on: ubuntu-latest
+ steps:
+ # Step 1: Check out a copy of your repository
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Step 2: Set up the Python environment
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.10'
+
+ # Step 3: Run the Python script to generate the index.html file
+ - name: Generate index.html
+ run: python docs/generate_index.py
+
+ # Step 4: Prepare the 'docs' folder for deployment
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ # Tell GitHub Pages to use the 'docs' folder as the website root
+ path: './docs'
+
+ # Step 5: Deploy the contents of the 'docs' folder to your site
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
+
diff --git a/docs/generate_index.py b/docs/generate_index.py
@@ -0,0 +1,62 @@
+import os
+
+# --- Configuration ---
+REPO_URL = "https://github.com/notamitgamer/bsc"
+EXCLUDED_DIRS = ['.git', '.github', 'MinGW64', 'print']
+EXCLUDED_FILES = ['generate_index.py', 'template.html', 'index.html', 'README.md', 'CODE_OF_CONDUCT.md', 'CONTRIBUTING.md',
+ 'LICENSE', 'main.js', 'package.json', 'SECURITY.md', 'server.js']
+# --- End Configuration ---
+
+def generate_file_list():
+ """Walks the repo and generates an HTML list of its files and directories."""
+ html_list = ""
+
+ # SVG Icons
+ folder_icon = '<svg class="w-6 h-6 text-blue-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg>'
+ file_icon = '<svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>'
+
+ items = []
+ for root, dirs, files in os.walk('.', topdown=True):
+ # Exclude specified directories
+ dirs[:] = [d for d in dirs if d not in EXCLUDED_DIRS]
+
+ # Process at the root level only for this simple example
+ if root == '.':
+ # Sort directories and files
+ dirs.sort()
+ files.sort()
+
+ # Add directories to the list
+ for dirname in dirs:
+ url = f"{REPO_URL}/tree/main/{dirname.replace(' ', '%20')}"
+ items.append(f'<li><a href="{url}" target="_blank" class="flex items-center p-4 bg-gray-100 hover:bg-blue-100 rounded-lg transition-colors duration-200">{folder_icon}<span class="font-medium text-gray-800">{dirname}</span><span class="ml-auto text-blue-500 font-semibold text-sm">View on GitHub →</span></a></li>')
+
+ # Add files to the list
+ for filename in files:
+ if filename not in EXCLUDED_FILES:
+ url = f"{REPO_URL}/blob/main/{filename.replace(' ', '%20')}"
+ items.append(f'<li><a href="{url}" target="_blank" class="flex items-center p-4 bg-gray-100 hover:bg-green-100 rounded-lg transition-colors duration-200">{file_icon}<span class="font-medium text-gray-800">{filename}</span><span class="ml-auto text-green-500 font-semibold text-sm">View on GitHub →</span></a></li>')
+
+ # Since we only want top-level, we break after the first iteration
+ break
+
+ return "\n".join(items)
+
+
+def main():
+ """Main function to generate the index.html file."""
+ with open('template.html', 'r') as f:
+ template = f.read()
+
+ file_list_html = generate_file_list()
+
+ # Replace the placeholder in the template with the generated list
+ final_html = template.replace('<!--FILE_LIST_PLACEHOLDER-->', file_list_html)
+
+ with open('index.html', 'w') as f:
+ f.write(final_html)
+
+ print("index.html generated successfully.")
+
+if __name__ == "__main__":
+ main()
diff --git a/docs/index.html b/docs/index.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>BSc Repository File Index</title>
+ <script src="https://cdn.tailwindcss.com"></script>
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
+ <style>
+ body {
+ font-family: 'Inter', sans-serif;
+ }
+ </style>
+</head>
+<body class="bg-gray-50">
+ <div class="container mx-auto px-4 py-8 md:py-16">
+ <div class="max-w-4xl mx-auto bg-white rounded-2xl shadow-lg overflow-hidden">
+ <div class="p-8">
+ <div class="text-center mb-8">
+ <h1 class="text-3xl md:text-4xl font-bold text-gray-800">BSc Repository Contents</h1>
+ <p class="text-gray-500 mt-2">A quick navigation guide to the files in the repository. This list is auto-generated.</p>
+ </div>
+ <div class="space-y-4">
+ <h2 class="text-lg font-semibold text-gray-700 border-b pb-2">Files and Folders</h2>
+ <ul class="space-y-3">
+ <!--FILE_LIST_PLACEHOLDER-->
+ </ul>
+ </div>
+ </div>
+ <footer class="text-center py-4 bg-gray-100 border-t">
+ <p class="text-sm text-gray-500">This page is an index for the <a href="https://github.com/notamitgamer/bsc" class="text-blue-600 hover:underline">bsc repository</a>.</p>
+ </footer>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/docs/index.md b/docs/index.md
@@ -1,123 +0,0 @@
-## License
-This project is licensed under the MIT License – see the [LICENSE](LICENSE) file for details.
-
----
-
-# 🎓 B.Sc. CS Hons – Programs
-
-This repository contains **Files of codes that will be done in this 4-year BSc Hons Computer Science**
-
----
-
-## 📂 Contents
-
-* ✅ C Source Codes (`.c`)
-* ⚡ Executables (`.exe`)
-
----
-
-## 🚀 How to Run
-
-```bash
-# Compile using GCC
-gcc program.c -o program.exe
-
-# Run the executable
-./program.exe
-```
-
-### 📌 Example Program (Factorial)
-
-```c
-#include <stdio.h>
-int main() {
- int n, fact = 1;
- printf("Enter a number: ");
- scanf("%d", &n);
- for(int i=1; i<=n; i++) {
- fact *= i;
- }
- printf("Factorial = %d", fact);
- return 0;
-}
-```
-
----
-
-## 🛠️ MinGW-w64 Installation Guide: Your C/C++ Compiler Setup
-
-This guide will walk you through the process of setting up your GCC/G++ compiler environment using the packaged MinGW-w64 distribution.
-
-### Step 1: Download the Compiler Archive
-
-Download the compressed MinGW-w64 files from the hosted location.
-
-> ➡️ **Download Link:** [**Direct Download MinGW64.zip (85 MB)**](https://aranag.site/download/MinGW64.zip)
-
-### Step 2: Extract the Files
-
-Once the download is complete, extract the contents of the `MinGW64.zip` file to a simple, root-level folder.
-
-1. **Extract the contents** of the zip file.
-
-2. **Move the resulting folder** to a short, easy-to-reference path.
-
-3. **Recommended Path:** `C:\MinGW64`
-
-### Step 3: Add the Tools to Your System PATH
-
-Adding the `bin` directory to your PATH variable allows you to run `gcc` or `g++` from any terminal window without navigating to the installation folder every time.
-
-1. **Open System Settings:** Open the Start Menu and search for **"Edit the system environment variables"**.
-
-2. **Open Variables Window:** Click the **"Environment Variables..."** button.
-
-3. **Edit Path:** Under the **"System variables"** section, select the **`Path`** variable and click **"Edit..."**.
-
-4. **Add New Entry:**
-
- * Click **"New"**.
-
- * Paste the path to your installation's binary directory: `C:\MinGW64\bin`
-
-5. **Save Changes:** Click **`OK`** on all open windows to finalize the system changes.
-
-### Step 4: Verify the Installation
-
-To ensure the compiler is correctly set up and accessible, open a new command line session and run a simple check.
-
-1. **Open a NEW Terminal:** Close any existing Command Prompt or PowerShell windows, and open a fresh one.
-
-2. **Run the Test Command:** Type the following command:
-
- ```
- gcc --version
- ```
-
-3. **Expected Result:** If successful, you should see the version information for the GCC compiler (e.g., `gcc (MinGW.org GCC-6.3.0-1) 6.3.0`).
-
-> 🎉 **Congratulations!** Your C/C++ development environment is now ready.
-
-> If you do not want to work that much, just go to this [website](https://www.programiz.com/c-programming/online-compiler) and run your programs.
-
----
-
-🔗 **Website**
-For syllabus questions:
-👉 [Click Here](https://aranag.site/github)
-
-🔗 **Website**
-For all tution code:
-👉 [Click Here](https://aranag.site/tuition-c)
-
----
-
-## 👨💻 Author
-
-### Amit Dutta
-
-* 📧 **amitdutta4255@gmail.com**
-
-* 🌐 [**GitHub Profile**](https://github.com/notamitgamer)
-
-----
\ No newline at end of file