tiny.zen.FootnoteSet
Defined in tiny.zen.
API (5)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/zen/src/footnote/model.zig:16
zig
pub const Set = struct { definitions: []Definition, next_number: usize = 1, pub fn markFor(self: *Set, key: []const u8) ?Mark { const index = self.findIndex(key) orelse return null; const definition = &self.definitions[index]; if (definition.number == 0) { definition.number = self.next_number; self.next_number += 1; } definition.references += 1; return .{ .number = definition.number, .reference = definition.references, }; } pub fn hasReferences(self: Set) bool { for (self.definitions) |definition| { if (definition.active and definition.references != 0) return true; } return false; } pub fn findIndex(self: Set, key: []const u8) ?usize { for (self.definitions, 0..) |definition, index| { if (definition.active and std.mem.eql(u8, definition.key, key)) return index; } return null; }};Source: lib/zen/src/root.zig:115
zig
/// Borrowed footnote set that assigns numbers in reference order.pub const FootnoteSet = footnote.Set;Also reachable as
Audit
| Definitions | 4 |
|---|---|
| Public names | 8 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |