diff --git a/app.py b/app.py index cec7389..10a1a13 100644 --- a/app.py +++ b/app.py @@ -64,7 +64,7 @@ class WikiApp(Flask): def homepage(self): # Fetch pages for articles, projects, and newsletters - categories = ['Articles', 'Projects', 'Newsletters', 'MainNavigation'] + categories = ['Articles', 'Projects', 'Newsletters'] category_page_list = self.fetch_all_pages(categories) updated_cat_list = self.fetch_pages_cat(category_page_list) articles = updated_cat_list.get('Articles', []) @@ -103,13 +103,24 @@ class WikiApp(Flask): # Append 'https://wiki.conceptnull.org' to the src attribute img['src'] = 'https://wiki.conceptnull.org' + img['src'] + # Find all a tags with href not containing 'index.php' + links = soup.find_all('a', href=lambda href: href and 'index.php' not in href and not href.startswith('#') and not href.startswith('/File:')) + # Loop through each link and modify its href attribute + for link in links: + # Add _blank to href + link['target'] = '_blank' + link.string = link.string.strip() + " ↘" + # Find all a tags with href containing 'index.php' links = soup.find_all('a', href=lambda href: href and 'index.php' in href) - # Loop through each link and modify its href attribute for link in links: # Remove 'index.php' from the href attribute link['href'] = link['href'].replace('/index.php', '') + + + + # Remove any element with class 'mw-editsection' edit_sections = soup.find_all(class_='mw-editsection') @@ -121,9 +132,16 @@ class WikiApp(Flask): file_description_tags = soup.find_all('a', class_='mw-file-description') for file_link in file_description_tags: file_link.unwrap() + + soup = self.remove_thumbnail_img(soup) return soup.prettify() + def remove_thumbnail_img(self, soup): + thumbnail = soup.find_all(attrs={"typeof": "mw:File/Thumb"}) + for img in thumbnail: + img.decompose() + return soup # Route for favicon.ico to prevent Flask from raising an error def favicon(self): return Response('', status=200) diff --git a/static/assets/styles.css b/static/assets/styles.css index c93acd4..9022ed4 100644 --- a/static/assets/styles.css +++ b/static/assets/styles.css @@ -47,7 +47,7 @@ body { height: 100px; gap: 0px; margin-bottom: 10px; - position: fixed; + /* position: fixed; */ z-index: 100; } @@ -90,8 +90,83 @@ body { } .content { - margin-left: 20px; - margin-right: 20px; + width: 100%; + position: fixed; +} + +.content-cont { + overflow: scroll; + overflow-x: hidden; + height: 100vh; + margin-left: 40px; + margin-top: 100px; + padding-right: 400px; + +} + +.content-cont h1{ + font-size: 60px; + text-decoration: underline; +} + +.content-cont h2{ + font-size: 30px; + text-decoration: underline; +} + +.content-cont h3{ + font-size: 25px; + text-decoration: underline ; +} + +.content-cont h4{ + font-size: 20px; +} + +.content-cont p { + font-size: 17.5px; + line-height: 30px; +} + +.content-cont a { + color: black; + text-decoration: none; + background-color: white; + font-style: oblique; + padding-left: 5px; + padding-right: 5px; +} + +.content-cont ul { + font-size: 20px; + border-style: none; +} + +.content-cont li a{ + border-style: none; + line-height: 40px; +} + +.content-cont img{ + height: 100%; + width: auto; + max-width: 900px; + border: white; + border-style: dashed; + transition: transform 0.3s ease-in-out; +} + +.content-cont img:hover { + animation: rotate 1s steps(2) forwards infinite; +} + + +.content-cont::-webkit-scrollbar { + display: none; +} + +.content-header { + /* padding-top: 160px; */ } .section-cont { @@ -173,6 +248,11 @@ body { z-index: 500; } +.foot { + height: 200px; + width: auto; +} + /* Keyframes for the spin animation */ @keyframes spin { @@ -182,18 +262,18 @@ body { @keyframes rotate { 0% { - transform: rotate(0deg); + transform: rotate(0deg) scaleX(100%); } 25% { - transform: rotate(2deg); + transform: rotate(2deg) scaleX(95%); } 50% { - transform: rotate(0deg); + transform: rotate(0deg) scaleX(100%); } 75% { - transform: rotate(-2deg); + transform: rotate(-2deg) scaleX(95%); } 100% { - transform: rotate(0deg); + transform: rotate(0deg) scaleX(100%); } } \ No newline at end of file diff --git a/templates/article.html b/templates/article.html index 6c52e44..995b6d9 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,8 +1,11 @@ {% extends "base.html" %} {% block title %}Ø | {{ title }}{% endblock %} {% block content %} -

{{ title }}

-
- {{ content | safe }} -
+
+

{{ title }}

+ + {{ content | safe }} +
+
+ {% endblock %} diff --git a/templates/home.html b/templates/home.html index f59eda0..b7dea9e 100644 --- a/templates/home.html +++ b/templates/home.html @@ -33,4 +33,5 @@ + {% endblock %} \ No newline at end of file