A tool to scrape and generate a single-page, offline-friendly version of the Three.js documentation manual.
View github pages here
- Scrapes the entire Three.js documentation
- Preserves original styling and formatting
- Maintains code syntax highlighting
- Supports offline viewing
- Rate-limited requests to avoid server strain
- Caching system for faster development
- Development mode for quick testing
This project uses Nix for development environment management. You'll need:
- Nix with flakes enabled
direnv
(optional, but recommended)
-
Clone the repository:
git clone https://github.com/yourusername/threejs-manual-generator.git cd threejs-manual-generator
-
Enable direnv (optional):
direnv allow # sources .envrc
-
Install dependencies:
npm install
Run with a limit of 10 pages for testing:
npm run dev
Generate the complete documentation:
npm run prod
To build and publish to the docs branch:
just publish
This will:
- Build the documentation
- Update the LAST_UPDATED timestamp
- Commit changes to the docs branch
- Reset the working directory
npm run lint
- Check code stylenpm run lint:fix
- Fix code style issuesnpm run format
- Format codenpm run test
- Run testsnpm run clear-cache
- Clear the cache
The project uses:
- Node.js 18
- Puppeteer for web scraping
- Jest for testing
- ESLint and Prettier for code style
- Just for task running
The scraper caches downloaded pages to speed up development. To clear the cache:
npm run clear-cache
MIT