Skip to content

API index

The public symbols of sparkles:base, by module.

sparkles.base

Package module re-exporting lifetime, logger, prettyprint, smallbuffer, source_uri, styled_template, term_style, and text.

sparkles.base.smallbuffer

SymbolDescription
SmallBuffer!(T, N)Stack-first append buffer that grows with pureMalloc if needed.
checkToString / checkWriter@nogc unit-test helpers for output-range rendering assertions.

sparkles.base.lifetime

SymbolDescription
recycledInstance!T(args)Reinitialises one thread-local static instance of T.
recycledErrorInstance!T(...)Builds an Error subclass in recycled storage for @nogc throw paths.

sparkles.base.text

The package re-exports text.writers, text.readers, text.enums, and text.errors.

ModuleDescription
sparkles.base.text.writersInteger, float, duration, byte, escape, and value writers.
sparkles.base.text.readersSlice-advance parsers such as readInteger and readUntil.
sparkles.base.text.enumsEnum text helpers such as StringRepresentation.
sparkles.base.text.errorsParseErrorCode, ParseError, and ParseExpected!T.

sparkles.base.term_style

SymbolDescription
StyleANSI foreground, background, and attribute enum.
stylizeWrap text in one ANSI style.
stylizedTextBuilderCTFE-friendly chained styling builder.
styleName / styleSampleStyle names and sample strings.

sparkles.base.styled_template

SymbolDescription
writeStyledWrites styled IES to an output range.
styledTextAllocating styled string conversion.
plainTextAllocating conversion with style markup stripped.
styledWrite*stdout/stderr helpers for styled IES.
styleFromNameRuntime lookup for style names used by the parser.

sparkles.base.logger

SymbolDescription
CoreLoggerstd.logger.Logger base class with a Sparkles @nogc log path.
CoreLogEntryMetadata captured for Sparkles log calls.
DeltaTimeLoggerstderr logger with wall-clock and monotonic delta prefixes.
sharedCoreLogAtomic process-wide Sparkles logger.
coreGlobalLogLevelAtomic process-wide Sparkles log-level filter.
CoreFatalHandler / coreFatalHandlerFatal policy hook and global accessor.
throwingFatalHandlerThrows recycled FatalLogError.
assertingFatalHandlerFails with assert(0, message).
abortingFatalHandlerCalls abort().
log, trace, info, warning, error, critical, fatalStyled IES logging wrappers.
initLoggerInstalls DeltaTimeLogger for Phobos and Sparkles globals.

sparkles.base.prettyprint

SymbolDescription
PrettyPrintOptionsConfiguration for structural indentation and syntax highlighting.
prettyPrintPretty-prints any D value to a writer or returns a string.

sparkles.base.source_uri

SymbolDescription
resolveSourcePathResolves relative source path to absolute path.
FileUriHookDefault hook that formats source locations as file:// URIs.
SchemeHookHook that formats source locations using custom editor schemes.
EditorDetectHookRuntime detector using $VISUAL/$EDITOR environment variables.