feat: Adding documentation comments.
All checks were successful
CI / Run Tests (push) Successful in 2m17s

This commit is contained in:
2024-12-17 11:51:03 -05:00
parent f596975bbc
commit f8e89ed0fa
6 changed files with 179 additions and 21 deletions

View File

@@ -52,11 +52,34 @@ public struct Configuration: Codable, Equatable, Sendable {
)
}
/// Configuration options for running `pandoc` commands that generate files from
/// a templated directory.
///
/// ## NOTE: Most of these can also be set by the template repository variables.
///
///
public struct Generate: Codable, Equatable, Sendable {
/// Specifiy the name of the build directory, generally `.build`.
public let buildDirectory: String?
/// Specifiy the files used in the `pandoc` command to generate a final output file.
///
/// - SeeAlso: `pandoc --help`
public let files: [String]?
/// Specifiy the files used in the `pandoc` command to include in the header.
///
/// - SeeAlso: `pandoc --help`
public let includeInHeader: [String]?
/// The default name of the output file, this does not require the file extension as we will
/// add it based on the command that is called. Generally this is 'Report'.
///
public let outputFileName: String?
/// The default pdf engine to use when generating pdf files using `pandoc`. Generally
/// this is 'xelatex'.
public let pdfEngine: String?
public init(
@@ -73,8 +96,10 @@ public struct Configuration: Codable, Equatable, Sendable {
self.pdfEngine = pdfEngine
}
/// Represents the default configuration for generating files using `pandoc`.
public static let `default` = Self.mock
/// Represents mock configuration for generating files using `pandoc`.
public static var mock: Self {
.init(
buildDirectory: ".build",
@@ -86,10 +111,22 @@ public struct Configuration: Codable, Equatable, Sendable {
}
}
/// Configuration options for the ansible-hpa-playbook. The playbook is
/// the primary driver of templating files, generating repository templates, and building
/// projects.
///
/// ## NOTE: These are generally only used for local development of the playbook.
///
///
public struct Playbook: Codable, Equatable, Sendable {
/// The directory location of the ansible playbook.
public let directory: String?
/// The inventory file name / location.
public let inventory: String?
/// The playbook version, branch, or tag.
public let version: String?
public init(
@@ -105,9 +142,28 @@ public struct Configuration: Codable, Equatable, Sendable {
public static var mock: Self { .init() }
}
/// Configuration settings for the user's template repository or directory.
///
/// A template is what is used to create projects for a user. Generally they setup
/// their own template by customizing the default template to their needs. This template
/// can then be stored as a git repository or on the local file system.
///
/// The template will hold variables and files that are used to generate the final output
/// files using `pandoc`. Generally the template will hold files that may only need setup once,
/// such as header files, footer files, and definitions.
///
/// The project directory contains dynamic variables / files that need edited in order
/// to generate the final output. This allows the project directory to remain smaller so the user
/// can more easily focus on the tasks required to generate the final output files.
public struct Template: Codable, Equatable, Sendable {
/// A url of the template when it is a remote git repository.
public let url: String?
/// The version, branch, or tag of the remote repository.
public let version: String?
/// The local directory that contains the template on the local file system.
public let directory: String?
public init(
@@ -129,8 +185,23 @@ public struct Configuration: Codable, Equatable, Sendable {
}
}
/// Configuration for `ansible-vault` commands. Ansible vault is used to encrypt and
/// decrypt sensitive data. This allows for variables, such as customer name and address
/// to be stored along with the project in an encrypted file so that it is safer to store them.
///
/// These may also be used in general `ansible-playbook` commands if the `useVaultArgs` is set
/// to `true` in a users configuration.
///
public struct Vault: Codable, Equatable, Sendable {
/// A list of arguments / options that get passed to the `ansible-vault` command.
///
/// - SeeAlso: `ansible-vault --help`
public let args: [String]?
/// An id that is used during encrypting `ansible-vault` files.
///
/// - SeeAlso: `ansible-vault encrypt --help`
public let encryptId: String?
public init(