How to Reference Twitter Bootstrap Documentation Locally, and Offline


I was doing research with the new version of Twitter Bootstrap, version 3 (RC). After cloning from the project’s repo:

https://github.com/twitter/bootstrap

I then checked out the release candidate’s branch “3.0.0-wip“:

git fetch origin
git checkout -b 3.0 origin/3.0.0-wip

The 3.0.0-wip branch directory structure is similar to its master branch.

bootstrap-docs-01

Navigating to the /docs directory, you get these static, HTML-template files.

bootstrap-docs-02

With some research, it seems you’ll need to have Jekyll to serve these pages correctly, locally. Presuming you already have Ruby and Node.js (with npm) installed in your local development machine (e.g. laptop/desktop), let’s install Jekyll if you don’t already have it:

gem install jekyll

Then, we compile and build Bootstrap locally. Run this in your local repo directory, e.g. ~/bootstrap:

make

bootstrap-docs-03

After that builds and completes, let’s fire-up Jekyll to serve a local site consisting of Twitter Bootstrap’s documentation. We type and run the following:

jekyll serve

This will use the _config.yml that’s included with the Bootstrap project’s repo, and serve a local site at:

http://getbootstrap.dev:9001

There you have it. Twitter Bootstrap Documentation running locally. Very handy if you are offline, or on the go.

bootstrap-docs-04