nature-of-code / noc-book-2

Nature of Code with p5.js and Notion workflow / build system.
https://natureofcode.com
762 stars 52 forks source link

Add links to headings #935

Closed jasongao97 closed 1 month ago

jasongao97 commented 1 month ago

Adding links to h2, h3 headings that link back to themselves. This update makes it easier to reference and link to specific sections directly.

https://github.com/nature-of-code/noc-book-2/assets/6762203/ce9e1b19-058a-440b-b633-d058fac57f68

netlify[bot] commented 1 month ago

Deploy Preview for nature-of-code-pdf ready!

Name Link
Latest commit 8ae881818b6a484b4b09a25aab4cae9d04402f24
Latest deploy log https://app.netlify.com/sites/nature-of-code-pdf/deploys/661dbc50279e5a0008c0da62
Deploy Preview https://deploy-preview-935--nature-of-code-pdf.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 configuration.

netlify[bot] commented 1 month ago

Deploy Preview for nature-of-code-2nd-edition ready!

Name Link
Latest commit 8ae881818b6a484b4b09a25aab4cae9d04402f24
Latest deploy log https://app.netlify.com/sites/nature-of-code-2nd-edition/deploys/661dbc509acc1800088abad3
Deploy Preview https://deploy-preview-935--nature-of-code-2nd-edition.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 configuration.

shiffman commented 1 month ago

This is working great! Small comment @jasongao97, I realize this is all going to change when we bring in the new design, but the placement of the "link" icon is quite close to the border between the TOC:

Screen Shot 2024-04-16 at 10 26 25 AM

I think it would look nicer with some padding, possibly centered. I'm fine with this being merged and addressing this comment separately with other design updates if you prefer!

jasongao97 commented 1 month ago

I think it would look nicer with some padding, possibly centered. I'm fine with this being merged and addressing this comment separately with other design updates if you prefer!

Yes! That's what I was thinking. Since the new design is only two column, it's simpler to fix there. I'll make sure there are enough space to fit the icon nicely. Additionally, I am thinking having the icon display only on larger screens, at least not on mobile devices.

shiffman commented 1 month ago

Great! Merging!