This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
pubconstParsed = struct {
language_code: []constu8,
script_tag: ?[]constu8 = null,
country_code: ?[]constu8 = null,
/// Can be a sort order (e.g. phoneb) or something like valencia, 001, etcsuffix: ?[]constu8 = null,
/// There can be any number of suffixes, but we don't need to care what their/// values are, we just need to know if any exist so that e.g. `ca-es-valencia-blah`/// can be seen as different from `ca-es-valencia`. Storing this as a bool/// allows us to avoid needing either (a) dynamic allocation or (b) a limit to/// the number of suffixes allowed when parsing.multiple_suffixes: bool = false,
pubfnisSuffixValidSortOrder(self: Parsed) bool {
if (self.country_code == null) returnfalse;
if (self.suffix == null) returnfalse;
if (self.script_tag != null) returnfalse;
if (self.multiple_suffixes) returnfalse;
for (valid_alternate_sorts) |valid_sort| {
if (std.ascii.eqlIgnoreCase(valid_sort.language_code, self.language_code) andstd.ascii.eqlIgnoreCase(valid_sort.country_code.?, self.country_code.?) andstd.ascii.eqlIgnoreCase(valid_sort.suffix.?, self.suffix.?))
{
returntrue;
}
}
returnfalse;
}
}