GitHub Wyam.GitHub

Outputs metadata for information from GitHub.
This modules uses the Octokit library and associated types to submit requests to GitHub. Because of the large number of different kinds of requests, this module does not attempt to provide a fully abstract wrapper around the Octokit library. Instead, it simplifies the housekeeping involved in setting up an Octokit client and requires you to provide functions that fetch whatever data you need. Each request will be sent for each input document.

Package

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

Usage

  • GitHub()

    Creates an unauthenticated connection to the GitHub API.

  • GitHub(string token)

    Creates a connection to the GitHub API with OAuth authentication.

    • token

      The token to use.

  • GitHub(string username, string password)

    Creates a connection to the GitHub API with basic authenticated access.

    • username

      The username to use.

    • password

      The password to use.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • WithRequest(string key, Func<GitHubClient, object> request)

    Submits a request to the GitHub client.

    • key

      The metadata key in which to store the return value of the request function.

    • request

      A function with the request to make.

  • WithRequest(string key, Func<IDocument, IExecutionContext, GitHubClient, object> request)

    Submits a request to the GitHub client. This allows you to incorporate data from the execution context and current document in your request.

    • key

      The metadata key in which to store the return value of the request function.

    • request

      A function with the request to make.

  • WithRequest(string key, Func<IExecutionContext, GitHubClient, object> request)

    Submits a request to the GitHub client. This allows you to incorporate data from the execution context in your request.

    • key

      The metadata key in which to store the return value of the request function.

    • request

      A function with the request to make.

  • WithUrl(string url)

    Specifies and alternate API URL (such as to an Enterprise GitHub endpoint).

    • url

      The URL to use.

GitHub