Skip to content

Commit

Permalink
Merge pull request #865 from Nancyjikadra/master
Browse files Browse the repository at this point in the history
Website of ML-CaPsule
  • Loading branch information
Niketkumardheeryan authored Aug 8, 2024
2 parents a9f6ca8 + ae35c7d commit 10f47ae
Show file tree
Hide file tree
Showing 16 changed files with 2,570 additions and 0 deletions.
1 change: 1 addition & 0 deletions website
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions website ML-CaPsule/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ML-CaPsule-website
building full stack website for ML-CaPsule
Binary file added website ML-CaPsule/ai.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions website ML-CaPsule/contribution.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<header class="text-gray-600 body-font">
<div class="container mx-auto flex flex-wrap p-5 flex-col md:flex-row items-center">
<a class="flex title-font font-medium items-center text-gray-900 mb-4 md:mb-0">
<img src="logo.png" alt="Logo" class="w-10 h-10 rounded-full">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg>
<span class="ml-3 text-xl">ML-CaPsule</span>
</a>
<nav class="md:ml-auto flex flex-wrap items-center text-base justify-center">
<a href="home.html"class="mr-5 hover:text-gray-900">Home<a href="home.html"></a>
<a href="contribution.html" class="mr-5 hover:text-gray-900">Open-source Contribution<a href="contribution.html"></a>
<a href="webprojects.html" class="mr-5 hover:text-gray-900">Projects<a ></a>

</nav>

</div>
</header>



<section class="text-gray-600 body-font overflow-hidden">
<div class="container px-5 py-24 mx-auto">
<div class="-my-8 divide-y-2 divide-gray-100">
<div class="py-8 flex flex-wrap md:flex-nowrap">
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-gray-700">PR</span>

</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-gray-900 title-font mb-2">How to make a Pull Request</h2>
<p class="leading-relaxed">Give a clear description what modifications you have made.</p>
<a href="https://github.com/Niketkumardheeryan/ML-CaPsule/blob/master/.github/pullrequest_template.md" class="text-blue-500 inline-flex items-center mt-4">Learn More
<svg class="w-4 h-4 ml-2" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div class="py-8 flex flex-wrap md:flex-nowrap">
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-gray-700">Readme File</span>

</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-gray-900 title-font mb-2">Readme file Template</h2>
<p class="leading-relaxed">Goals,Libraries needed, Accuracy</p>
<a href="https://github.com/Niketkumardheeryan/ML-CaPsule/blob/master/.github/readme_template.md" class="text-blue-500 inline-flex items-center mt-4">Learn More
<svg class="w-4 h-4 ml-2" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div class="py-8 flex flex-wrap md:flex-nowrap">
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-gray-700">Issue</span>

</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-gray-900 title-font mb-2">How to raise issue</h2>
<p class="leading-relaxed">Bug, Feature, Documentation</p>
<a href="https://github.com/Niketkumardheeryan/ML-CaPsule/tree/master/.github/ISSUES_TEMPLATE" class="text-blue-500 inline-flex items-center mt-4">Learn More
<svg class="w-4 h-4 ml-2" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
</div>
</div>
<div class="flex justify-center mt-16">
<a href="https://github.com/Niketkumardheeryan/ML-CaPsule" class="flex">
<button class="text-white bg-blue-500 border-0 py-2 px-8 focus:outline-none hover:bg-blue-600 rounded text-lg">Contribute</button>
</a>
</div>


</section>

<footer class="text-gray-600 body-font">
<div class="container px-5 py-8 mx-auto flex items-center sm:flex-row flex-col">
<a class="flex title-font font-medium items-center md:justify-start justify-center text-gray-900">
<img src="logo.png" alt="Logo" class="w-10 h-10 rounded-full">
<span class="ml-3 text-xl">ML-CaPsule</span>
</a>
<p class="text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l-2 sm:border-gray-200 sm:py-2 sm:mt-0 mt-4">© 2024 ML-CaPsule —
<a class="text-gray-600 ml-1" rel="noopener noreferrer" target="_blank">@Niketkumardheeryan</a>
</p>
<span class="inline-flex sm:ml-auto sm:mt-0 mt-4 justify-center sm:justify-start">
<a href="https://in.linkedin.com/company/ml-capsule?trk=public_post_feed-actor-name" class="text-gray-500">
<svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="0" class="w-5 h-5" viewBox="0 0 24 24">
<path stroke="none" d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"></path>
<circle cx="4" cy="4" r="2" stroke="none"></circle>
</svg>
</a>
</span>
</div>
</footer>

