Skip to main content

Integration with sbt-mdoc

If you use mdoc for creating your documentation you can benefit from our mdoc module which provides several bunches of mdocVariables already pre-filled with values extracted from Github to any project that adds the MdocPlugin to replace them in the documentation. To use it, just add the following line to your plugins.sbt file

addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.12.0")
note

So we don't force a version of mdoc, it is requested as a "Provided" dependency so you'll need to provide your own version of mdoc following its own tutorial.

The plugin provides the following mdocVariables:

VariableContent
VERSIONSet to the value of the version setting by removing the timestamp part (this behavior can be disabled using the removeVersionTimestampInMdoc setting)
CONTRIBUTORSSet to the value of the contributors setting, containing the list of repository contributors in markdown format
CONTRIBUTORS_TABLESet to the value of the contributors setting, containing the list of repository contributors as a markdown table
COLLABORATORSSet to the value of the collaborators setting, containing the list of repository collaborators in markdown format
COLLABORATORS_TABLESet to the value of the collaborators setting, containing the list of repository collaborators as a markdown table
NAMESet to the value of displayName. Defaults to repository's name.
ORGANIZATIONSet to the value of organization
DESCRIPTIONSet to the value of description
LICENSESet to the license's name
ORG_NAMESet to the value of organizationName setting (Github's organization name or owner's in case organization is empty and populateOrganizationWithOwner is true)
ORG_EMAILSet to the value of organizationEmail setting (Github's organization email, or owner's in case organization is empty and populateOrganizationWithOwner is true)
ORG_URLSet to the value of organizationHomepage setting (Github's organization homepage or owner's in case organization is empty and populateOrganizationWithOwner is true)
REPOSet to the repository's path: "owner/repo"
DEFAULT_BRANCHSet to the repository's default branch
START_YEARSet to the value of the startYear setting
YEAR_RANGESet to the value of the yearRange setting
COPYRIGHT_OWNERSet to the value of ORG_NAME <ORG_URL> if ORG_URL is present or just ORG_NAME in case ORG_URL is empty
SUPPORTED_SCALA_VERSIONSSet to the value of crossScalaVersions, containing the list of supported Scala versions in markdown format