这是indexloc提供的服务,不要输入任何密码
Skip to content

gitforkedio/noc-book-2

 
 

Repository files navigation

The Nature of Code (2024 p5.js update!)

This repo contains all the files for the Nature of Code book. The source content for the book is in a private Notion database and imported here as raw HTML files (which are then used to build the print PDF and gatsby website).

If you are looking for the 2012 Nature of Code book, the website is archived here along with the GitHub source archive.

Data flow chart showing three parts: edit, store, and output.

Edit & Import

Notion Database Screenshot

Content are stored in a Notion Database with the following attributes:

  • Type (Page | Chapter): to be handled differently during builds, now only act in the website build.
  • Title: defines the title
  • Status (Draft | Published): only Published ones will be imported
  • File Name: defines the page sequence in a pdf build
  • Slug: defines the path in web page URL

Each entity also contains a page of its content, which will be transformed to html files based on the schema. The transformation script (nature-of-code/fetch-notion) is written in Node.js, utilized as a GitHub action.

Build

Following are the steps to build the book and website, however, you will have to skip the import-notion-docs as that can only be done with the Notion API key associated with the book. You can find the latest HTML version of the book in /content.

# Install Dependencies
npm install

# Build PDF (Magicbook) in `build` directory
npm run build:pdf

# Build Website in `public` directory
npm run build

Example Ports to Other Languages

On this page, you can find a repository of ports to other programming languages on the topic of Nature of Code.

If you would like to add a resource to this list, please open an issue with the title and link to your resource.

Errata

On the Errate page, we are keeping track of since the publication date (9/3/2024). If you would like to submit an error, please file an issue on our GitHub page, and we will fix the website version and keep track of the error for the printed book.

Attributions

Icons used in this project:

🖍️ (Crayon) & 🦜 (Parrot) & 🔎 (Magnifying glass) from OpenMojiCC BY-SA 4.0

About

The 2024 edition of The Nature of Code with p5.js. Includes Notion workflow and build system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 71.9%
  • JavaScript 26.4%
  • Other 1.7%