CodeYourFuture / fundamentals-blockly

CYF PRODUCT
https://blocks.codeyourfuture.io
5 stars 4 forks source link

Automate toolbox generation from exercise markdown #67

Closed sansaid closed 2 years ago

sansaid commented 2 years ago

A few changes being introduced which haven't been tested yet.

Initially, for each exercise we were creating a Lesson component from the imported exercise which was localised. The exercises were manually added to an array with their toolboxes manually created as well. This PR changes the Exercises folder to be a flat structure which serves an array of the exercises and their toolboxes. It introduces a <!--block--> tag which we can wrap blocks in markdown to explicitly signal that we expect this block to be used in a toolbox. This is parsed and added into an object next to the markdown text of the exercises.


View rendered client/src/Exercises/01-stuff.md View rendered client/src/Exercises/02-more-stuff.md

netlify[bot] commented 2 years ago

Deploy Preview for cyf-blocks ready!

Name Link
Latest commit 38e3ba1e2a6274f0f029d34e6afd9ff4a192cc83
Latest deploy log https://app.netlify.com/sites/cyf-blocks/deploys/624e1cbd21195f00093e17ad
Deploy Preview https://deploy-preview-67--cyf-blocks.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

SallyMcGrath commented 2 years ago

@40thieves this looks great to me but I'm not a React person. I'd like to merge if you approve?

sansaid commented 2 years ago

Hey @SallyMcGrath ! I'm closing this, because I made some incorrect assumptions about how React works and this doesn't work at all. I've raised PR #78 if you want to take a look at the changes that actually work!

SallyMcGrath commented 2 years ago

Oh yes sorry @sansaid we (me and Ali) ended up discussing by DM which is a bad habit I will break. I was also making some wrong assumptions.

To record here: the subject of our discussion was that I solved a similar problem a couple of weeks ago in another CYF project. It might be a mad solution -- like I said, I don't know React -- but it's here:

https://github.com/CodeYourFuture/project-rainbird/blob/main/client/src/Content/MarkdownIndex.js https://github.com/CodeYourFuture/project-rainbird/blob/main/client/src/Views/Help/Markdown/Markdown.js