carlalexander / book-project-template
Template project for publishing a book in markdown
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 2
Forks: 7
Open Issues: 1
Type:project
Requires
- php: >=7.4
- ext-ctype: *
- ext-iconv: *
- erusev/parsedown: ^1.7
- setasign/fpdi-fpdf: ^2.3
- symfony/console: ^6.1
- symfony/css-selector: ^6.1
- symfony/dom-crawler: ^6.1
- symfony/dotenv: ^6.1
- symfony/flex: ^2.2
- symfony/framework-bundle: ^6.1
- symfony/process: ^6.1
- symfony/twig-bundle: ^6.1
- symfony/yaml: ^6.1
- tightenco/collect: ^9.16
Conflicts
This package is auto-updated.
Last update: 2024-11-29 23:05:27 UTC
README
This is a template project based on the code used to create the PDF and epub version of Discover object-oriented programming using WordPress. For more a more detailed writeup of how the code works, please read the companion article here. You can also leave your questions there.
Note: This code is available as a base for your own book project. I'm no longer doing any development on it.
Requirements
This is a Symfony LTS application so you need to have PHP (minimum version 7.1.3) as well as composer installed. Besides that, the application also needs prince (for PDF generation) and pandoc (for epub generation) installed.
You can install these two tools using homebrew on MacOS:
$ brew cask install --no-quarantine prince $ brew install pandoc
Installation
Once the prerequisites installed, you can create a new project using the following command:
$ composer create-project carlalexander/book-project-template
Usage
A sample preface + 4 section book layout is available in the content
directory. The HTML
template used for the book (including the cover) can be found in book.html.twig
. To edit
the style of the book, edit the CSS files found in the assets/css
folder.
There are two builds commands available to create your book. One for PDF and one for EPUB. These are:
$ bin/console book:build-pdf $ bin/console book:build-mobile
Please refer to this article for a detailed explanation of the code and how to modify it to write your own book.