├── .gitignore ├── Makefile ├── README.md ├── dist ├── .empty └── RoamWeeklyPlan.alfredworkflow ├── src ├── icon.png ├── info.plist └── weekly_plan.py └── version.sh /.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_DIR ?= $(shell pwd) 2 | BUILD_DIR ?= $(PROJECT_DIR)/_build 3 | ARCHIVE_DIR ?= $(BUILD_DIR)/archive 4 | WORKFLOW_FILENAME ?= "RoamWeeklyPlan.alfredworkflow" 5 | WORKFLOW_DIR ?= "$(PROJECT_DIR)/dist" 6 | WORKFLOW_PATH ?= "$(WORKFLOW_DIR)/$(WORKFLOW_FILENAME)" 7 | VERSION ?= $(shell $(PROJECT_DIR)/version.sh) 8 | 9 | build: clean 10 | mkdir -p $(ARCHIVE_DIR) $(shell dirname "$(WORKFLOW_PATH)") 11 | cp -r $(PROJECT_DIR)/src/* $(ARCHIVE_DIR)/ 12 | sed -i.bak 's/{{VERSION}}/$(VERSION)/g' $(ARCHIVE_DIR)/info.plist 13 | rm -f $(ARCHIVE_DIR)/info.plist.bak 14 | cd $(ARCHIVE_DIR) \ 15 | && zip $(WORKFLOW_PATH) * \ 16 | && echo "Created zip: $(WORKFLOW_PATH)" 17 | 18 | clean: 19 | rm -rf $(BUILD_DIR) $(WORKFLOW_PATH) 20 | 21 | version: ## output current version 22 | @echo $(VERSION) 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # roam-weekly-plan 2 | Alfred workflow that generates a Roam weekly plan template 3 | 4 | This workflow allows you to use a snippet trigger with [Alfred](https://www.alfredapp.com/) to generate 5 | a weekly plan template for the next week as described by [Nat Eliason](https://www.nateliason.com) in his 6 | excellent [Effortless Output with Roam](https://learn.nateliason.com/courses/764250) course. 7 | 8 | ## Installation 9 | To install, all you need to do is download the Roam Weekly Plan.alfredworkflow file from this repo and 10 | open it with Alfred. Define the snippet trigger you want to use (I like `\\xrwp`) and use it whenever you 11 | want to generate a new weekly plan. The script that generates the template is also available to look 12 | at in this repo. 13 | 14 | ### Customization 15 | The example script that is used by the workflow can be found in the `src/` directory. Edit this script in 16 | your favorite editor to include your daily habits and pages to reference. This requires no coding experience: 17 | just open the file and find the area that looks like the output below (starting on line 26), then edit that. 18 | Once done, run `make` in your terminal and it will deposit a fresh RoamWeeklyPlan.alfredworkflow file in the 19 | `dist/` directory. Import that into Alfred, and you'll be all set. 20 | 21 | ## Output 22 | An example output looks like this: 23 | ``` 24 | Week:: [[October 5th, 2020]] 25 | Weekly Review:: [[Weekly Review October 5th, 2020]] 26 | ## Pages to Reference 27 | Go through these to find priorities for upcoming week. 28 | [[TODO]] 29 | [[Goals]] 30 | [[📝 Projects]] 31 | [[📓 Article Ideas]] 32 | [[🧠 Research]] 33 | ## Top Priorities 34 | ## Daily Goals 35 | Monday: [[October 5th, 2020]] 36 | Tuesday: [[October 6th, 2020]] 37 | Wednesday: [[October 7th, 2020]] 38 | Thursday: [[October 8th, 2020]] 39 | Friday: [[October 9th, 2020]] 40 | Saturday: [[October 10th, 2020]] 41 | Sunday: [[October 11th, 2020]] 42 | ## [[Daily Habits]] 43 | If these have a daily notes attribute, add what you did to those. 44 | Habit 1 45 | {{[[TODO]]}} [[October 5th, 2020]] 46 | {[[TODO]]} [[October 6th, 2020]] 47 | {[[TODO]]} [[October 7th, 2020]] 48 | {[[TODO]]} [[October 8th, 2020]] 49 | {[[TODO]]} [[October 9th, 2020]] 50 | {[[TODO]]} [[October 10th, 2020]] 51 | {[[TODO]]} [[October 11th, 2020]] 52 | [More habits here...] 53 | ``` 54 | 55 | Enjoyed this workflow? [Buy me a beer!](https://www.buymeacoffee.com/kylestratis) 56 | -------------------------------------------------------------------------------- /dist/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kylestratis/roam-weekly-plan/a0e36ed168f3d503df6982e0a7074a51230d58eb/dist/.empty -------------------------------------------------------------------------------- /dist/RoamWeeklyPlan.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kylestratis/roam-weekly-plan/a0e36ed168f3d503df6982e0a7074a51230d58eb/dist/RoamWeeklyPlan.alfredworkflow -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kylestratis/roam-weekly-plan/a0e36ed168f3d503df6982e0a7074a51230d58eb/src/icon.png -------------------------------------------------------------------------------- /src/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.alfredapp.kylestratis.roamweeklyplan 7 | category 8 | Productivity 9 | connections 10 | 11 | 22FCDD2E-1014-4098-A6F0-3A8746773641 12 | 13 | 14 | destinationuid 15 | 9CEE8301-5DFC-464D-8DD4-ABE18B213812 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | 9CEE8301-5DFC-464D-8DD4-ABE18B213812 25 | 26 | 27 | destinationuid 28 | EB9DC66D-E14E-4D51-9DFC-3772C2CF609F 29 | modifiers 30 | 0 31 | modifiersubtext 32 | 33 | vitoclose 34 | 35 | 36 | 37 | 38 | createdby 39 | Kyle Stratis 40 | description 41 | Generates a Weekly Plan for Roam 42 | disabled 43 | 44 | name 45 | Roam Weekly Plan 46 | objects 47 | 48 | 49 | config 50 | 51 | focusedappvariable 52 | 53 | focusedappvariablename 54 | 55 | keyword 56 | xrwp 57 | 58 | type 59 | alfred.workflow.trigger.snippet 60 | uid 61 | 22FCDD2E-1014-4098-A6F0-3A8746773641 62 | version 63 | 1 64 | 65 | 66 | config 67 | 68 | autopaste 69 | 70 | clipboardtext 71 | {query} 72 | ignoredynamicplaceholders 73 | 74 | transient 75 | 76 | 77 | type 78 | alfred.workflow.output.clipboard 79 | uid 80 | EB9DC66D-E14E-4D51-9DFC-3772C2CF609F 81 | version 82 | 3 83 | 84 | 85 | config 86 | 87 | concurrently 88 | 89 | escaping 90 | 68 91 | script 92 | python weekly_plan.py 93 | scriptargtype 94 | 0 95 | scriptfile 96 | 97 | type 98 | 0 99 | 100 | type 101 | alfred.workflow.action.script 102 | uid 103 | 9CEE8301-5DFC-464D-8DD4-ABE18B213812 104 | version 105 | 2 106 | 107 | 108 | readme 109 | This generates a weekly plan template for Roam for the next week, inspired by both of Nat Eliason's Effortless Output with Roam courses 110 | uidata 111 | 112 | 22FCDD2E-1014-4098-A6F0-3A8746773641 113 | 114 | xpos 115 | 15 116 | ypos 117 | 90 118 | 119 | 9CEE8301-5DFC-464D-8DD4-ABE18B213812 120 | 121 | xpos 122 | 200 123 | ypos 124 | 90 125 | 126 | EB9DC66D-E14E-4D51-9DFC-3772C2CF609F 127 | 128 | xpos 129 | 400 130 | ypos 131 | 90 132 | 133 | 134 | variablesdontexport 135 | 136 | version 137 | {{VERSION}} 138 | webaddress 139 | http://kylestratis.com 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/weekly_plan.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import sys 3 | import datetime 4 | 5 | 6 | def suffix(d): 7 | return "th" if 11 <= d <= 13 else {1: "st", 2: "nd", 3: "rd"}.get(d % 10, "th") 8 | 9 | 10 | def custom_strftime(fmt, t): 11 | return t.strftime(fmt).replace("{S}", str(t.day) + suffix(t.day)) 12 | 13 | 14 | def next_week(): 15 | today = datetime.date.today() 16 | next_monday = today + datetime.timedelta(days=-today.weekday(), weeks=1) 17 | return [ 18 | custom_strftime("%B {S}, %Y", next_monday + datetime.timedelta(days=i)) 19 | for i in range(0, 7) 20 | ] 21 | 22 | 23 | def generate_template(): 24 | week = next_week() 25 | template = """ 26 | Week:: [[{monday}]] 27 | Weekly Review:: [[Weekly Review {monday}]] 28 | ## Pages to Reference 29 | Go through these to find priorities for upcoming week. 30 | [[TODO]] 31 | [[Goals]] 32 | [[📝 Projects]] 33 | [[🎥 Video Ideas]] 34 | [[📓 Article Ideas]] 35 | [[🧠 Research]] 36 | ## Top Priorities 37 | 1 article or video, 1 project, 1-2 books and/or courses from above. Individual tasks filter to daily goals. 38 | ## Daily Goals 39 | Monday: [[{monday}]] 40 | Tuesday: [[{tuesday}]] 41 | Wednesday: [[{wednesday}]] 42 | Thursday: [[{thursday}]] 43 | Friday: [[{friday}]] 44 | Saturday: [[{saturday}]] 45 | Sunday: [[{sunday}]] 46 | ## [[Daily Habits]] 47 | If these have a daily notes attribute, add what you did to those. 48 | Habit 1 - Daily example 49 | {{{{[[TODO]]}}}} [[{monday}]] 50 | {{{{[[TODO]]}}}} [[{tuesday}]] 51 | {{{{[[TODO]]}}}} [[{wednesday}]] 52 | {{{{[[TODO]]}}}} [[{thursday}]] 53 | {{{{[[TODO]]}}}} [[{friday}]] 54 | {{{{[[TODO]]}}}} [[{saturday}]] 55 | {{{{[[TODO]]}}}} [[{sunday}]] 56 | Habit 2 - Weekend example 57 | {{{{[[TODO]]}}}} [[{saturday}]] 58 | {{{{[[TODO]]}}}} [[{sunday}]] 59 | Habit 3 - Once a week example 60 | {{{{[[TODO]]}}}} [[{wednesday}]] 61 | """.format( 62 | monday=week[0], 63 | tuesday=week[1], 64 | wednesday=week[2], 65 | thursday=week[3], 66 | friday=week[4], 67 | saturday=week[5], 68 | sunday=week[6], 69 | ) 70 | return template 71 | 72 | 73 | s = generate_template() 74 | sys.stdout.write(s) 75 | -------------------------------------------------------------------------------- /version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git describe --always --tags --dirty | sed -e 's/^v//' 4 | --------------------------------------------------------------------------------