Skip to documentation
SLOP

tiny.zen.Diagnostic

Reference tiny.zen Diagnostic

Defined in diagnostic.

Fixed-capacity detail for a failed page, equation, heading, or inline feature.

API (16)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callsdiagnosticDiagnostic
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/zen/src/diagnostic.zig:13

zig
/// Fixed-capacity detail for a failed page, equation, heading, or inline feature.////// Supply its address through Markdown or site options. After an error, inspect/// `page()`, the feature source, `reason`, and `offset`, then call `reset` before/// reuse.pub const Diagnostic = struct {    page_buffer: [max_page_bytes]u8 = undefined,    page_len: usize = 0,    equation_buffer: [max_equation_bytes]u8 = undefined,    equation_len: usize = 0,    inline_buffer: [max_inline_bytes]u8 = undefined,    inline_len: usize = 0,    /// Short cause suitable for a repair message; empty when no detail is captured.    reason: []const u8 = "",    /// Byte offset in the original inline source, heading feature, or equation.    /// It can lie beyond a bounded or sanitized captured excerpt.    offset: usize = 0,    /// Returns the page path, truncated with an ellipsis if needed.    pub fn page(self: *const Diagnostic) []const u8 {        return self.page_buffer[0..self.page_len];    }    /// Returns the captured equation, truncated with an ellipsis if needed.    pub fn equation(self: *const Diagnostic) []const u8 {        return self.equation_buffer[0..self.equation_len];    }    /// Returns a bounded UTF-8-safe source prefix for context, not indexing.    /// Invalid bytes become `?` and excess source ends in `...`.    pub fn inlineSource(self: *const Diagnostic) []const u8 {        return self.inline_buffer[0..self.inline_len];    }    /// Clears captured detail before a retry or unrelated operation.    pub fn reset(self: *Diagnostic) void {        self.* = .{};    }    pub fn setPage(self: *Diagnostic, path: []const u8) void {        self.page_len = copyEllipsized(&self.page_buffer, path);    }    pub fn setEquation(self: *Diagnostic, source: []const u8, detail: math.Diagnostic) void {        self.equation_len = copyEllipsized(&self.equation_buffer, source);        self.inline_len = 0;        self.reason = detail.reason;        self.offset = detail.offset;    }    pub fn setHeading(self: *Diagnostic, reason: []const u8, offset: usize) void {        self.equation_len = 0;        self.inline_len = 0;        self.reason = reason;        self.offset = offset;    }    pub fn setInline(self: *Diagnostic, source: []const u8, reason: []const u8, offset: usize) void {        self.equation_len = 0;        self.inline_len = copyEllipsized(&self.inline_buffer, source);        self.reason = reason;        self.offset = offset;    }};

Source: lib/zen/src/root.zig:340

zig
/// Fixed-capacity source-local detail for rendering and publication failures.pub const Diagnostic = diagnostic.Diagnostic;
Called byCallsNo direct callstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.diagnostictest: diagnostic truncates long captu...test sourcelib.zen.src.markdowntest: markdown names the offending eq...test sourcelib.zen.src.site.testtest: site build names the failing pa...test sourcelib.zen.src.site.testtest: site build names the failing pa...Diagnosticequation
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.diagnostictest: diagnostic truncates long captu...test sourcelib.zen.src.diagnostictest: diagnostic truncation preserves...test sourcelib.zen.src.markdowntest: markdown names malformed inline...DiagnosticinlineSource
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.site.testtest: site build names the failing pa...test sourcelib.zen.src.site.testtest: site build names the failing pa...test sourcelib.zen.src.site.testtest: site build rejects catalog over...test sourcelib.zen.src.site.testtest: site build reuses surveyed Mark...Diagnosticpage
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.markdowntest: markdown names malformed inline...test sourcelib.zen.src.markdowntest: markdown names the offending eq...Diagnosticreset
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.diagnostictest: diagnostic truncates long captu...private sourcelib.zen.src.diagnosticcopyEllipsizedDiagnosticsetEquation
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...DiagnosticsetHeading
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...test sourcelib.zen.src.diagnostictest: diagnostic truncates long captu...test sourcelib.zen.src.diagnostictest: diagnostic truncation preserves...private sourcelib.zen.src.diagnosticcopyEllipsizedDiagnosticsetInline
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.zen.src.diagnostictest: diagnostic captures page and eq...private sourcelib.zen.src.diagnosticcopyEllipsizedDiagnosticsetPage
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

markdown.Diagnostic.

Audit

Definitions9
Public names27
Members8
Version26.7.0
Revisiondaab053ee433