GitHubContent

class GitHubContent(ownerType: OwnerType, ownerName: String, repoName: String, branchName: String = "master", srcPath: String = "src/main/kotlin", fileName: String = "Content.kt") : GitHubFile

A reference to a Content DSL file hosted on GitHub.

Used to load remote content definitions (typically Content.kt files) from a GitHub repository. The file is fetched via raw GitHub URLs and evaluated as a Kotlin script to produce a ReadingBatContent instance.

Parameters

ownerType

whether the GitHub owner is a user or organization

ownerName

the GitHub user or organization name

repoName

the GitHub repository name

branchName

the git branch to fetch from (defaults to "master")

srcPath

the path within the repo to the source directory

fileName

the name of the DSL file to load

Constructors

Link copied to clipboard
constructor(ownerType: OwnerType, ownerName: String, repoName: String, branchName: String = "master", srcPath: String = "src/main/kotlin", fileName: String = "Content.kt")

Properties

Link copied to clipboard
Link copied to clipboard
open override val content: String
Link copied to clipboard
Link copied to clipboard
open override val remote: Boolean
Link copied to clipboard
val repo: GitHubRepo
Link copied to clipboard
open override val source: String
Link copied to clipboard

Functions

Link copied to clipboard
fun ContentSource.eval(enclosingContent: ReadingBatContent, variableName: String = "content"): ReadingBatContent

Loads and evaluates a remote ContentSource (e.g., a GitHubContent file) as a Kotlin script, returning the resulting ReadingBatContent. The DSL file must define a variable with the given variableName (defaults to "content") that holds the ReadingBatContent result.

Link copied to clipboard
open override fun toString(): String