Mouad Zizi

πŸš€ My Gitbook-to-PDF Node.js Script

As a freelancer and Codecanyon author, I frequently publish apps, themes, and templates for sale. One key requirement on Codecanyon is to include offline documentation with your main source files. For this, I’ve always relied on Gitbookβ€”it’s a fantastic tool!

Previously, Gitbook allowed users to download their repositories as PDFs, which made sharing documentation straightforward. Unfortunately, this feature has recently become a premium offering.

Faced with this challenge, I decided to create my own solution! 🌟

I built a Node.js script that scrapes Gitbook URLs, retrieves all the content, and converts it into organized PDF and PNG files. Here’s how it works: 1️⃣ Provide your Gitbook URL to the script. 2️⃣ Run the script to generate structured files. Each folder corresponds to a Gitbook section, containing:

  • PDFs for each page.
  • PNG snapshots of the pages.

πŸ“ Example Output:

intro/  
page1.png
page1.pdf
installing theme/
page1.png
page1.pdf
change colors/
page1.png
page1.pdf

This script is a game-changer for anyone needing offline Gitbook documentation! πŸŽ‰

Feel free to clone, use, and improve the script. Contributions are always welcome!

πŸ“šβœ¨ Step-by-Step Tutorial: Convert Gitbook to PDF Using Node.js Script

Mouad Zizi

Hello there, my name is Mouad Zizi. I'm a professional Flutter developer and full stack Web developer with extensive experience in UI and UX design. I specialize in creating high-quality, cross-platform mobile applications and robust backend solutions. My expertise ensures that every project is both functional and visually appealing, providing an exceptional user experience.

https://mouadzizi.com

Leave a Reply

Your email address will not be published. Required fields are marked *