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

Break the code snippet into individual lines #912

Closed jasongao97 closed 2 months ago

jasongao97 commented 2 months ago

Resolve #909

Before

image

After

image

The bug occurs because the scissors were added to the last chunk of code:

    this.position = createVector(x, y);
    this.velocity = createVector();

    this.acceleration = createVector();
  }

, which span across two pages, and Prince XML decides to make the relative origin on the first page.

This PR break the code chunk into individual lines and ensure the last chunk will be located on the later page.

@shiffman This change applies globally and have the potential of affecting certain areas. I have reviewed the PDF briefly and did not detect any issues. Could we implement this for now, and if anything breaks, I can work on a local solution?

netlify[bot] commented 2 months ago

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

Name Link
Latest commit 1d277d7b1e334ba1c1bb4307e1fbf3758713c27c
Latest deploy log https://app.netlify.com/sites/nature-of-code-2nd-edition/deploys/65f0504a81b38b00089abcf4
Deploy Preview https://deploy-preview-912--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.

netlify[bot] commented 2 months ago

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

Name Link
Latest commit 1d277d7b1e334ba1c1bb4307e1fbf3758713c27c
Latest deploy log https://app.netlify.com/sites/nature-of-code-pdf/deploys/65f0504ac8ac5f00088eb08b
Deploy Preview https://deploy-preview-912--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.

shiffman commented 2 months ago

Yes, let's try it! I am going to be comparing the PDF side by side with the latest markup from no starch so I can look carefully and make sure nothing else has changed. There is a merge conflict now though I'm not sure where that came from, can you check? Thank you!