</body>
</html>
Binary file added website ML-CaPsule/data anal.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website ML-CaPsule/data sci.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website ML-CaPsule/deep l.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
158 changes: 158 additions & 0 deletions website ML-CaPsule/github-api.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"REPOSITORY_INDEX.md file has been created.\n"
]
}
],
"source": [
"import os\n",
"from github import Github\n",
"from markdown2 import markdown\n",
"\n",
"# Replace with your GitHub access token\n",
"GITHUB_ACCESS_TOKEN = 'your token'\n",
"# Replace with your GitHub username and repository name\n",
"REPO_NAME = 'username/reponame'\n",
"\n",
"# Authenticate to GitHub\n",
"g = Github(GITHUB_ACCESS_TOKEN)\n",
"repo = g.get_repo(REPO_NAME)\n",
"\n",
"def get_folders(repo):\n",
" contents = repo.get_contents(\"\")\n",
" folders = [content for content in contents if content.type == 'dir']\n",
" return folders\n",
"\n",
"def get_readme(repo, folder):\n",
" try:\n",
" readme_file = repo.get_contents(os.path.join(folder.path, \"README.md\"))\n",
" return readme_file.decoded_content.decode()\n",
" except:\n",
" return None\n",
"\n",
"def generate_markdown(folders, repo_name):\n",
" markdown_content = \"# Repository Index\\n\\n\"\n",
" for folder in folders:\n",
" readme_content = get_readme(repo, folder)\n",
" if readme_content:\n",
" description = markdown(readme_content).strip().split('\\n')[0]\n",
" else:\n",
" description = \"No description available.\"\n",
"\n",
" folder_link = f\"https://github.com/ML-CaPsule/tree/main/{folder.path}\"\n",
" markdown_content += f\"## [{folder.name}]({folder_link})\\n\\n{description}\\n\\n\"\n",
" return markdown_content\n",
"\n",
"def save_to_file(content, filename=\"REPOSITORY_INDEX_new.md\"):\n",
" with open(filename, \"w\") as file:\n",
" file.write(content)\n",
"\n",
"def main():\n",
" folders = get_folders(repo)\n",
" markdown_content = generate_markdown(folders, REPO_NAME)\n",
" save_to_file(markdown_content)\n",
" print(\"REPOSITORY_INDEX.md file has been created.\")\n",
"\n",
"if __name__ == \"__main__\":\n",
" main()\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"projects.html file has been created with correct links.\n"
]
}
],
"source": [
"import re\n",
"\n",
"def extract_projects_from_markdown(markdown_file, old_base_url, new_base_url):\n",
" with open(markdown_file, 'r') as file:\n",
" content = file.read()\n",
"\n",
" # Replace old base URL with new base URL\n",
" content = content.replace(old_base_url, new_base_url)\n",
"\n",
" # Use regex to find all project names and links\n",
" projects = re.findall(r'## \\[(.+?)\\]\\((https://github\\.com/.+?)\\)', content)\n",
" return projects\n",
"\n",
"def generate_html(projects):\n",
" html_content = \"\"\n",
" template = '''\n",
" <div class=\"flex justify-center items-center h-screen\">\n",
" <div class=\"p-2 sm:w-1/2 w-full\">\n",
" <div class=\"bg-gray-100 rounded flex p-4 h-full items-center justify-center\">\n",
" <svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" class=\"text-blue-500 w-6 h-6 flex-shrink-0 mr-4\" viewBox=\"0 0 24 24\">\n",
" <path d=\"M22 11.08V12a10 10 0 11-5.93-9.14\"></path>\n",
" <path d=\"M22 4L12 14.01l-3-3\"></path>\n",
" </svg>\n",
" <span class=\"title-font font-medium\">{project_name}<a href=\"{project_link}\"</span>\n",
" </div>\n",
" </div>\n",
"</div>\n",
"\n",
" '''\n",
"\n",
" for project_name, project_link in projects:\n",
" html_content += template.format(project_name=project_name, project_link=project_link)\n",
"\n",
" return html_content\n",
"\n",
"def save_to_file(content, filename=\"projects.html\"):\n",
" with open(filename, \"w\") as file:\n",
" file.write(content)\n",
"\n",
"def main():\n",
" markdown_file = \"REPOSITORY_INDEX.md\"\n",
" old_base_url = \"https://github.com/ML-CaPsule/tree/main/\"\n",
" new_base_url = \"https://github.com/Niketkumardheeryan/ML-CaPsule/tree/master/\"\n",
" \n",
" projects = extract_projects_from_markdown(markdown_file, old_base_url, new_base_url)\n",
" html_content = generate_html(projects)\n",
" save_to_file(html_content)\n",
" print(\"projects.html file has been created with correct links.\")\n",
"\n",
"if __name__ == \"__main__\":\n",
" main()\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 10f47ae

Please sign in to comment.