From 5fe5316072ac38f6a5d58fd408cc0b042de33a4b Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Sat, 9 Nov 2024 18:21:55 +0000 Subject: [PATCH 01/19] TEMP files this is temporary - we probably want to not just use codefencing and use commented out hugo shortcodes so the task lists still work on github. However we also don't want this sort of glob of code and it makes sense to rationalise all these various ways of getting objectives in order to make the success page cleaner. But that's a task for a clearer head than I currently have, so here, a quick fix so annotation can proceed without breaking the build --- common-theme/layouts/shortcodes/objectives.html | 11 +++++++++++ common-theme/layouts/shortcodes/tasks.html | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 common-theme/layouts/shortcodes/objectives.html create mode 100644 common-theme/layouts/shortcodes/tasks.html diff --git a/common-theme/layouts/shortcodes/objectives.html b/common-theme/layouts/shortcodes/objectives.html new file mode 100644 index 000000000..8da019712 --- /dev/null +++ b/common-theme/layouts/shortcodes/objectives.html @@ -0,0 +1,11 @@ +{{ $items := slice }} +{{ $objectives := split .Inner "\n" }} +{{ range $objectives }} + {{ $objective := replace . "- [ ] " "" }} + {{ if ne (trim $objective " ") "" }} + {{ $items = $items | append $objective }} + {{ end }} +{{ end }} +{{ with $items }} + {{ partial "objectives/block" . }} +{{ end }} diff --git a/common-theme/layouts/shortcodes/tasks.html b/common-theme/layouts/shortcodes/tasks.html new file mode 100644 index 000000000..111f4f624 --- /dev/null +++ b/common-theme/layouts/shortcodes/tasks.html @@ -0,0 +1,12 @@ +{{ $items := slice }} +{{ $objectives := split .Inner "\n" }} +{{ range $objectives }} + {{ $objective := replace . "- [ ] " "" }} + {{ if ne (trim $objective " ") "" }} + {{ $items = $items | append $objective }} + {{ end }} +{{ end }} +{{ with $items }} + {{ partial "objectives/block" . }} +{{ end }} + From 9cc8f58f6f71a926dc20b61e54cb83bd3e545a2a Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 19:09:25 +0000 Subject: [PATCH 02/19] extract get list partial --- .../_markup/render-codeblock-objectives.html | 12 +----------- .../_default/_markup/render-codeblock-tasks.html | 1 + .../layouts/partials/objectives/get-list.html | 12 ++++++++++++ common-theme/layouts/shortcodes/objectives.html | 12 +----------- common-theme/layouts/shortcodes/tasks.html | 13 +------------ 5 files changed, 16 insertions(+), 34 deletions(-) create mode 100644 common-theme/layouts/_default/_markup/render-codeblock-tasks.html create mode 100644 common-theme/layouts/partials/objectives/get-list.html diff --git a/common-theme/layouts/_default/_markup/render-codeblock-objectives.html b/common-theme/layouts/_default/_markup/render-codeblock-objectives.html index 8da019712..0d3a89b4b 100644 --- a/common-theme/layouts/_default/_markup/render-codeblock-objectives.html +++ b/common-theme/layouts/_default/_markup/render-codeblock-objectives.html @@ -1,11 +1 @@ -{{ $items := slice }} -{{ $objectives := split .Inner "\n" }} -{{ range $objectives }} - {{ $objective := replace . "- [ ] " "" }} - {{ if ne (trim $objective " ") "" }} - {{ $items = $items | append $objective }} - {{ end }} -{{ end }} -{{ with $items }} - {{ partial "objectives/block" . }} -{{ end }} +{{ partial "objectives/get-list" .Inner }} diff --git a/common-theme/layouts/_default/_markup/render-codeblock-tasks.html b/common-theme/layouts/_default/_markup/render-codeblock-tasks.html new file mode 100644 index 000000000..0d3a89b4b --- /dev/null +++ b/common-theme/layouts/_default/_markup/render-codeblock-tasks.html @@ -0,0 +1 @@ +{{ partial "objectives/get-list" .Inner }} diff --git a/common-theme/layouts/partials/objectives/get-list.html b/common-theme/layouts/partials/objectives/get-list.html new file mode 100644 index 000000000..2f4ce3e95 --- /dev/null +++ b/common-theme/layouts/partials/objectives/get-list.html @@ -0,0 +1,12 @@ +{{ $items := slice }} +{{ $inner := . }} +{{ $objectives := split $inner "\n" }} +{{ range $objectives }} + {{ $objective := replace . "- [ ] " "" }} + {{ if ne (trim $objective " ") "" }} + {{ $items = $items | append $objective }} + {{ end }} +{{ end }} +{{ with $items }} + {{ partial "objectives/block" . }} +{{ end }} diff --git a/common-theme/layouts/shortcodes/objectives.html b/common-theme/layouts/shortcodes/objectives.html index 8da019712..0d3a89b4b 100644 --- a/common-theme/layouts/shortcodes/objectives.html +++ b/common-theme/layouts/shortcodes/objectives.html @@ -1,11 +1 @@ -{{ $items := slice }} -{{ $objectives := split .Inner "\n" }} -{{ range $objectives }} - {{ $objective := replace . "- [ ] " "" }} - {{ if ne (trim $objective " ") "" }} - {{ $items = $items | append $objective }} - {{ end }} -{{ end }} -{{ with $items }} - {{ partial "objectives/block" . }} -{{ end }} +{{ partial "objectives/get-list" .Inner }} diff --git a/common-theme/layouts/shortcodes/tasks.html b/common-theme/layouts/shortcodes/tasks.html index 111f4f624..0d3a89b4b 100644 --- a/common-theme/layouts/shortcodes/tasks.html +++ b/common-theme/layouts/shortcodes/tasks.html @@ -1,12 +1 @@ -{{ $items := slice }} -{{ $objectives := split .Inner "\n" }} -{{ range $objectives }} - {{ $objective := replace . "- [ ] " "" }} - {{ if ne (trim $objective " ") "" }} - {{ $items = $items | append $objective }} - {{ end }} -{{ end }} -{{ with $items }} - {{ partial "objectives/block" . }} -{{ end }} - +{{ partial "objectives/get-list" .Inner }} From 7602d5355b543b1b415c6bf94c7f2d5d8b2be53f Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 19:23:50 +0000 Subject: [PATCH 03/19] allow tasks and show example tasks shows up in the same place on the block, but doesn't come through to success --- common-content/en/energisers/blockers/index.md | 2 +- common-theme/layouts/partials/block/local.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common-content/en/energisers/blockers/index.md b/common-content/en/energisers/blockers/index.md index def637b5f..36c51d4bc 100644 --- a/common-content/en/energisers/blockers/index.md +++ b/common-content/en/energisers/blockers/index.md @@ -2,7 +2,7 @@ title="Blockers!" emoji="πŸš—" time=25 -[objectives] +[tasks] 1="Use the driver and navigator pattern" 2="Break down a problem into steps" 3="Negotiate a strategy with your team" diff --git a/common-theme/layouts/partials/block/local.html b/common-theme/layouts/partials/block/local.html index c15f9985d..5a827eff1 100644 --- a/common-theme/layouts/partials/block/local.html +++ b/common-theme/layouts/partials/block/local.html @@ -18,7 +18,7 @@ {{ partial "time.html" . }} - {{ with $block.Params.Objectives }} + {{ with or $block.Params.Objectives $block.Params.Tasks }}

