Quick start
It’s possible to create a new project online and start editing it within minutes.
Create a new project
-
Go to github.com/electricbookworks/electric-book and click ‘Use this template’. Follow the prompts to create a new repository for your project.
-
Your new project on GitHub will have a URL that looks like
https://github.com/your-name/your-project-name/
.Click in the address bar, and at the start of that line, insert
gitpod.io/#
, and hit Enter.Follow the prompts to launch your editing interface in Gitpod.
-
After a few minutes, when the Gitpod Terminal is ready, enter this command to serve a website of your project:
npm run electric-book -- output
When prompted, open the generated site in your browser and add
/electric-book/
to the address in the address bar. E.g.:https://4000-electricboo-electricboo-u3np6cdtayw.ws-eu116.gitpod.io/electric-book/
You’re up and running! From here, you can make the project your own.
Note that the template includes two books:
book
: a bare-bones book to start working in; andsamples
: a long book containing loads of examples.
To find out how to add your own text from a Word file, see ‘Setting up a book’ > ‘Importing a text file’.
Edit and design the book
-
Open
_data/works/[book]/default.yml
(where[book]
is the name of your new book folder) and replace the sample information there with your project and book information. -
In the book’s folder, edit and add markdown files. If you create new ones, add their names to the
files
andnav
lists in_data/works/[book]/default.yml
. -
To change the design, edit the
.scss
files for each output format. You create project-wide styles in_sass
, and book-specific styles inbook/styles
. We suggest making all modifications in_sass/custom
.See the ‘Design’ section for more detail.