diff --git a/docs/core/CSH Calendar.md b/docs/core/csh_calendar.md similarity index 96% rename from docs/core/CSH Calendar.md rename to docs/core/csh_calendar.md index 80eb328..c9e63e0 100644 --- a/docs/core/CSH Calendar.md +++ b/docs/core/csh_calendar.md @@ -1,5 +1,3 @@ -## Overview - This core component is used for all the fetching, formatting and structuring for the CSH calendar portion of Jumpstart. --- diff --git a/docs/core/Slack.md b/docs/core/slack.md similarity index 94% rename from docs/core/Slack.md rename to docs/core/slack.md index 3c238f8..bb00ab4 100644 --- a/docs/core/Slack.md +++ b/docs/core/slack.md @@ -1,5 +1,3 @@ -## Overview - This component handles the Slack Bot and it's related functions. Such as responding to announcments, requesting to upload to Jumpstart, and the other handles with Slack. --- diff --git a/docs/core/Wiki-thoughts.md b/docs/core/wikithoughts.md similarity index 100% rename from docs/core/Wiki-thoughts.md rename to docs/core/wikithoughts.md diff --git a/docs/endpoints/calendar_endpoint.md b/docs/endpoints/csh_calendar.md similarity index 100% rename from docs/endpoints/calendar_endpoint.md rename to docs/endpoints/csh_calendar.md diff --git a/docs/endpoints/slack.md b/docs/endpoints/slack.md new file mode 100644 index 0000000..aa6a463 --- /dev/null +++ b/docs/endpoints/slack.md @@ -0,0 +1,4 @@ + +::: api.endpoints.get_announcement +::: api.endpoints.slack_events +::: api.endpoints.message_actions \ No newline at end of file diff --git a/docs/getting-started/setup.md b/docs/getting-started/setup.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/themes/how_to.md b/docs/themes/how_to.md new file mode 100644 index 0000000..a3903f3 --- /dev/null +++ b/docs/themes/how_to.md @@ -0,0 +1,22 @@ +Jumpstart has many different themes displayed on the website, this is a step by step process on how to implement your own! + +**Any images that need to be added should be put in src/static/img** + +### Adding Background + +1. Go to the file: **src/static/js/main.js** +2. In the function long update, figure out the day, month, and hour of your theme. + - hour is in 24H format +3. Add it into the if statement (please change this in the future) + - Make sure it follows the bgImage = "url(../static/img/{**YOUR FILE HERE**})" + +### Adding CSS Theme +1. Go to the file **src/static/css/style.css** +2. Add a new class for the colors **MAKE SURE IT STARTS WITH {theme-}!!!** +3. Change the colors in this new class +4. Repeat the steps in the "Adding Background" +5. Add a new index into "allThemes" with your css theme, along with any changes to weatherwidget or datadog +6. change the themeToLoad in the if statement to load your new index + + + diff --git a/docs/themes/overview.md b/docs/themes/overview.md new file mode 100644 index 0000000..8cf5595 --- /dev/null +++ b/docs/themes/overview.md @@ -0,0 +1,30 @@ +Jumpstart has many different themes displayed on the website. Ranging from the light - dark mode, to full background and color shifts fo events. + +### All Themes +- Light Mode + - Default theme between 9 AM and 6 PM +- Dark Mode + - Default theme between 6 PM and 9 AM +- Valentine's Day + - Feburary 12th, 13th and 14th + - Changes title to "Constantly Smooching House" + - Adds decorative hearts around the logo +- BANG! + - March 13th + - Changes title to "BANG! Science" + - Gives an orange gradient to the background +- CSH 50th Anniversary + - April 9th, 10th, 11th, and 12 + - Replaces title with the CSH 50th Anniversary logo + - Replaces color scheme with a Golden / Black theme +- Halloween + - October 29th, 30th, and 31st + - Changes title to "Computer Spooky House" + - Logo is given orange and purple colors +- Duck! + - November 2nd + - Duck +- Winter + - November and December + - Changes title to "Christmas Season" + - Gives a red and green logo with a bright blue background diff --git a/mkdocs.yml b/mkdocs.yml index 234a459..1b7673e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,14 +39,16 @@ nav: - Home: index.md - Getting Started: getting-started/getting-started.md - Backend: - - Calendar: core/CSH Calendar.md - - Slack Bot: core/Slack.md - - Wiki Thoughts: core/Wiki-thoughts.md + - Calendar: core/csh_calendar.md + - Slack: core/slack.md + - Wikithoughts: core/wikithoughts.md - Endpoints: - - Calendar: endpoints/calendar_endpoint.md - - Announcements: endpoints/announcements.md - - Slack Bot: endpoints/slack_bot.md - - Wiki Thoughts: endpoints/wikithoughts.md + - Calendar: endpoints/csh_calendar.md + - Slack: endpoints/slack.md + - Wikithoughts: endpoints/wikithoughts.md + - Themes: + - Themes: themes/overview.md + - Adding Your Own: themes/how_to.md plugins: - search diff --git a/src/core/wikithoughts.py b/src/core/wikithoughts.py index 9ab191c..3a14c51 100644 --- a/src/core/wikithoughts.py +++ b/src/core/wikithoughts.py @@ -46,9 +46,10 @@ # Precompile all the Regex operations -RE_LINK: Pattern[str] = re.compile(r'\[https?://[^\s"]+\s+"?([^\]"]+)"?\]') -RE_FILE: Pattern[str] = re.compile(r"\[\[File:[^\]]*\]\]", re.IGNORECASE) -RE_IMAGE: Pattern[str] = re.compile(r"\[\[Image:[^\]]*\]\]", re.IGNORECASE) +RE_LINK: Pattern[str] = re.compile( + r'\[https?://[^\s"]+\s+"?([^\]"]+)"?\]' +) # Https Links +RE_FILE_IMAGE = re.compile(r"\[\[(?:File|Image):[^\[\]]*\]\]", re.IGNORECASE) RE_PAGE_TEXT: Pattern[str] = re.compile(r"\[\[[^\|\]]*\|([^\]]+)\]\]") RE_PAGE: Pattern[str] = re.compile(r"\[\[([^\]]+)\]\]") RE_CSH: Pattern[str] = re.compile(r"\^\^([^^]+)\^\^") @@ -69,11 +70,10 @@ def clean_wikitext(text: str) -> str: """ reg_operations: tuple[Pattern[str]] = ( + RE_PAGE, + RE_FILE_IMAGE, RE_LINK, - RE_FILE, - RE_IMAGE, RE_PAGE_TEXT, - RE_PAGE, RE_CSH, RE_TEMPLATE, RE_HTML, diff --git a/src/static/js/main.js b/src/static/js/main.js index 35fd43f..8c76e5e 100644 --- a/src/static/js/main.js +++ b/src/static/js/main.js @@ -78,14 +78,15 @@ async function longUpdate() { const day = date.getDate(); const isDay = (hour > 9 && hour < 18); - let is_golden = (month === 4 && [9, 10, 11, 12].includes(day)); - let bgImage = "url(../static/img/darkmodeF.png)"; - + let bgImage = "url(../static/img/darkmodeF.png)"; + let themeToLoad = "dark"; + if (month === 2 && [12, 13, 14].includes(day)) { bgImage = "url(../static/img/valentinemode.png)"; } else if (month === 3 && day === 13) { bgImage = "url(../static/img/jumpstartbang.png)"; - } else if (is_golden) { + } else if (month === 4 && [9, 10, 11, 12].includes(day)) { + themeToLoad = "golden"; bgImage = "url(../static/img/goldenmode.png)"; } else if (month === 10 && [29, 30, 31].includes(day)) { bgImage = "url(../static/img/spookymode.png)"; @@ -94,19 +95,12 @@ async function longUpdate() { } else if ([11, 12].includes(month)) { bgImage = "url(../static/img/wintermode.png)"; } else if (isDay) { + themeToLoad = "light"; bgImage = "url(../static/img/lightmodeF.png)"; } $("body").css("background-image", bgImage); try { - - let themeToLoad = "dark"; - if (is_golden){ - themeToLoad = "golden"; - } else if (isDay) { - themeToLoad = "light"; - } - setNewPageTheme(allThemes[themeToLoad].page); setDatadogTheme(allThemes[themeToLoad].datadog); setWeatherTheme(allThemes[themeToLoad].weather);