Skip to content

Creating content

calebwaldorf edited this page Nov 26, 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 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/metadata.yml

A metadata.yml file is created for each project after initializing a project with bber new. The metadata in this file is then embedded into each build. For more information, see Adding metadata.

_project/toc.yml

The reading order is the sequence in which files are arranged when viewing a project. File names are included in the toc.yml file in the desired reading order, and chapters can also be nested. The reading order can be set for all builds by updating the entries in the toc.yml. For more information, see Changing the reading order.

_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 are stored here. b-ber does not support external image links, so all the project's 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 during the build. Refer to the Custom JavaScript page of the Wiki for more information.

_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 set 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