-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add excludeFilter support to GitBook generator
It excludes hidden files by default and thus `.git` and `.gitignore`. The test case does not match exactly the issue described in #67 (namely use of submodules) but instead tests a similar situation where the source directory is the project's base directory. Fixes #67
- Loading branch information
Showing
9 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
project/ | ||
target/ | ||
boot/ | ||
global/ | ||
*.sbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Hello, GitBook! | ||
|
||
The SBT site plugin can build your http://gitbook.com[GitBook] documentation. | ||
|
||
## First Section | ||
|
||
- item 1 | ||
- item 2 | ||
|
||
```scala | ||
case class User(name: String, age: Int) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"gitbook": "3.x.x" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name := "test" | ||
|
||
enablePlugins(GitBookPlugin) | ||
|
||
sourceDirectory in GitBook := baseDirectory.value | ||
siteSubdirName in GitBook := "docs" | ||
|
||
val gitHeadPath = ".git/HEAD" | ||
|
||
initialize := { | ||
// Create .git test file before running makeSite | ||
IO.write(baseDirectory.value / gitHeadPath, "test") | ||
} | ||
|
||
TaskKey[Unit]("checkContent") := { | ||
val dest = (target in makeSite).value / (siteSubdirName in GitBook).value | ||
|
||
val generatedGitFile = baseDirectory.value / gitHeadPath | ||
assert(generatedGitFile.exists, s"${generatedGitFile.getAbsolutePath} did not exist") | ||
|
||
for (path <- Seq("index.html")) { | ||
val file = dest / path | ||
assert(file.exists, s"${file.getAbsolutePath} did not exist") | ||
} | ||
|
||
for (path <- Seq(gitHeadPath, ".gitignore", ".bookignore", "target", "project")) { | ||
val file = dest / path | ||
assert(!file.exists, s"${file.getAbsolutePath} should not exist") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % sys.props("project.version")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> make-site | ||
> checkContent |