The sbt-site plugin has direct support for building GitBook projects.
To enable the “sbt site GitBook” plugin in your sbt project, add the following to your
addSbtPlugin("com.github.sbt" % "sbt-site-gitbook" % "1.5.0")
And enable the associated plugin in your
This assumes you have a GitBook project under the
src/gitbook directory. To change this, set the
sourceDirectory key in the
GitBook / sourceDirectory := sourceDirectory.value / "doc"
Similarly, the output can be redirected to a subdirectory of
target/site via the
siteSubdirName key in
// Puts output in `target/site/book` GitBook / siteSubdirName := "book"
The plugin can also be configured to manage all GitBook setup and installation by configuring a dedicated directory in which GitBook’s npm packages can be installed.
GitBook / gitbookInstallDir := Some(baseDirectory.value / "node_modules" / "gitbook")