Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 2015 12:01:06 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        "Brandon J. Wandersee" <brandon.wandersee@gmail.com>
Cc:        Polytropon <freebsd@edvax.de>, freebsd-questions@freebsd.org
Subject:   Re: GitBook on FreeBSD?
Message-ID:  <20151018100106.GA3857@c720-r276659>
In-Reply-To: <867fmlnr54.fsf@WorkBox.Home>
References:  <20151016064251.GA1975@c720-r276659> <86mvvjymhd.fsf@WorkBox.Home> <20151016183244.GA21879@c720-r276659> <20151017012617.3bc51864.freebsd@edvax.de> <20151017103510.GB2597@c720-r276659> <867fmlnr54.fsf@WorkBox.Home>

next in thread | previous in thread | raw e-mail | index | archive | help
El día Saturday, October 17, 2015 a las 04:04:23PM -0500, Brandon J. Wandersee escribió:

> This isn't a good idea.
> 
> https://docs.npmjs.com/getting-started/installing-npm-packages-locally
> 
> Note that I don't use Node.js myself, so if those instructions cause
> problems I'm afraid I can't help. I just figured that just as Python
> eggs, Ruby gems, and Haskell Cabal packages can be installed locally as
> a regular user, so can Node packages. It seems that's the case.

Thanks! The video is not very instructive, esp. if one has never used
Node. But, it gave me the idea that somehow a local installation is
supported. I deduced to let away the flag '-g' (globally) and came up
at the end with the following procedure to build a GitBooks locally:


Install the npm - node package manager, from the FreeBSD' ports www/npm:

# cd /usr/local/www/npm
# make install clean

Here is how to use 'npm' to install the GitBook gitbook-cli to create local
web trees of a GitBook

$ cd UbuntuPhone

we will instaall gitbook-cli not globally, but in a local folder 'npm':

$ mkdir npm
$ cd npm
$ npm install gitbook-cli
gitbook-cli@1.0.0 node_modules/gitbook-cli
├── bash-color@0.0.3
├── semver@5.0.1
├── q@1.4.1
├── commander@2.8.1 (graceful-readlink@1.0.1)
├── tmp@0.0.27 (os-tmpdir@1.0.1)
├── user-home@2.0.0 (os-homedir@1.0.1)
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── npmi@1.0.1 (semver@4.3.6)
├── lodash@3.10.1
├── fs-extra@0.24.0 (path-is-absolute@1.0.0, jsonfile@2.2.3, graceful-fs@4.1.2, rimraf@2.4.3)
└── npm@2.14.8

Now let's go to our GitBook and build a local web tree from it:

$ cd ../bq-aquaris-e-4-5-ubuntu-phone   # where my GitBook files are
$ ../npm/node_modules/.bin/gitbook build
Installing GitBook 2.4.x
...
info: loading book configuration....OK 
info: load plugin gitbook-plugin-highlight ....OK 
info: >> 1 plugins loaded 
info: start generation with website generator 
info: clean website generator
info: OK 
info: generation is finished 

Done, without error


$ find _book/
_book/
_book/chapter23.html
...
_book/index.html
_book/chapter24.html

$ firefox _book/index.html

fine :-)

-- 
Matthias Apitz, ✉ guru@unixarea.de, 🌐 http://www.unixarea.de/  ☎ +49-176-38902045



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151018100106.GA3857>