Skip to content

Commit

Permalink
Merge pull request #483 from alejandrohdezma/feature/organization
Browse files Browse the repository at this point in the history
Add `organization` SBT setting as `ORGANIZATION` mdoc variable
  • Loading branch information
alejandrohdezma authored Nov 22, 2022
2 parents ace3402 + d38965b commit b2daddd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ object SbtGithubMdocPlugin extends AutoPlugin {
displayName := SbtGithubPlugin.info.value._2,
removeVersionTimestampInMdoc := true,
mdocVariables ++= Map(
"ORGANIZATION" -> organization.value,
"NAME" -> displayName.value,
"REPO" -> repository.value.map(_.name).getOrElse(""),
"DEFAULT_BRANCH" -> repository.value.map(_.defaultBranch).getOrElse(""),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sbt-github

my.org

user1/repo

name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ThisBuild / scmInfo := Some(
ScmInfo(url("http://example.com"), "scm:git:https://github.com/alejandrohdezma/sbt-github.git")
)
ThisBuild / organization := "my.org"
ThisBuild / githubEnabled := true
ThisBuild / githubAuthToken := Some(AuthToken("1234"))
ThisBuild / githubApiEntryPoint := {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@NAME@

@ORGANIZATION@

@REPO@

@DEFAULT_BRANCH@
Expand Down
3 changes: 2 additions & 1 deletion site/docs/sbt-mdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ The plugin provides the following `mdocVariables`:
| **COLLABORATORS** | Set to the value of the `collaborators` setting, containing the list of repository collaborators in markdown format |
| **COLLABORATORS_TABLE** | Set to the value of the `collaborators` setting, containing the list of repository collaborators as a markdown table |
| **NAME** | Set to the value of `displayName`. Defaults to repository's name. |
| **ORGANIZATION** | Set to the value of `organization` |
| **DESCRIPTION** | Set to the value of `description` |
| **LICENSE** | Set to the license's name |
| **ORG_NAME** | Set to the value of `organizationName` setting (Github's organization name or owner's in case organization is empty and `populateOrganizationWithOwner` is `true`) |
| **ORG_EMAIL** | Set to the value of `organizationEmail` setting (Github's organization email, or owner's in case organization is empty and `populateOrganizationWithOwner` is `true`) |
| **ORG_URL** | Set to the value of `organizationHomepage` setting (Github's organization homepage or owner's in case organization is empty and `populateOrganizationWithOwner` is `true`) |
| **REPO** | Set to the repository's path: "owner/repo" |
| **DEFAULT_BRANCH** | Set to the repository's default branch |
| **DEFAULT_BRANCH** | Set to the repository's default branch |
| **START_YEAR** | Set to the value of the `startYear` setting |
| **YEAR_RANGE** | Set to the value of the `yearRange` setting |
| **COPYRIGHT_OWNER** | Set to the value of `ORG_NAME <ORG_URL>` if `ORG_URL` is present or just `ORG_NAME` in case `ORG_URL` is empty |

0 comments on commit b2daddd

Please sign in to comment.