From 4b7c700c6223ac0a8d80080ac2b3dde605756f20 Mon Sep 17 00:00:00 2001 From: Gregory Leeman Date: Thu, 27 Feb 2025 11:33:27 +0000 Subject: [PATCH] lazygit --- workflowy-helper/diary.opml | 2 ++ workflowy-helper/diary.py | 48 +++++++++---------------- workflowy-helper/main.js | 6 +--- workflowy-helper/style.css | 70 +++++++++++++++++++++++++------------ 4 files changed, 68 insertions(+), 58 deletions(-) create mode 100644 workflowy-helper/diary.opml diff --git a/workflowy-helper/diary.opml b/workflowy-helper/diary.opml new file mode 100644 index 0000000..a6608a5 --- /dev/null +++ b/workflowy-helper/diary.opml @@ -0,0 +1,2 @@ + +contact@gregoryleeman.com \ No newline at end of file diff --git a/workflowy-helper/diary.py b/workflowy-helper/diary.py index d1e599f..f857529 100644 --- a/workflowy-helper/diary.py +++ b/workflowy-helper/diary.py @@ -1,41 +1,38 @@ import xml.etree.ElementTree as ET import datetime -# Function to generate the outline for a given week +def ordinal(n): + if 11 <= n % 100 <= 13: + suffix = 'th' + else: + suffix = {1: 'st', 2: 'nd', 3: 'rd'}.get(n % 10, 'th') + return str(n) + suffix + def generate_weekly_opml(week_num, year=2025): - # Start of the week (Sunday) start_date = datetime.date(year, 1, 1) + datetime.timedelta(weeks=week_num-1) - - # Adjust to get the Sunday of the week (since Python's datetime module uses Monday as the start of the week) start_date = start_date - datetime.timedelta(days=start_date.weekday() + 1) - # monday_date = start_date + datetime.timedelta(days=1) - - # Create the root element for the week outline with Sunday date as a note - # week_outline = ET.Element("outline", text=f"2025 Week {week_num}", _note=f"") - week_outline = ET.Element("outline", text=f"2025 Week {week_num}") - # ET.SubElement(week_outline, "outline") - - # Loop through the days of the week (Sunday to Saturday) + day_date = start_date + weekday = day_date.strftime('%A') + week_outline = ET.Element( + "outline", + text=f"2025 Week {week_num}", + _note=f"" + ) + empty = ET.SubElement(week_outline, "outline", text="") for i in range(7): day_date = start_date + datetime.timedelta(days=i) weekday = day_date.strftime('%A') - - # Create the day outline with a link for tasks - day_outline = ET.SubElement( week_outline, "outline", - text=f"{weekday}", + text=f"{weekday} {ordinal(day_date.day)} {day_date.strftime('%b')}", _note=f"" ) - - # Example of activities (these can be customized) if weekday in ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']: outline = ET.SubElement(day_outline, "outline", text="") return week_outline -# Function to return a color based on the weekday (for styling) def get_color(weekday): colors = { "Sunday": "purple", @@ -48,33 +45,22 @@ def get_color(weekday): } return colors.get(weekday, "gray") -# Function to create OPML for all weeks in 2025 and the first week of 2026 def create_opml_for_year_and_first_week_2026(): root_opml = ET.Element("opml", version="2.0") head = ET.SubElement(root_opml, "head") owner_email = ET.SubElement(head, "ownerEmail") owner_email.text = "contact@gregoryleeman.com" - body = ET.SubElement(root_opml, "body") - - # Generate OPML for each week of 2025 - for week_num in range(1, 53): # There are 52 weeks in 2025 + for week_num in range(1, 53): week_opml = generate_weekly_opml(week_num) body.append(week_opml) - - # Now, handle the first week of 2026 week_2026_opml = generate_weekly_opml(1, year=2026) body.append(week_2026_opml) - - # Generate the final tree tree = ET.ElementTree(root_opml) return tree -# Create the OPML file def save_opml_to_file(filename="diary.opml"): tree = create_opml_for_year_and_first_week_2026() tree.write(filename, encoding="utf-8", xml_declaration=True) -# Call the function to create the OPML save_opml_to_file() - diff --git a/workflowy-helper/main.js b/workflowy-helper/main.js index fb54355..8a49ada 100644 --- a/workflowy-helper/main.js +++ b/workflowy-helper/main.js @@ -155,14 +155,10 @@ tag.classList.add("tag"); tag.classList.add("tag-" + tagText); } - var computedStyle = window.getComputedStyle(tag); - // if (computedStyle.backgroundColor === "rgb(227, 160, 8)") { - // tag.classList.add("tag-yellow"); - // } }); const links = n.querySelectorAll('.contentLink'); links.forEach(link => { - // link.spellcheck = false; + link.spellcheck = false; const nonLetterRegex = /[^a-zA-Z0-9]/g; var linkFull = link.innerText.trim().replace(nonLetterRegex, ''); if (linkFull.startsWith("x")) { diff --git a/workflowy-helper/style.css b/workflowy-helper/style.css index fa28f2a..372e04b 100644 --- a/workflowy-helper/style.css +++ b/workflowy-helper/style.css @@ -40,10 +40,10 @@ body { color: var(--grey) !important; } -.root:not(.board) > .children, -.root:not(.board) > .name { - /* max-width: 800px; */ -} +/* .root:not(.board) > .children, */ +/* .root:not(.board) > .name { */ +/* /1* max-width: 800px; *1/ */ +/* } */ body::-webkit-scrollbar { display: none; /* Chrome, Safari, Opera */ @@ -64,9 +64,9 @@ body::-webkit-scrollbar { -.name > .content { - white-space: nowrap; -} +/* .name > .content { */ +/* white-space: nowrap; */ +/* } */ .name > .content > .innerContentContainer { overflow: hidden; @@ -282,36 +282,62 @@ body::-webkit-scrollbar { color: var(--white) !important; } -.linked.tagged-done > .name > .content, -.linked.tagged-done > .notes > .content, -.linked.tagged-done > .name time > span, -.linked.tagged-missed > .name > .content, -.linked.tagged-missed > .notes > .content, -.linked.tagged-missed > .name time > span, -.linked.tagged-na > .name > .content, -.linked.tagged-na > .notes > .content, -.linked.tagged-na > .name time > span { +.tagged-done > .name > .content, +.tagged-done > .notes > .content, +.tagged-done > .name time > span, +.tagged-missed > .name > .content, +.tagged-missed > .notes > .content, +.tagged-missed > .name time > span, +.tagged-na > .name > .content, +.tagged-na > .notes > .content, +.tagged-na > .name time > span { /* opacity: 0.5 !important; */ /* text-decoration: none !important; */ text-decoration: line-through !important; text-decoration-thickness: 2px !important; } -.linked.tagged-done > .name > .content, -.linked.tagged-done > .name time > span { +.tagged-done > .name > .content, +.tagged-done > .name time > span { text-decoration-color: var(--green) !important; } -.linked.tagged-missed > .name > .content, -.linked.tagged-missed > .name time > span { +.tagged-missed > .name > .content, +.tagged-missed > .name time > span { text-decoration-color: var(--red) !important; } -.linked.tagged-na > .name > .content, -.linked.tagged-na > .name time > span { +.tagged-na > .name > .content, +.tagged-na > .name time > span { text-decoration-color: var(--blue) !important; } .tag-new { color: var(--blue) !important; } + +.tagged-e > .name > .content > .innerContentContainer, +.tagged-e > .name > .content > .innerContentContainer > .contentTag { + background-color: var(--red) !important; + color: var(--black) !important; +} + +.tagged-r > .name > .content > .innerContentContainer, +.tagged-r > .name > .content > .innerContentContainer > .contentTag { + background-color: var(--blue) !important; + color: var(--black) !important; +} + +.tagged-g > .name > .content > .innerContentContainer, +.tagged-g > .name > .content > .innerContentContainer > .contentTag { + background-color: var(--yellow) !important; + color: var(--black) !important; +} + +.tagged-w > .name > .content > .innerContentContainer { + color: var(--red) !important; +} + +.tagged-p > .name > .content > .innerContentContainer { + color: var(--green) !important; +}