Internals

This reference documents implementation details.

Info

A Dates.jl package extension would currently print warnings during precompilation. See also the Julia issue #52511

Precompile

Strings

Typstry.Strings.Utilities.escapeFunction
escape(io::IO, count::Int)

Print \ to io count times.

Examples

julia> using Typstry: Strings.Utilities.escape

julia> escape(stdout, 1)
\

julia> escape(stdout, 2)
\\
source
Typstry.Strings.Utilities.formatFunction
format(::Union{
    MIME"application/pdf",
    MIME"image/gif",
    MIME"image/jpg",
    MIME"image/png",
    MIME"image/svg+xml",
    MIME"image/webp"
})

Return the image format acronym corresponding to the given MIME.

Examples

julia> using Typstry: Strings.Utilities.format

julia> format(MIME"application/pdf"())
"pdf"

julia> format(MIME"image/png"())
"png"

julia> format(MIME"image/svg+xml"())
"svg"
source

Utilities

Typstry.Utilities.encloseFunction
enclose(callback, io, value, left, right = reverse(left); parameters...)

Call callback(io, value; parameters...) between printing left and right, respectfully.

Examples

julia> Typstry.Utilities.enclose((io, i; x) -> print(io, i, x), stdout, 1, "\$ "; x = "x")
$ 1x $
source
Typstry.Utilities.join_withFunction
join_with(callback, io, values, delimeter; keyword_parameters...)

Similar to join, except printing with callback(io, value; keyword_parameters...).

Examples

julia> Typstry.Utilities.join_with((io, i; x) -> print(io, -i, x), stdout, 1:4, ", "; x = "x")
-1x, -2x, -3x, -4x
source