nature-of-code / noc-book-2

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

Update Page Layout #624

Closed jasongao97 closed 5 months ago

jasongao97 commented 5 months ago

This PR currently implemented the following:

Demo pages

image image

Besides, I am having the following questions:

netlify[bot] commented 5 months ago

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

Name Link
Latest commit 19aca319aca9f5f451c4da0cfc3cb5b86807e8b6
Latest deploy log https://app.netlify.com/sites/nature-of-code-pdf/deploys/659d51699ca5220008eb92ab
Deploy Preview https://deploy-preview-624--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 5 months ago

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

Name Link
Latest commit 19aca319aca9f5f451c4da0cfc3cb5b86807e8b6
Latest deploy log https://app.netlify.com/sites/nature-of-code-2nd-edition/deploys/659d5169a739d1000823e06f
Deploy Preview https://deploy-preview-624--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 5 months ago

Hi @jasongao97 thank you, this is looking great! I'll ask the header question for the front matter via email.

Regarding this one:

When a blank left page appears, what should be shown in its header and footer: Should it be counted in page?

I think the blank left page can have no header (as it's essentially the "first page" of a chapter, the footers can include the page numbers as normal. A blank page should definitely be counted as a "page" in the numbering!

jasongao97 commented 5 months ago

For reference, adding the following to page.scss will add headers and footers for the 'Introduction chapter':

section[data-type='page']:has(#introduction) {
  page: chapter;
  counter-reset: page 1;
  prince-page-group: start;

  h1 {
    string-set: chapter-title content(), chapter-number content();
  }
}
shiffman commented 5 months ago

@jasongao97 a3bef9aa89f8293c4d4cc0fad32c5e669fe121ba is the CSS I added according to the configuration requested for the introduction right now, feel free to consolidate/improve as you see fit and eventually it will have page numbers.

jasongao97 commented 5 months ago

2fe8147: I added Roman numeral page number to the Introduction and Acknowledgments pages.

image

Not sure if upper-roman is the correct type, but there are more supported styles: https://www.princexml.com/doc/gen-content/#counter-styles

shiffman commented 5 months ago

@jasongao97 I wonder if we should actually merge this pull request without the roman numerals so the main branch is in sync with what is currently with the publisher and then we can open a new branch for the front matter page numbers? Would you mind doing that?

The roman numerals should be lower case I believe, that is the standard format!

jasongao97 commented 5 months ago

Got it! That make sense. I'll revert that.