Skip to content

feat: Added activities remote docs functionality #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions activity_repos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"PhotoSky": "https://github.com/uMLCloudComputing/photosky"
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 7 additions & 0 deletions docs/activities/welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 1
---

# 🔦 Club Activties

Welcome to the official activties of the UML Cloud Computing Club!
File renamed without changes.
36 changes: 33 additions & 3 deletions stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading