Skip to content

Commit

Permalink
Merge pull request #1 from CSecIITB/team
Browse files Browse the repository at this point in the history
scss build scripts
  • Loading branch information
SuperSat001 authored Jan 18, 2024
2 parents 5f0387f + f96e667 commit 42c9783
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cp -f full_site/index.html public_html/index.html
sass full_site/assets/sass/main.scss public_html/assets/css/main.css
cp -Rf full_site/images public_html
cp -Rf full_site/assets/js public_html/assets
python3 commentremover.py > public_html/index.html
open .
25 changes: 25 additions & 0 deletions commentremover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
data = open("full_site/index.html").read()

def findall(data, s):
ar = []
for i in range(len(data) - len(s) + 1):
if data[i:i+len(s)] == s:
ar.append(i)
return ar

start = findall(data, "<!--")
end = [x + 2 for x in findall(data, "-->")]

print("<!-- https://homepages.iitb.ac.in/~22b0967/ -->", end="")

to_write = 1
for i in range(len(data)):
flag = 1
if i in start or i in end:
to_write = 1 - to_write
flag = 0

if to_write and flag:
print(data[i], end="")


0 comments on commit 42c9783

Please sign in to comment.