-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from TeamSuman/develop
Develop
- Loading branch information
Showing
8 changed files
with
930 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import json" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"infos = json.load(open('./info/colab.json'))\n", | ||
"template = open('./templates/index_template.html').readlines()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def add_collab(name, desig, univ, img):\n", | ||
"\n", | ||
" return f\"\"\" <div class=\"testimonial-item text-center rounded pb-4\">\n", | ||
" <div class=\"testimonial-comment rounded p-5\">\n", | ||
" </div>\n", | ||
" <div class=\"testimonial-img p-1\">\n", | ||
" <img src=\"{img}\" class=\"img-fluid rounded-circle\" alt=\"{name}\">\n", | ||
" </div>\n", | ||
" <div style=\"margin-top: -35px;\">\n", | ||
" <h5 class=\"mb-0\">{name}</h5>\n", | ||
" <p class=\"mb-0\">{desig}\n", | ||
" <br> {univ}\n", | ||
" </p>\n", | ||
" </div>\n", | ||
" </div>\"\"\"\n", | ||
" \n", | ||
"\n", | ||
"def return_head_tail(mem_type, style = 1):\n", | ||
"\n", | ||
" section_head = \"\"\"<div class=\"container-fluid testimonial py-5\">\n", | ||
" <div class=\"container py-5\">\n", | ||
" <div class=\"mx-auto text-center mb-5\" style=\"max-width: 900px;\">\n", | ||
" <h5 class=\"section-title px-3\">Colaborators</h5>\n", | ||
" <h1 class=\"mb-0\">National/international colaborators</h1>\n", | ||
" </div>\n", | ||
" <div class=\"testimonial-carousel owl-carousel\">\"\"\"\n", | ||
"\n", | ||
" section_tail = \"\"\"</div></div></div>\"\"\"\n", | ||
" return section_head, section_tail" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 13, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for i, line in enumerate(template):\n", | ||
" if \"<!-- Collaborator Start -->\" in line:\n", | ||
" header = template[:i+1]\n", | ||
" tail = template[i+2:]\n", | ||
"full_html = \"\" + ''.join(header)\n", | ||
"for item in infos:\n", | ||
" head = \"\"\n", | ||
"\n", | ||
" section_head, section_tail = return_head_tail('Alumni')\n", | ||
" head += section_head\n", | ||
" for mem in infos[item]:\n", | ||
" head += add_collab(mem['name'], mem['desig'], mem['univ'], mem['img'])\n", | ||
" head += section_tail\n", | ||
"\n", | ||
"full_html += head\n", | ||
"full_html += ''.join(tail)\n", | ||
"\n", | ||
"with open('test.html', 'w') as f:\n", | ||
" f.write(full_html)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "sarkar", | ||
"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.12.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"colab": [ | ||
{ | ||
"name": "Ruth Nussinov", | ||
"desig": "Professor and Senior Principal Investigator", | ||
"univ": "National Cancer Institute and Tel Aviv University", | ||
"img": "./img/ruth.jpeg" | ||
}, | ||
{ | ||
"name": "Gautam Basu", | ||
"desig": "Professor (retired)", | ||
"univ": "Biophysics, Bose Institute", | ||
"img": "./img/gbasu.jpg" | ||
}, | ||
{ | ||
"name": "Supratim Banerjee", | ||
"desig": "Associate Professor", | ||
"univ": "DCS, IISERK", | ||
"img": "./img/supra.png" | ||
}, | ||
{ | ||
"name": "Rajnish Kumar", | ||
"desig": "Professor", | ||
"univ": "Chemical Engineering, IITM", | ||
"img": "./img/rajnish.jpg" | ||
}, | ||
{ | ||
"name": "Dibyendu Das", | ||
"desig": "Associate Professor", | ||
"univ": "Chemistry, IISERK", | ||
"img": "./img/ddas.jpeg" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import json | ||
|
||
def add_collab(name, desig, univ, img): | ||
|
||
return f""" <div class="testimonial-item text-center rounded pb-4"> | ||
<div class="testimonial-comment rounded p-5"> | ||
</div> | ||
<div class="testimonial-img p-1"> | ||
<img src="{img}" class="img-fluid rounded-circle" alt="{name}"> | ||
</div> | ||
<div style="margin-top: -35px;"> | ||
<h5 class="mb-0">{name}</h5> | ||
<p class="mb-0">{desig} | ||
<br> {univ} | ||
</p> | ||
</div> | ||
</div>""" | ||
|
||
|
||
def return_head_tail(): | ||
|
||
section_head = """<div class="container-fluid testimonial py-5"> | ||
<div class="container py-5"> | ||
<div class="mx-auto text-center mb-5" style="max-width: 900px;"> | ||
<h5 class="section-title px-3">Colaborators</h5> | ||
<h1 class="mb-0">National/international colaborators</h1> | ||
</div> | ||
<div class="testimonial-carousel owl-carousel">""" | ||
|
||
section_tail = """</div></div></div>""" | ||
return section_head, section_tail | ||
|
||
infos = json.load(open('./info/colab.json')) | ||
template = open('./index.html').readlines() | ||
|
||
for i, line in enumerate(template): | ||
if "<!-- Collaborator Start -->" in line: | ||
header = template[:i+1] | ||
tail = template[i+2:] | ||
full_html = "" + ''.join(header) | ||
for item in infos: | ||
head = "" | ||
|
||
section_head, section_tail = return_head_tail() | ||
head += section_head | ||
for mem in infos[item]: | ||
head += add_collab(mem['name'], mem['desig'], mem['univ'], mem['img']) | ||
head += section_tail | ||
|
||
full_html += head | ||
full_html += ''.join(tail) | ||
|
||
with open('index.html', 'w') as f: | ||
f.write(full_html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.