From bcce470e02f0646c1e9e7bfc62aa3e577973dc9d Mon Sep 17 00:00:00 2001 From: Gurpranked Date: Thu, 5 Sep 2024 20:08:08 -0400 Subject: [PATCH 1/2] feat: Added activities remote docs functionality --- activity_repos.json | 3 ++ .../Getting Started.md | 7 ---- .../Creating the Android App/_category_.json | 8 ----- .../Recap from Creating the Android App.md | 7 ---- .../Incorporating AWS Lambda/_category_.json | 8 ----- .../Recap from Incorporating AWS Lambda.md | 7 ---- .../Incorporating AWS S3/_category_.json | 8 ----- .../_category_.json | 8 ----- repos.json => project_repos.json | 0 stream.js | 36 +++++++++++++++++-- 10 files changed, 36 insertions(+), 56 deletions(-) create mode 100644 activity_repos.json delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/Getting Started.md delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/_category_.json delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/Recap from Creating the Android App.md delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/_category_.json delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/Recap from Incorporating AWS Lambda.md delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/_category_.json delete mode 100644 docs/activities/Intro to AWS Cloud and Android App/_category_.json rename repos.json => project_repos.json (100%) diff --git a/activity_repos.json b/activity_repos.json new file mode 100644 index 000000000..65a51e370 --- /dev/null +++ b/activity_repos.json @@ -0,0 +1,3 @@ +{ + "PhotoSky": "https://github.com/uMLCloudComputing/photosky" +} \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/Getting Started.md b/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/Getting Started.md deleted file mode 100644 index 48d4e95fd..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/Getting Started.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Getting Started - -*Add content here* \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/_category_.json b/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/_category_.json deleted file mode 100644 index d89f03ab5..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Creating the Android App/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Creating the Android App", - "position": 1, - "link": { - "type": "generated-index" - } - } - \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/Recap from Creating the Android App.md b/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/Recap from Creating the Android App.md deleted file mode 100644 index 973a53627..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/Recap from Creating the Android App.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Recap from Creating the Android App - -*Add content here* \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/_category_.json b/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/_category_.json deleted file mode 100644 index f9c76bfcc..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS Lambda/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Incorporating AWS Lambda", - "position": 2, - "link": { - "type": "generated-index" - } - } - \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/Recap from Incorporating AWS Lambda.md b/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/Recap from Incorporating AWS Lambda.md deleted file mode 100644 index b5c42e3b4..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/Recap from Incorporating AWS Lambda.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Recap from Incorporating AWS Lambda - -*Add content here* \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/_category_.json b/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/_category_.json deleted file mode 100644 index 75b178f16..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/Incorporating AWS S3/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Incorporating AWS S3", - "position": 3, - "link": { - "type": "generated-index" - } - } - \ No newline at end of file diff --git a/docs/activities/Intro to AWS Cloud and Android App/_category_.json b/docs/activities/Intro to AWS Cloud and Android App/_category_.json deleted file mode 100644 index 1112c1a54..000000000 --- a/docs/activities/Intro to AWS Cloud and Android App/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "1. Intro to AWS Cloud and Android App", - "position": 1, - "link": { - "type": "generated-index" - } - } - \ No newline at end of file diff --git a/repos.json b/project_repos.json similarity index 100% rename from repos.json rename to project_repos.json diff --git a/stream.js b/stream.js index 6de752405..d1d857419 100644 --- a/stream.js +++ b/stream.js @@ -2,11 +2,41 @@ const { execSync } = require('child_process'); const { readFileSync, mkdirSync, existsSync, writeFileSync } = require('fs'); const { join } = require('path'); -const repos = JSON.parse(readFileSync('repos.json', 'utf8')); +const project_repos = JSON.parse(readFileSync('project_repos.json', 'utf8')); +const activity_repos = JSON.parse(readFileSync('activity_repos.json', 'utf8')) position = 2; -for (const [name, url] of Object.entries(repos)) { - const repoDir = join(__dirname, 'temp', name); +for (const [name, url] of Object.entries(activity_repos)) { + const repoDir = join(__dirname, 'temp_activity', name); + const destDir = join(__dirname, 'docs', 'activities', name); + + // Clone the repository + execSync(`git clone ${url} ${repoDir}`); + + // Create destination directory if it doesn't exist + if (!existsSync(destDir)) { + mkdirSync(destDir, { recursive: true }); + } + + // Copy the docs/web_docs directory to the destination + execSync(`cp -r ${join(repoDir, 'docs', 'web_docs')}/* ${destDir}`); + + // Create _category_.json file + const categoryContent = { + label: name, + position: position, + link: { + type: "generated-index" + } + }; + writeFileSync(join(destDir, '_category_.json'), JSON.stringify(categoryContent, null, 2)); + + console.log(`Copied docs from ${name}`); + position++; +} + +for (const [name, url] of Object.entries(project_repos)) { + const repoDir = join(__dirname, 'temp_projects', name); const destDir = join(__dirname, 'docs', 'projects', name); // Clone the repository From 9fdff595d78d44780be9c33dc3f8d03cb20ffc12 Mon Sep 17 00:00:00 2001 From: Gurpranked Date: Thu, 5 Sep 2024 20:32:02 -0400 Subject: [PATCH 2/2] fix: Add minimal markdown file for activities --- .gitignore | 3 +++ docs/activities/welcome.md | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 docs/activities/welcome.md diff --git a/.gitignore b/.gitignore index 617a11b44..2328ea219 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ yarn-error.log* # AWS Secrets IAM_Automation/aws_creds.py +# Igonre everyhting in docs/activities except md files in the root of docs/activities +docs/activities/* +!docs/activities/*.md # Ignore everything in docs/projects except md files in the root of docs/projects docs/projects/* !docs/projects/*.md \ No newline at end of file diff --git a/docs/activities/welcome.md b/docs/activities/welcome.md new file mode 100644 index 000000000..54267dce1 --- /dev/null +++ b/docs/activities/welcome.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 1 +--- + +# 🔦 Club Activties + +Welcome to the official activties of the UML Cloud Computing Club!