Learning Objectives

{{ partial "objectives/block.html" . }} From cbe1665fbd2ca62f94ecae4d082579a49854be80 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 20:48:02 +0000 Subject: [PATCH 04/19] simplify parsing and lookup objectives --- common-theme/layouts/_default/success.html | 9 ++-- .../layouts/partials/objectives/get-list.html | 21 ++++++---- .../layouts/partials/objectives/lookup.html | 8 ++-- .../layouts/partials/objectives/parsed.html | 42 +++++++------------ 4 files changed, 38 insertions(+), 42 deletions(-) diff --git a/common-theme/layouts/_default/success.html b/common-theme/layouts/_default/success.html index 5d3ac6356..92579d989 100644 --- a/common-theme/layouts/_default/success.html +++ b/common-theme/layouts/_default/success.html @@ -28,6 +28,9 @@ {{ partial "time.html" $pageContext }} + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $decodedContent }} + {{ if gt (len $extractedObjectives) 0 }} +
+

Learning Objectives

+ {{ range $extractedObjectives }} + {{ . | markdownify }} + {{ end }} +
+ {{ end }}
- {{ $decodedContent := $response.content | base64Decode }} {{ $strippedComments := $decodedContent | replaceRE "" "$1" }} {{ $externalPath := replace $response.download_url $response.name "" }} {{/* TODO this replaces the call to the absolute-image-paths partial as it was breaking the markdownifying -- @@ -35,7 +44,9 @@ */}} {{/* Replace Markdown image links, targeting anything without a : */}} {{ $processedContent := $strippedComments | replaceRE `!\[([^\]]+)\]\(([^"http:\/\/|https:\/\/][^)]+)\)` (printf "![$1](%s$2)" $externalPath) }} - {{ $processedContent | markdownify }} + {{ $textWithoutObjectives := partial "strings/remove-github-objectives.html" $processedContent }} + {{ $textWithoutObjectives | markdownify }} +
{{/* You can attach a range of nested blocks as options diff --git a/common-theme/layouts/partials/strings/extract-github-objectives.html b/common-theme/layouts/partials/strings/extract-github-objectives.html index 5b3b81ef1..12eaea044 100644 --- a/common-theme/layouts/partials/strings/extract-github-objectives.html +++ b/common-theme/layouts/partials/strings/extract-github-objectives.html @@ -1,8 +1,11 @@ +{{ $strippedText := . | replaceRE "" "" }} + {{/* Find fenced objectives in text */}} {{ $regexFence := "```objectives\\s*([^`]*?)\\s*```" }} -{{ $extractedObjectives := findRE $regexFence . }} +{{ $extractedObjectives := findRE $regexFence $strippedText }} {{/* Find shortcoded objectives in text */}} -{{ $regexShortcode := "{{< objectives >}}([^`]*?){{< /objectives >}}" }} -{{ $extractedObjectives = $extractedObjectives| append (findRE $regexShortcode .) }} + +{{ $regexShortcode := "{{}}([^`]*?){{}}" }} +{{ $extractedObjectives = $extractedObjectives | append (findRE $regexShortcode $strippedText) }} {{ return $extractedObjectives }} diff --git a/common-theme/layouts/partials/strings/remove-github-objectives.html b/common-theme/layouts/partials/strings/remove-github-objectives.html index e3dbf40fd..2551fdd6e 100644 --- a/common-theme/layouts/partials/strings/remove-github-objectives.html +++ b/common-theme/layouts/partials/strings/remove-github-objectives.html @@ -5,7 +5,12 @@ {{ $textWithoutObjectives := replaceRE $regexFence "" . }} {{/* Find shortcoded objectives in text */}} -{{ $regexShortcode := "{{< objectives >}}([^`]*?){{< /objectives >}}" }} + +{{ $regexShortcode := "{{}}([^`]*?){{}}" }} {{ $textWithoutObjectives = replaceRE $regexShortcode "" $textWithoutObjectives }} +{{/* Find and remove headings that contain "earning objective" */}} +{{ $regexHeading := "(?im)^#{1,6}\\s*[^\\n]*earning\\s*objective[^\\n]*$" }} +{{ $textWithoutObjectives = $textWithoutObjectives | replaceRE $regexHeading "" }} + {{ return $textWithoutObjectives }} From 1ccb8720b2c8b1754ea8b6e39a47e7ab3ac69a27 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 23:29:39 +0000 Subject: [PATCH 07/19] weird windows line endings in issues api? --- .../layouts/partials/strings/extract-github-objectives.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common-theme/layouts/partials/strings/extract-github-objectives.html b/common-theme/layouts/partials/strings/extract-github-objectives.html index 12eaea044..d00789d3b 100644 --- a/common-theme/layouts/partials/strings/extract-github-objectives.html +++ b/common-theme/layouts/partials/strings/extract-github-objectives.html @@ -1,4 +1,4 @@ -{{ $strippedText := . | replaceRE "" "" }} +{{ $strippedText := . | replaceRE "" "" | replaceRE "\r\n" "\n" }} {{/* Find fenced objectives in text */}} {{ $regexFence := "```objectives\\s*([^`]*?)\\s*```" }} @@ -8,4 +8,8 @@ {{ $regexShortcode := "{{}}([^`]*?){{}}" }} {{ $extractedObjectives = $extractedObjectives | append (findRE $regexShortcode $strippedText) }} + + + + {{ return $extractedObjectives }} From e43a07577f8c8e6ce8795022cd59d544eba358df Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 23:45:37 +0000 Subject: [PATCH 08/19] bump energisers and ops blocks to tasks they won't show up in success any more --- common-content/en/blocks/backlog/index.md | 2 +- common-content/en/blocks/coming-soon/index.md | 2 +- common-content/en/blocks/evaluate/index.md | 2 +- .../en/blocks/morning-orientation/index.md | 2 +- common-content/en/blocks/study-group/index.md | 2 +- common-content/en/blocks/workshop/index.md | 2 +- .../en/energisers/18-and-unders/index.md | 2 +- .../en/energisers/bad-interview-answers/index.md | 2 +- .../en/energisers/confident-presenting/index.md | 15 +++++++++------ common-content/en/energisers/fizz-buzz/index.md | 2 +- .../en/energisers/introduce-yourself/index.md | 11 ++++++----- .../en/energisers/popcorn-screen-share/index.md | 2 +- common-content/en/energisers/popcorn/index.md | 2 +- common-content/en/energisers/telephone/index.md | 2 +- .../en/energisers/time-traveller/index.md | 2 +- common-content/en/energisers/wemoji/index.md | 2 +- .../en/energisers/zip-zap-boing/index.md | 2 +- 17 files changed, 30 insertions(+), 26 deletions(-) diff --git a/common-content/en/blocks/backlog/index.md b/common-content/en/blocks/backlog/index.md index daa4c4a3c..3d7dbd704 100644 --- a/common-content/en/blocks/backlog/index.md +++ b/common-content/en/blocks/backlog/index.md @@ -4,7 +4,7 @@ title="Backlog" time= 30 vocabulary="Backlog" hide_from_overview=true -[objectives] +[tasks] 1="Find the backlog" 2="Copy your tickets to your own backlog" 3="Manage your tickets on your board" diff --git a/common-content/en/blocks/coming-soon/index.md b/common-content/en/blocks/coming-soon/index.md index acd3f31c9..0f9620e9a 100644 --- a/common-content/en/blocks/coming-soon/index.md +++ b/common-content/en/blocks/coming-soon/index.md @@ -4,7 +4,7 @@ description = 'This content is coming soon' time = 20 facilitation = false emoji= '🌫️' -[objectives] +[tasks] 1='Find the plan in Slack instead' [build] list = 'never' diff --git a/common-content/en/blocks/evaluate/index.md b/common-content/en/blocks/evaluate/index.md index b70f5e264..891b8d2f9 100644 --- a/common-content/en/blocks/evaluate/index.md +++ b/common-content/en/blocks/evaluate/index.md @@ -2,7 +2,7 @@ title="Evaluate ✏️" time= 60 -[objectives] +[tasks] 1="Evaluate your current progress against previous modules" [build] render = 'never' diff --git a/common-content/en/blocks/morning-orientation/index.md b/common-content/en/blocks/morning-orientation/index.md index c415eb005..7799a7fca 100644 --- a/common-content/en/blocks/morning-orientation/index.md +++ b/common-content/en/blocks/morning-orientation/index.md @@ -2,7 +2,7 @@ title="🎑 Morning orientation" time=15 -[objectives] +[tasks] 1="Introduce and welcome new volunteers" 2="Nominate a timekeeper" 3="Check the morning day plan and group structures" diff --git a/common-content/en/blocks/study-group/index.md b/common-content/en/blocks/study-group/index.md index 121b5fdb8..b48d1c7cc 100644 --- a/common-content/en/blocks/study-group/index.md +++ b/common-content/en/blocks/study-group/index.md @@ -1,6 +1,6 @@ +++ title="Study Group" -objectives=["Resolve blockers in your coursework", "Express and resolve problems effectively by writing tickets and asking questions", "Give and receive code review", "Develop your personal portfolio", "Pair programme", "Evaluate your progress with peers and mentors"] +tasks=["Resolve blockers in your coursework", "Express and resolve problems effectively by writing tickets and asking questions", "Give and receive code review", "Develop your personal portfolio", "Pair programme", "Evaluate your progress with peers and mentors"] time=60 [build] render = 'never' diff --git a/common-content/en/blocks/workshop/index.md b/common-content/en/blocks/workshop/index.md index 09e367ab1..e685645d9 100644 --- a/common-content/en/blocks/workshop/index.md +++ b/common-content/en/blocks/workshop/index.md @@ -3,7 +3,7 @@ title = '🧰 Workshop Activity' time = 120 emoji= '🧰' -[objectives] +[tasks] 1='Apply concepts from study to a practical example' 2='Work together on exercises and activities to find gaps in understanding' 3='Describe and resolve mental model errors' diff --git a/common-content/en/energisers/18-and-unders/index.md b/common-content/en/energisers/18-and-unders/index.md index 8a0e63c36..5c1ab5f45 100644 --- a/common-content/en/energisers/18-and-unders/index.md +++ b/common-content/en/energisers/18-and-unders/index.md @@ -2,7 +2,7 @@ title="18 and under" emoji="πŸ§’" time=10 -[objectives] +[tasks] 1="Share any interesting fact about you when you were young" 2="Discover hidden skills of your peers" [build] diff --git a/common-content/en/energisers/bad-interview-answers/index.md b/common-content/en/energisers/bad-interview-answers/index.md index 97e6704d0..1d86d0e17 100644 --- a/common-content/en/energisers/bad-interview-answers/index.md +++ b/common-content/en/energisers/bad-interview-answers/index.md @@ -3,7 +3,7 @@ title="Bad Interview Answers" emoji="πŸ€¦β€β™‚οΈ" hide_from_overview=true time=15 -[objectives] +[tasks] 1="Wake up" 3="Have a laugh" [build] diff --git a/common-content/en/energisers/confident-presenting/index.md b/common-content/en/energisers/confident-presenting/index.md index 14d790c30..df0795961 100644 --- a/common-content/en/energisers/confident-presenting/index.md +++ b/common-content/en/energisers/confident-presenting/index.md @@ -1,7 +1,7 @@ +++ title="Confident Presenting!" time=15 -[objectives] +[tasks] 1="Trainee can strike a power pose" 2="Trainee has experience with confidently introducing themselves" [build] @@ -15,15 +15,18 @@ time=15 Get everyone standing for this exercise! 1. Start by everyone demonstrating unconfident poses -2. Get everyone moving with a quick stretch or power pose to break the ice and release tension. - - Superman pose – feet shoulder-width apart, hands on hips, chest out. - - The victor - hands up in the air in a V and feet apart - - Any others? -3. In a power pose of your choosing go around the room and ask everyone to say their name in the most exaggerated, enthusiastic way possible, like they’re introducing themselves to a stadium of people. +2. Get everyone moving with a quick stretch or power pose to break the ice and release tension. + +- Superman pose – feet shoulder-width apart, hands on hips, chest out. +- The victor - hands up in the air in a V and feet apart +- Any others? + +3. In a power pose of your choosing go around the room and ask everyone to say their name in the most exaggerated, enthusiastic way possible, like they’re introducing themselves to a stadium of people. > [!WARNING] > This is not proven science. This is just a fun game to get everyone up and moving around! # Resources on Confident Presenting + - [Make Body Language Your Superpower](https://www.youtube.com/watch?v=cFLjudWTuGQ&ab_channel=StanfordGraduateSchoolofBusiness) - [Alter Ego: How having an alter ego empowers you](https://www.bbc.com/worklife/article/20200817-the-batman-effect-how-having-an-alter-ego-empowers-you) diff --git a/common-content/en/energisers/fizz-buzz/index.md b/common-content/en/energisers/fizz-buzz/index.md index 73586e6ad..810a1d9a0 100644 --- a/common-content/en/energisers/fizz-buzz/index.md +++ b/common-content/en/energisers/fizz-buzz/index.md @@ -3,7 +3,7 @@ title="Fizz Buzz" emoji="πŸ”’" hide_from_overview=true time=20 -[objectives] +[tasks] 1="Execute mental arithmetic and divisibility rules" 3="Listen actively and coordinate with others" [build] diff --git a/common-content/en/energisers/introduce-yourself/index.md b/common-content/en/energisers/introduce-yourself/index.md index e1031681f..fb37ed1b2 100644 --- a/common-content/en/energisers/introduce-yourself/index.md +++ b/common-content/en/energisers/introduce-yourself/index.md @@ -2,7 +2,7 @@ title=" Introduce Yourself!" emoji="πŸŽ™οΈ" time=20 -objectives=["Introduce yourself in 30 seconds", "Learn two key facts about each other"] +tasks=["Introduce yourself in 30 seconds", "Learn two key facts about each other"] [build] render = 'never' list = 'local' @@ -13,16 +13,17 @@ objectives=["Introduce yourself in 30 seconds", "Learn two key facts about each In your professional life, you will often be asked to introduce yourself. It is a good idea to have an [elevator pitch](https://careerdevelopment.princeton.edu/sites/g/files/toruqf1041/files/media/elevator_pitch.pdf) ready, a brief (30 seconds) way of introducing yourself, getting across a key point or two, and making a connection with someone. -Today we will be going around the room and introducing ourselves! ` +Today we will be going around the room and introducing ourselves! ` Facilitator(s) start by sharing your elevator pitch and then popcorn around the room. Some tips: + - Your response should be around 30 seconds. - Have a list of items ready but tailor what you say to your audience. For example, at a technical conference focus on your technical interests rather than your love of making cupcakes, but on the first day of a new job introducing yourself to your new team feel free to add 1-2 personal details. -- Try to structure your response, - - Who are you? Where are you from? Where have you worked? Have you studied somewhere and what subjects? - - What do you do? What are your skills, passions, or hobbies? What motivates you? +- Try to structure your response, + - Who are you? Where are you from? Where have you worked? Have you studied somewhere and what subjects? + - What do you do? What are your skills, passions, or hobbies? What motivates you? - Try to be enthusiastic, let your personality and confidence shine - Allow space for follow-up questions - It will feel awkward and nerve-wracking the first couple of times, practice-practice-practice to feel confident diff --git a/common-content/en/energisers/popcorn-screen-share/index.md b/common-content/en/energisers/popcorn-screen-share/index.md index 62a63278c..f4b3d9452 100644 --- a/common-content/en/energisers/popcorn-screen-share/index.md +++ b/common-content/en/energisers/popcorn-screen-share/index.md @@ -2,7 +2,7 @@ title="Screen Safari" emoji="πŸ–₯️" time=15 -[objectives] +[tasks] 1="Practice screen sharing functionality" 2="Build comfort with sharing digital workspace" [build] diff --git a/common-content/en/energisers/popcorn/index.md b/common-content/en/energisers/popcorn/index.md index 07c6f7994..95e3410b5 100644 --- a/common-content/en/energisers/popcorn/index.md +++ b/common-content/en/energisers/popcorn/index.md @@ -2,7 +2,7 @@ title="Popcorn Show and Tell" emoji="🍿" time=10 -[objectives] +[tasks] 1="Practice popcorning participation in meetings" 2="Share quick personal insights" [build] diff --git a/common-content/en/energisers/telephone/index.md b/common-content/en/energisers/telephone/index.md index ccf5cc3ed..6a9d0413f 100644 --- a/common-content/en/energisers/telephone/index.md +++ b/common-content/en/energisers/telephone/index.md @@ -3,7 +3,7 @@ title="Telephone!" emoji="πŸ“ž" hide_from_overview=true time=15 -[objectives] +[tasks] 1="Transmit a message accurately through multiple people" 2="Identify points of miscommunication in the final message" 4="Demonstrate active listening by repeating a message verbatim" diff --git a/common-content/en/energisers/time-traveller/index.md b/common-content/en/energisers/time-traveller/index.md index 7eb4b3e8a..42a421b4e 100644 --- a/common-content/en/energisers/time-traveller/index.md +++ b/common-content/en/energisers/time-traveller/index.md @@ -2,7 +2,7 @@ title="Time traveller" emoji="⏰" time=30 -[objectives] +[tasks] 1="Hear the experience of a CYF alumni" 2="Ask questions about their experience" [build] diff --git a/common-content/en/energisers/wemoji/index.md b/common-content/en/energisers/wemoji/index.md index 89c7b4b2f..0af529df1 100644 --- a/common-content/en/energisers/wemoji/index.md +++ b/common-content/en/energisers/wemoji/index.md @@ -2,7 +2,7 @@ title="Wemoji" emoji="πŸ˜€πŸ˜’πŸ˜²" time=10 -[objectives] +[tasks] 1="Express emojis using only facial expressions and body language" 2="Identify emojis from facial expressions and body language" [build] diff --git a/common-content/en/energisers/zip-zap-boing/index.md b/common-content/en/energisers/zip-zap-boing/index.md index 876446fe3..ca0ee73a1 100644 --- a/common-content/en/energisers/zip-zap-boing/index.md +++ b/common-content/en/energisers/zip-zap-boing/index.md @@ -3,7 +3,7 @@ title="Zip Zap Boing!" emoji="⚑" hide_from_overview=true time=15 -[objectives] +[tasks] 1="Coordinate group movement and attention" 3="Energise the group and create a fun atmosphere" [build] From 9154978309586185436c704ff6cc161c44df6a1c Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 23:54:31 +0000 Subject: [PATCH 09/19] document tasks --- .../front-matter/blocks/tasks/index.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common-docs/content/common-theme/front-matter/blocks/tasks/index.md diff --git a/common-docs/content/common-theme/front-matter/blocks/tasks/index.md b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md new file mode 100644 index 000000000..b7d159465 --- /dev/null +++ b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md @@ -0,0 +1,21 @@ ++++ +title = 'Tasks' +time = 2 +emoji= '🧩' +[tasks] + 1='Use the Teach Tech Together guide to construct your objectives' + 2='Limit the objectives to 3-5 items' + 3='Write objectives you can measure' +[build] + render = 'never' + list = 'local' + publishResources = false ++++ + +```toml +tasks = ["Write objectives you can measure", "Tasks are objectives that aren't passed to success view or overviews"] +``` + +This is a list of tasks for a block. They look the same as learning objectives and should be formulated in the same way. However, tasks will not show up in the success view for any sprint this block is added to. They will only show up on the block itself when rendered on to a page. + +Structured objectives are important for organising and focusing the learning time of our community. But repetitive or purely operational tasks like "Nominate a timekeeper" or "Take a break" don't need to be collated and tracked by the learner like objectives do. They are just tasks that need to be done to complete the activity. From ecb291b0abdb5846475533d974d1784085288b35 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Mon, 2 Dec 2024 23:54:55 +0000 Subject: [PATCH 10/19] show objectives on issues --- common-theme/layouts/partials/issues.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/common-theme/layouts/partials/issues.html b/common-theme/layouts/partials/issues.html index 1220dc3d9..e23ccba3a 100644 --- a/common-theme/layouts/partials/issues.html +++ b/common-theme/layouts/partials/issues.html @@ -56,7 +56,23 @@ Clone -
{{ .body | markdownify }}
+ +
+ {{/* extract objectives */}} + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" .body }} + + {{ if gt (len $extractedObjectives) 0 }} +
+ +

