Skip to content

Commit

Permalink
maintainers section. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
khajavi authored Dec 25, 2022
1 parent b97e424 commit caa36e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion zio-sbt-website/src/main/scala/zio/sbt/WebsitePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ object WebsitePlugin extends sbt.AutoPlugin {
val readmeLicense: SettingKey[String] = settingKey[String]("readme license section")
val readmeAcknowledgement: SettingKey[String] = settingKey[String]("acknowledgement section")
val readmeCredits: SettingKey[String] = settingKey[String]("credits section")
val readmeMaintainers: SettingKey[String] = settingKey[String]("maintainers section")
val docsVersioning: SettingKey[DocsVersioning] = settingKey[DocsVersioning]("docs versioning style")
val sbtBuildOptions: SettingKey[List[String]] = settingKey[List[String]]("sbt build options")

Expand Down Expand Up @@ -124,6 +125,7 @@ object WebsitePlugin extends sbt.AutoPlugin {
readmeContribution := readmeContributionSection,
readmeCodeOfConduct := readmeCodeOfConductSection,
readmeCredits := "",
readmeMaintainers := "",
docsVersioning := DocsVersioning.SemanticVersioning,
sbtBuildOptions := List.empty[String]
)
Expand Down Expand Up @@ -285,7 +287,8 @@ object WebsitePlugin extends sbt.AutoPlugin {
support = readmeSupport.value.trim,
license = readmeLicense.value.trim,
acknowledgement = readmeAcknowledgement.value.trim,
credits = readmeCredits.value.trim
credits = readmeCredits.value.trim,
maintainers = readmeMaintainers.value.trim
)
}
)
Expand Down
6 changes: 4 additions & 2 deletions zio-sbt-website/src/main/scala/zio/sbt/WebsiteUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ object WebsiteUtils {
support: String,
license: String,
acknowledgement: String,
credits: String
credits: String,
maintainers: String
): Task[Unit] = {
val commentSection =
"""|[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)
Expand All @@ -131,11 +132,12 @@ object WebsiteUtils {
val codeOfConductSection = s"\n## Code of Conduct\n\n$codeOfConduct\n"
val contributingSection = s"\n## Contributing\n\n$contribution\n"
val documentationSection = s"\n## Documentation\n\n$documentation\n"
val maintainersSection = if (maintainers.nonEmpty) s"\n## Maintainers\n\n$maintainers\n" else ""
val acknowledgementSection = if (acknowledgement.nonEmpty) s"\n## Acknowledgement\n\n$acknowledgement\n" else ""
val licenseSection = s"\n## License\n\n$license\n"
val readme =
commentSection + introductionSection + documentationSection + contributingSection + codeOfConductSection +
supportSection + creditsSection + acknowledgementSection + licenseSection
supportSection + maintainersSection + creditsSection + acknowledgementSection + licenseSection

ZIO.attemptBlocking(
Files.write(
Expand Down

0 comments on commit caa36e2

Please sign in to comment.