Internals
This reference documents non-public utilities.
A Dates.jl package extension would currently print warnings during precompilation. See also the Julia issue #52511
Typstry.examples — Constant
examplesA constant Vector of Julia values and their corresponding Types implemented for show_typst.
Contexts
Typstry.default_context — Constant
default_contextUtilities
Typstry.compile_workload — Function
compile_workload(examples)Typstry.enclose — Function
enclose(f, io, x, left, right = reverse(left); kwargs...)Call f(io, x; kwargs...) between printing left and right, respectfully.
Examples
julia> Typstry.enclose((io, i; x) -> print(io, i, x), stdout, 1, "\$ "; x = "x")
$ 1x $Typstry.join_with — Function
join_with(f, io, xs, delimeter; kwargs...)Similar to join, except printing with f(io, x; kwargs...).
Examples
julia> Typstry.join_with((io, i; x) -> print(io, -i, x), stdout, 1:4, ", "; x = "x")
-1x, -2x, -3x, -4xTypstry.unwrap — Function
unwrap(x, key::Symbol, default)
unwrap(x, type::Type, key)Strings
Typstry.code_mode — Function
Typstry.dates — Function
dates(::Union{Dates.Date, Dates.DateTime, Dates.Period, Dates.Time})Examples
julia> Typstry.dates(Dates.Date(1))
("datetime", (:year, :month, :day), (1, 1, 1))
julia> Typstry.dates(Dates.Day(1))
("duration", (:days,), (TypstText{String}("1"),))Typstry.duration — Function
duration(::Dates.Period)Examples
julia> Typstry.duration(Dates.Day(1))
:days
julia> Typstry.duration(Dates.Hour(1))
:hoursTypstry.escape — Function
escape(io, n)Print \ to io n times.
Examples
julia> Typstry.escape(stdout, 2)
\\Typstry.format — Function
format(::Union{MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"})Return the image format acronym corresponding to the given MIME.
Examples
julia> Typstry.format(MIME"application/pdf"())
"pdf"
julia> Typstry.format(MIME"image/png"())
"png"
julia> Typstry.format(MIME"image/svg+xml"())
"svg"Typstry.indent — Function
indent(tc)Typstry.math_mode — Function
math_mode(f, io, tc, x; kwargs...)Typstry.math_pad — Function
Typstry.show_parameters — Function
show_parameters(io, tc, f, keys, final)Typstry.show_raw — Function
show_raw(::IO, ::TypstContext, ::MIME, ::Symbol, x)Typstry.backticks — Function
backticks(tc, type, key)
Typstry.block — Function
block(tc, type, key)
Typstry.depth — Function
depth(tc, type, key)
Typstry.io — Function
io(tc, type, key)
Typstry.mode — Function
mode(tc, type, key)
Typstry.parenthesize — Function
parenthesize(tc, type, key)
Typstry.preamble — Function
preamble(tc, type, key)
Typstry.tab_size — Function
tab_size(tc, type, key)