SaraVieira / Starter Book
Programming Languages
Projects that are alternatives of or similar to Starter Book
Book Starter
A starter built with gatsby to help you create books with ease.
- 📖 Create Book from markdown files
- 🖼 Generate PDF with Light and Dark Mode
- 📚 Generates Epub file
- 👩💻 Creates a preview site
Website Example (add ?theme=dark
to preview dark version)
How to use
- First git clone and cd into the folder
git clone [email protected]:SaraVieira/starter-book.git my-book && cd my-book
-
Edit your book in the
book.md
-
Set you book properties in
bookInfo.js
-
Run
yarn install
-
Run
yarn build
5.1. You can also run
yarn build:site
to build just the preview site5.2. Or run
yarn build:book
for the PDF and Epub files -
To get the .mobi file download the Kindle Previewer and drag your .epub file and it creates a kindle compatible file.
-
Profit??
FAQ
How can I edit the CSS?
The CSS is located in ./src/styles/style.scss and you can edit it there. At the bottom you will see all the styles specific for the dark version.
How can I change the Prism theme?
I import the prism theme in ./src/pages/index.js and in there you can use any theme or make your own and use it by importing. I made a tool you can see here that helps you make your VSCode theme into a prism theme easily.
The chapters are screwed up in my version
I use a really HUUUUGE hack to get them, I go through every H1 created by the markdown file and make that into a chapter so I can only recognize H1's as chapters at least until I find a better way :( If you want to try and fix that the code is at ./generate-book/epub.js.
How can I add o outline items to the PDF?
I could not find a way to do this with code so I ended up buying a software called PDFOutliner but this is far from perfect as it's a Mac only app so any help would be super appreciated.
To use the software open it up in your mac, click open and locate the PDF version of the book and after that you click on "Auto TOC"
Once created save the file and you should have a new Outline created.
Why?
I built this in order to be able to publish a book I wrote and I think it may be useful for someone so I made it open source.
Books using this:
Let me know if you are using this to make your book :)
Any issues please make a PR or file a bug
Licensed under the MIT license