feat: Fixes generation of html document, it now builds a latex document in the build directory that it then converts to html. Need to update tests.

This commit is contained in:
2025-11-17 09:38:23 -05:00
parent 8ee4e436aa
commit 045f48348d
3 changed files with 131 additions and 59 deletions

View File

@@ -4,10 +4,10 @@ import DependenciesMacros
import Foundation
import ShellClient
public extension DependencyValues {
extension DependencyValues {
/// Runs shell commands.
var commandClient: CommandClient {
public var commandClient: CommandClient {
get { self[CommandClient.self] }
set { self[CommandClient.self] = newValue }
}
@@ -67,12 +67,13 @@ public struct CommandClient: Sendable {
in workingDirectory: String? = nil,
_ arguments: [String]
) async throws {
try await runCommand(.init(
arguments: arguments,
quiet: quiet,
shell: shell,
workingDirectory: workingDirectory
))
try await runCommand(
.init(
arguments: arguments,
quiet: quiet,
shell: shell,
workingDirectory: workingDirectory
))
}
/// Runs a shell command.
@@ -161,19 +162,21 @@ extension CommandClient: DependencyKey {
.init { options in
@Dependency(\.asyncShellClient) var shellClient
if !options.quiet {
try await shellClient.foreground(.init(
shell: .init(options.shell),
environment: environment,
in: options.workingDirectory,
options.arguments
))
try await shellClient.foreground(
.init(
shell: .init(options.shell),
environment: environment,
in: options.workingDirectory,
options.arguments
))
} else {
try await shellClient.background(.init(
shell: .init(options.shell),
environment: environment,
in: options.workingDirectory,
options.arguments
))
try await shellClient.background(
.init(
shell: .init(options.shell),
environment: environment,
in: options.workingDirectory,
options.arguments
))
}
}
}
@@ -184,12 +187,12 @@ extension CommandClient: DependencyKey {
}
@_spi(Internal)
public extension CommandClient {
extension CommandClient {
/// Create a command client that can capture the arguments / options.
///
/// This is used for testing.
static func capturing(_ client: CapturingClient) -> Self {
public static func capturing(_ client: CapturingClient) -> Self {
.init { options in
await client.set(options)
}
@@ -198,7 +201,7 @@ public extension CommandClient {
/// Captures the arguments / options passed into the command client's run commands.
///
@dynamicMemberLookup
actor CapturingClient: Sendable {
public actor CapturingClient: Sendable {
public private(set) var options: RunCommandOptions?
public init() {}