Skip to content

Commit b2daddd

Browse files
Merge pull request #483 from alejandrohdezma/feature/organization
Add `organization` SBT setting as `ORGANIZATION` mdoc variable
2 parents ace3402 + d38965b commit b2daddd

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

modules/sbt-github-mdoc/src/main/scala/com/alejandrohdezma/sbt/github/mdoc/SbtGithubMdocPlugin.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ object SbtGithubMdocPlugin extends AutoPlugin {
8787
displayName := SbtGithubPlugin.info.value._2,
8888
removeVersionTimestampInMdoc := true,
8989
mdocVariables ++= Map(
90+
"ORGANIZATION" -> organization.value,
9091
"NAME" -> displayName.value,
9192
"REPO" -> repository.value.map(_.name).getOrElse(""),
9293
"DEFAULT_BRANCH" -> repository.value.map(_.defaultBranch).getOrElse(""),

modules/sbt-github-mdoc/src/sbt-test/sbt-github-mdoc/simple/DOCS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
sbt-github
22

3+
my.org
4+
35
user1/repo
46

57
name

modules/sbt-github-mdoc/src/sbt-test/sbt-github-mdoc/simple/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ThisBuild / scmInfo := Some(
22
ScmInfo(url("http://example.com"), "scm:git:https://github.com/alejandrohdezma/sbt-github.git")
33
)
4+
ThisBuild / organization := "my.org"
45
ThisBuild / githubEnabled := true
56
ThisBuild / githubAuthToken := Some(AuthToken("1234"))
67
ThisBuild / githubApiEntryPoint := {

modules/sbt-github-mdoc/src/sbt-test/sbt-github-mdoc/simple/docs/DOCS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@NAME@
22

3+
@ORGANIZATION@
4+
35
@REPO@
46

57
@DEFAULT_BRANCH@

site/docs/sbt-mdoc.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ The plugin provides the following `mdocVariables`:
1818
| **COLLABORATORS** | Set to the value of the `collaborators` setting, containing the list of repository collaborators in markdown format |
1919
| **COLLABORATORS_TABLE** | Set to the value of the `collaborators` setting, containing the list of repository collaborators as a markdown table |
2020
| **NAME** | Set to the value of `displayName`. Defaults to repository's name. |
21+
| **ORGANIZATION** | Set to the value of `organization` |
2122
| **DESCRIPTION** | Set to the value of `description` |
2223
| **LICENSE** | Set to the license's name |
2324
| **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`) |
2425
| **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`) |
2526
| **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`) |
2627
| **REPO** | Set to the repository's path: "owner/repo" |
27-
| **DEFAULT_BRANCH** | Set to the repository's default branch |
28+
| **DEFAULT_BRANCH** | Set to the repository's default branch |
2829
| **START_YEAR** | Set to the value of the `startYear` setting |
2930
| **YEAR_RANGE** | Set to the value of the `yearRange` setting |
3031
| **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 commit comments

Comments
 (0)