Skip to content
Next-book browser component
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.editorconfig
.eslintrc.json
.gitignore
.prettierrc
LICENSE
README.md
package-lock.json
package.json

README.md

nb-base

Nb-base is a library providing functionality that builds on the structure of a mapped next-book. It provides basic e-reading functionalities.

See an example of an e-book created with the next-book tools.

Use

Some web tech knowledge and command line use is needed to produce a next-book at the time. But we‘re preparing an easier way right now! (If you want to know when it’s out, please subscribe to our newsletter 💌).

1. Add nb-mapper dependency

(nb-base is installed as its dependency.)

You can install nb-mapper

  • via Yarn yarn add nb-mapper
  • via NPM npm install nb-mapper

2. Import nb-base styles in your SCSS

@import './../../node_modules/nb-mapper/node_modules/nb-base/src/scss/style.scss';

3. Import nb-base module in your scripts

import {
  initBook,
  initHeadroom,
} from './../../node_modules/nb-mapper/node_modules/nb-base/src/js/index.js';

document.addEventListener('DOMContentLoaded', () => {
  initBook();
  initHeadroom();
});

Stand-alone use (without SCSS/JS imports)

You may include dist/nb-base.js and dist/nb-base.css in your next-book (before any other scripts.

Getting current book state

You may use book.getState() to get current e-book state — it returns a serialized redux state with user data.

Contributing

Clone repository and install devDependencies. Build a complete project with npm run build. Limit PRs only to changed source files.

You can’t perform that action at this time.