Skip to content

Creating content

Maxwell Simmer edited this page May 8, 2019 · 7 revisions

Creating content

If b-ber has been installed globally, you can initiate your new project anywhere in your file system. Launch Terminal and navigate to where you would like your project to be stored. Then run:

$ bber new "my-project"

What's generated

b-ber will create a "my-project" directory with some basic assets:

  1. .gitignore
  2. README.md
  3. config.yml file that containing the configuration that b-ber references during the build process.
  4. The _project directory containing all of the source files for the new project, each of which is described below.

_project/_markdown

This folder will contain all of the text of the project. When initiating a new b-ber project, it will generate three files:

  1. An example title page.
  2. An example chapter.
  3. An example colophon.

_project/_fonts/

Custom fonts for the new project are stored here.

_project/_images/

Images for the project. b-ber does not currently support external image links, so all the projects images should be located here.

_project/_javascripts/

b-ber initiates new projects with a base application.js that normalizes some behavior for e-readers. Additional JavaScript files can be added here, or application.js can be customized. b-ber does not guarantee in what order the JavaScripts will be injected into the XHTML files after build.

_project/_stylesheets/

b-ber includes a set of default styles via a theme.

When creating a new project, b-ber will copy over the active theme's _settings.scss file to the _project/_stylesheets/<theme name>/ directory, and create a blank _overrides.scss in the same directory. This also occurs when a user switches themes on the command line using $ bber set <theme name>

The base styles (font-family, colors, etc.) can be overridden in _project/_stylesheets/_settings.scss, and additional custom styles can be added to _project/_stylesheets/_overrides.scss.

When b-ber compiles the SCSS during bber build, the files will be included in the following order:

  • _project/_stylesheets/<theme name>/_settings.scss
  • the selected theme's application.scss
  • _project/_stylesheets/<theme name>/_overrides.scss

See the default b-ber-theme-serif _settings.scss and application.scss for more detailed information.

For more information on custom styles, see Adding Custom Styles.

Clone this wiki locally