Learning Objectives

+
+ {{ range $extractedObjectives }} + {{ . | markdownify }} + {{ end }} +
+ {{ end }} + {{ .body | markdownify }} +
{{ with .labels }}
    From e766031679ca7c89b751032738e8f186545a1bd2 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Tue, 3 Dec 2024 08:51:12 +0000 Subject: [PATCH 11/19] add issue objectives to single issue --- common-theme/layouts/partials/block/issue.html | 13 +++++++++++++ .../layouts/partials/objectives/parsed.html | 14 ++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/common-theme/layouts/partials/block/issue.html b/common-theme/layouts/partials/block/issue.html index a8308a604..adc20a5bf 100644 --- a/common-theme/layouts/partials/block/issue.html +++ b/common-theme/layouts/partials/block/issue.html @@ -22,6 +22,19 @@ {{ end }} {{ end }} + {{/* extract objectives */}} + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response.body }} + + {{ if gt (len $extractedObjectives) 0 }} +
    + +

    Learning Objectives

    +
    + {{ range $extractedObjectives }} + {{ . | markdownify }} + {{ end }} +
    + {{ end }}
    {{ $response.body | markdownify }}
    diff --git a/common-theme/layouts/partials/objectives/parsed.html b/common-theme/layouts/partials/objectives/parsed.html index c5315c696..76e0faf3c 100644 --- a/common-theme/layouts/partials/objectives/parsed.html +++ b/common-theme/layouts/partials/objectives/parsed.html @@ -1,5 +1,6 @@ {{ $response := resources.GetRemote .blockData.api .blockData.headers }} -{{ $showTitle := .showTitle |default false }} +{{ $blockType := .blockData.type }} +{{ $showTitle := .showTitle | default false }} {{/* 404s lead to GetRemote returning nil rather than an error. */}} {{ if eq $response nil }} {{ errorf "Couldn't find anything at %s" .blockData.api }} @@ -7,10 +8,15 @@ {{ with $response }} {{ $response := .Content | unmarshal }} + {{/* readme and issue responses are a tiny bit different but not enough to warrant different partials */}} + {{ if eq $blockType "readme" }} + {{ $response = $response.content | base64Decode }} + {{ end }} + {{ if eq $blockType "issue" }} + {{ $response = $response.body }} + {{ end }} - {{ $decodedContent := $response.content | base64Decode }} - - {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $decodedContent }} + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response }} {{ if gt (len $extractedObjectives) 0 }} {{ if $showTitle }}
    {{ $showTitle }}
    {{ end }} {{ range $extractedObjectives }} From ffe7635ec617e58e3471ab2755f1789fe3dc49fb Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Tue, 3 Dec 2024 09:34:57 +0000 Subject: [PATCH 12/19] pop in issues list objectives --- .../partials/objectives/issues-list.html | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 common-theme/layouts/partials/objectives/issues-list.html diff --git a/common-theme/layouts/partials/objectives/issues-list.html b/common-theme/layouts/partials/objectives/issues-list.html new file mode 100644 index 000000000..8a424afdb --- /dev/null +++ b/common-theme/layouts/partials/objectives/issues-list.html @@ -0,0 +1,43 @@ +{{/* This partial belongs to the sprint success page */}} +{{ $repo := .backlog }} +{{ $filter := .backlog_filter }} +{{ $issuesUrl := print site.Params.orgapi $repo "/issues?per_page=100&state=open&direction=asc" }} +{{ $headers := partial "github-auth.html" }} + +{{ with resources.GetRemote $issuesUrl $headers }} + {{ with .Content }} + {{ if eq . "[]" }} + {{ warnf "No issues found at %s" $issuesUrl }} + {{ else }} + {{ $issues := . | unmarshal }} + {{/* */}} + {{ range $issues }} + {{ $showIssue := true }} + {{/* */}} + {{ if $filter }} + {{ $showIssue = false }} + {{ range .labels }} + {{ if in .name + $filter + }} + {{ $showIssue = true }} + {{ end }} + {{ end }} + {{ end }} + + {{ if (isset . "pull_request") }} + {{ $showIssue = false }} + {{ end }} + + + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" . }} + {{ if gt (len $extractedObjectives) 0 }} +
    {{ .title }}
    + {{ range $extractedObjectives }} + {{ . | markdownify }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} +{{ end }} From 3c7a9df504c456845bfd5a419890c7aa56b6bc01 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Tue, 3 Dec 2024 12:25:37 +0000 Subject: [PATCH 13/19] redesign with graphql 1. use graphql instead of rest 2. produce a map of "blocks" and pass into existing system --- common-theme/hugo.toml | 1 + common-theme/layouts/_default/success.html | 5 ++ common-theme/layouts/partials/block/data.html | 1 + .../partials/block/issues-list-as-blocks.html | 47 +++++++++++++++++++ .../partials/objectives/issues-list.html | 43 ----------------- org-cyf-theme/hugo.toml | 1 + 6 files changed, 55 insertions(+), 43 deletions(-) create mode 100644 common-theme/layouts/partials/block/issues-list-as-blocks.html delete mode 100644 common-theme/layouts/partials/objectives/issues-list.html diff --git a/common-theme/hugo.toml b/common-theme/hugo.toml index 3be4f2cb7..e3c68a4b4 100644 --- a/common-theme/hugo.toml +++ b/common-theme/hugo.toml @@ -34,6 +34,7 @@ startTime="10:00" # our_name = "alias for in text replacement" # org = "https://github.com/YOUR_ORG_HERE" # repo = "https://github.com/YOUR_ORG_HERE/YOUR_REPO/" +# owner = "YOUR_ORG_HERE" # root = "YOUR_REPO_I_THINK" # orgapi = "https://api.github.com/repos/YOUR_ORG_HERE/" # pdrepo = "PD-curriculum-repo" diff --git a/common-theme/layouts/_default/success.html b/common-theme/layouts/_default/success.html index 92579d989..a067e501c 100644 --- a/common-theme/layouts/_default/success.html +++ b/common-theme/layouts/_default/success.html @@ -34,11 +34,15 @@
    {{ .title }}
    - {{ range $extractedObjectives }} - {{ . | markdownify }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} -{{ end }} diff --git a/org-cyf-theme/hugo.toml b/org-cyf-theme/hugo.toml index c359466ba..7e8fdfa2c 100644 --- a/org-cyf-theme/hugo.toml +++ b/org-cyf-theme/hugo.toml @@ -44,6 +44,7 @@ description = "A free and open source software development programme." main_website = "https://codeyourfuture.io/" main_org_name = "Code Your Future" our_name="CYF" +owner = "CodeYourFuture" org = "https://github.com/CodeYourFuture" repo = "https://github.com/CodeYourFuture/curriculum/" pdrepo = "CYF-PD" From cd98c9215a4319ac4ca527caee823912c96e1aae Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Tue, 3 Dec 2024 12:26:01 +0000 Subject: [PATCH 14/19] some docs --- .../front-matter/blocks/tasks/index.md | 2 +- .../common-theme/render-hooks/tasks.md | 37 +++++++++++++++++++ .../common-theme/shortcodes/objectives.md | 36 ++++++++++++++++++ .../content/common-theme/shortcodes/tasks.md | 27 ++++++++++++++ common-docs/hugo.toml | 1 + 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 common-docs/content/common-theme/render-hooks/tasks.md create mode 100644 common-docs/content/common-theme/shortcodes/objectives.md create mode 100644 common-docs/content/common-theme/shortcodes/tasks.md diff --git a/common-docs/content/common-theme/front-matter/blocks/tasks/index.md b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md index b7d159465..1324c3945 100644 --- a/common-docs/content/common-theme/front-matter/blocks/tasks/index.md +++ b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md @@ -1,7 +1,7 @@ +++ title = 'Tasks' time = 2 -emoji= '🧩' +emoji= 'βœ…' [tasks] 1='Use the Teach Tech Together guide to construct your objectives' 2='Limit the objectives to 3-5 items' diff --git a/common-docs/content/common-theme/render-hooks/tasks.md b/common-docs/content/common-theme/render-hooks/tasks.md new file mode 100644 index 000000000..b8b054dd8 --- /dev/null +++ b/common-docs/content/common-theme/render-hooks/tasks.md @@ -0,0 +1,37 @@ ++++ +title="Tasks" +description="Assign learning objectives via render hook" +emoji="βœ…" +menu=["hooks"] ++++ + +This is a [codefence render hook](https://gohugo.io/render-hooks/code-blocks/) that allows you to assign inert learning objectives to a page. It's for pages or content sources _outside_ Hugo. You can mark up a tasks checklist on a GitHub readme, say, and then render it as a list of objectives on the page. + +Tasks are an inert form of learning objectives. They will be rendered on Hugo and GitHub as task lists. They will be shown in the learning objectives section on a block. But they will _not_ be tracked as learning objectives and won't be passed to the success criteria of a sprint. + +> [!TIP] +> You probably want [objectives](./objectives) instead. + +### Invoke + +{{}} + +```` +```tasks +- [ ] Use the objectives render hook +- [ ] Three backticks ``` +- [ ] The word objectives +- [ ] A list of objectives in a checklist +``` +```` + +<---> + +````tasks +- [ ] Use the objectives render hook +- [ ] Three backticks ``` +- [ ] The word objectives +- [ ] A list of objectives in a checklist +```` + +{{}} diff --git a/common-docs/content/common-theme/shortcodes/objectives.md b/common-docs/content/common-theme/shortcodes/objectives.md new file mode 100644 index 000000000..11508ca8b --- /dev/null +++ b/common-docs/content/common-theme/shortcodes/objectives.md @@ -0,0 +1,36 @@ ++++ +title="Objectives" +description="Passing objectives from GitHub to Hugo" +emoji="🎯" +menu=["shortcodes"] ++++ + +```go + +- [ ] Objective 1 +- [ ] Objective 2 +- [ ] Objective 3 + +``` + +{{< objectives >}} + +- [ ] Objective 1 +- [ ] Objective 2 +- [ ] Objective 3 + +{{< /objectives >}} + +If you want to add objectives from a GitHub issue or readme into your success criteria, mark up a task list and wrap it in the `objectives` shortcode. Comment out the shortcode to hide it on GitHub. + +This will render the task list on GitHub and will be picked up, rendered, and _tracked_ as learning objectives by Hugo. This means: + +1. readmes: any learning objectives on any readme added to a prep or dayplan will be added to the success criteria of that sprint +1. issues: any learning objectives on the entire backlog page will be added to the success criteria of the sprint +1. any issues added as single blocks will be added to the success criteria of the sprint, unless they have already been tracked on the backlog page +1. on any issue or readme block, learning objectives will be removed from the body and shown in the learning objectives details instead + +([Tasks](./tasks) will be rendered but not tracked.) + +> [!TIP] +> Fenced objectives will also work like this on Hugo, but on GitHub will be plain text. diff --git a/common-docs/content/common-theme/shortcodes/tasks.md b/common-docs/content/common-theme/shortcodes/tasks.md new file mode 100644 index 000000000..9b096fbc8 --- /dev/null +++ b/common-docs/content/common-theme/shortcodes/tasks.md @@ -0,0 +1,27 @@ ++++ +title="Tasks" +description="Inert objectives" +emoji="βœ…" +menu=["shortcodes"] ++++ + +```go + +- [ ] Objective 1 +- [ ] Objective 2 +- [ ] Objective 3 + +``` + +{{< tasks >}} + +- [ ] Objective 1 +- [ ] Objective 2 +- [ ] Objective 3 + +{{< /tasks >}} + +Tasks are learning objectives you want to render but not track. They will be rendered on Hugo and GitHub as task lists. They will be shown in the learning objectives section on a block. But they will NOT be tracked as learning objectives and won't be passed to the success criteria of a sprint. + +> [!TIP] +> You probably want [objectives](./objectives) instead. diff --git a/common-docs/hugo.toml b/common-docs/hugo.toml index 0849ab71b..6a6dfbc52 100644 --- a/common-docs/hugo.toml +++ b/common-docs/hugo.toml @@ -51,6 +51,7 @@ main_org_name = "Code Your Future" our_name="The Docs" org = "https://github.com/CodeYourFuture" repo = "https://github.com/CodeYourFuture/curriculum/" +owner = "CodeYourFuture" root = "curriculum" orgapi = "https://api.github.com/repos/CodeYourFuture" [caches.getresource] From 77a5b0cc7c9bda020b08077c7f423d072a234b19 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Tue, 3 Dec 2024 12:58:03 +0000 Subject: [PATCH 15/19] rename to match blocks naming --- common-theme/layouts/_default/success.html | 4 ++-- .../layouts/partials/objectives/{lookup.html => local.html} | 4 ++++ .../layouts/partials/objectives/{parsed.html => remote.html} | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) rename common-theme/layouts/partials/objectives/{lookup.html => local.html} (69%) rename common-theme/layouts/partials/objectives/{parsed.html => remote.html} (85%) diff --git a/common-theme/layouts/_default/success.html b/common-theme/layouts/_default/success.html index a067e501c..6360bb2df 100644 --- a/common-theme/layouts/_default/success.html +++ b/common-theme/layouts/_default/success.html @@ -73,9 +73,9 @@ {{ partial "time.html" . }} - {{ with or $block.Params.Objectives $block.Params.Tasks }} + {{ if or $block.Params.Objectives $block.Params.Tasks }}

    Learning Objectives

    - {{ partial "objectives/block.html" . }} + {{ with $block.Params.Objectives }} + {{ partial "objectives/block.html" . }} + {{ end }} + {{ with $block.Params.Tasks }} + {{ partial "objectives/block.html" . }} + {{ end }}
    {{ end }}
    {{ $block.Content }}