-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
29 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
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,48 @@ | ||
import com.typesafe.sbt.GitPlugin.autoImport.git | ||
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport.ghpagesNoJekyll | ||
import microsites.MicrositesPlugin.autoImport._ | ||
import sbt.Keys.{autoAPIMappings, fork, includeFilter, version} | ||
import sbt.{File, IO, taskKey} | ||
|
||
object DocSupport { | ||
lazy val updateDoc = taskKey[Unit]("update versions in doc") | ||
|
||
val settings = Seq( | ||
|
||
updateDoc := { | ||
val string = IO.read(new File("docs/src/main/tut/index.md").getAbsoluteFile) | ||
val version1 = | ||
"\"io.github.afsalthaj\" %% \"safe-string\".*".r.findFirstIn(string).getOrElse(throw new IllegalStateException("Cannot find pattern \"\\\"io.github.afsalthaj\\\" %% \\\"safe-string\\\".*\" in docs/src/main/tut/index.md")) | ||
val version2 = | ||
"`io.github.afsalthaj::safe-string.*".r.findFirstIn(string).getOrElse(throw new IllegalStateException("Cannot find the pattern io.github.afsalthaj::safe-string.* in docs/src/main/tut/index.md")) | ||
|
||
val content = | ||
string.replace(version1, s""""io.github.afsalthaj" %% "safe-string" % "${version.value}" """).replace(version2, s"`io.github.afsalthaj::safe-string:${version.value}`") | ||
|
||
IO.write(new File("docs/src/main/tut/index.md").getAbsoluteFile, content = content, append = false) | ||
|
||
publishMicrosite.value | ||
}, | ||
micrositeName := "Typesafe Interpolation", | ||
micrositeDescription := "Typesafe Interpolation", | ||
micrositeHighlightTheme := "atom-one-light", | ||
micrositeGithubRepo := "safe-string-interpolation", | ||
micrositeHomepage := "https://afsalthaj.github.io/safe-string-interpolation", | ||
micrositeBaseUrl := "/safe-string-interpolation", | ||
micrositeGithubOwner := "afsalthaj", | ||
micrositeGithubRepo := "safe-string-interpolation", | ||
micrositeGitterChannelUrl := "safe-string-interpolation/community", | ||
micrositePushSiteWith := GHPagesPlugin, | ||
micrositePalette := Map( | ||
"brand-primary" -> "#5B5988", | ||
"brand-secondary" -> "#292E53", | ||
"brand-tertiary" -> "#222749", | ||
"gray-dark" -> "#49494B", | ||
"gray" -> "#7B7B7E", | ||
"gray-light" -> "#E5E5E6", | ||
"gray-lighter" -> "#F4F3F4", | ||
"white-color" -> "#FFFFFF"), | ||
autoAPIMappings := true, | ||
ghpagesNoJekyll := false, | ||
) | ||
} |