GitContributors Wyam.Git

Outputs documents and metadata for contributors in a Git repository.

This module works in one of two ways. By default, a new document is output for each contributor in the repository. These output documents have the metadata documented below to describe each contributor. In this mode, all input documents are forgotten and only documents for each contributor are output.

Alternatively, by calling ForEachInputDocument(), contributor data is added to every input document for which the repository contains an entry. The data is added as an IDocument sequence to the specified metadata key in the input document and each document in the sequence contains the same metadata that would have been added in the default mode. All input documents are output from this module (including those that didn't have commit information).

Package

This module exists in the Wyam.Git package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Git
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • GitContributors()

    Gets authors from the repository the InputFolder is a part of.

  • GitContributors(DirectoryPath repositoryPath)

    Gets authors from the repository the specified path is a part of.

    • repositoryPath

      The repository path.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • ForEachInputDocument(string contributorsMetadataKey = null)

    Specifies that contributor information should be added to each input document.

    • contributorsMetadataKey

      The metadata key to set for contributor information.

  • WithAuthors(bool authors = true)

    Specifies that authors should be included.

    • authors

      If set to true (the default), authors are included in the output.

  • WithCommitters(bool committers = true)

    Specifies that committers should be included.

    • committers

      If set to true (the default), committers are included in the output.

Output Metadata

The metadata values listed below apply to individual documents and are created and set by the module as indicated in their descriptions.

  • GitKeys.Commits: IReadOnlyList<IDocument>

    The sequence of commits for the input document if ForEachInputDocument() was called (and an alternate metadata key was not provided).

  • GitKeys.ContributorEmail: System.String

    The email of the contributor.

  • GitKeys.ContributorName: System.String

    The name of the contributor.

GitHub