From 3e9163edf835d37b32c64675143ad62e6d5a4565 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 26 May 2024 14:03:55 +0000 Subject: [PATCH] build based on 4994940 --- development/.documenter-siteinfo.json | 2 +- development/getting_started/index.html | 2 +- development/index.html | 2 +- development/manual/commands/index.html | 36 +++++++++++----------- development/manual/internals/index.html | 32 +++++++++---------- development/manual/strings/index.html | 32 +++++++++---------- development/tutorials/interface/index.html | 2 +- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/development/.documenter-siteinfo.json b/development/.documenter-siteinfo.json index 8521e27..c367efb 100644 --- a/development/.documenter-siteinfo.json +++ b/development/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-26T13:43:13","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-26T14:03:53","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/development/getting_started/index.html b/development/getting_started/index.html index 6a83d04..0b3fdb7 100644 --- a/development/getting_started/index.html +++ b/development/getting_started/index.html @@ -64,4 +64,4 @@ "typst\"[\\\"a\\\"]\"", `TypstString`, [#["a"]], [["a"]], $["a"]$, "0xff", `Unsigned`, [#0xff], [#0xff], $#0xff$ ) -

+

diff --git a/development/index.html b/development/index.html index ba020c9..388a147 100644 --- a/development/index.html +++ b/development/index.html @@ -25,4 +25,4 @@ typst`help` julia> addenv(typst`compile input.typ output.pdf`, "TYPST_FONT_PATHS" => julia_mono) -typst`compile input.typ output.pdf`

Features

Strings

Commands

Planned

Typst

LaTeX

+typst`compile input.typ output.pdf`

Features

Strings

Commands

Planned

Typst

LaTeX

diff --git a/development/manual/commands/index.html b/development/manual/commands/index.html index ea9de61..8236473 100644 --- a/development/manual/commands/index.html +++ b/development/manual/commands/index.html @@ -5,33 +5,33 @@ typst`help` julia> TypstCommand(help; ignorestatus = true) -typst`help`source
Typstry.TypstErrorType
TypstError <: Exception
-TypstError(::TypstCommand)

An Exception indicating an failure to run a TypstCommand.

source
Typstry.@typst_cmdMacro
@typst_cmd(s)
+typst`help`
source
Typstry.TypstErrorType
TypstError <: Exception
+TypstError(::TypstCommand)

An Exception indicating an failure to run a TypstCommand.

source
Typstry.@typst_cmdMacro
@typst_cmd(s)
 typst`s`

Construct a TypstCommand where each parameter is separated by a space.

This does not support interpolation; use the TypstCommand constructor instead.

Examples

julia> typst`help`
 typst`help`
 
 julia> typst`compile input.typ output.typ`
-typst`compile input.typ output.typ`
source
Typstry.julia_monoConstant
julia_mono

An constant artifact containing the JuliaMono typeface.

Use with a TypstCommand and one of addenv, setenv, or the font-path command-line option.

source

Base

Base.:==Function
==(::TypstCommand, ::TypstCommand)

See also TypstCommand.

Examples

julia> typst`help` == typst`help`
+typst`compile input.typ output.typ`
source
Typstry.julia_monoConstant
julia_mono

An constant artifact containing the JuliaMono typeface.

Use with a TypstCommand and one of addenv, setenv, or the font-path command-line option.

source

Base

Base.:==Function
==(::TypstCommand, ::TypstCommand)

See also TypstCommand.

Examples

julia> typst`help` == typst`help`
 true
 
 julia> typst`help` == ignorestatus(typst`help`)
-false
source
Base.addenvFunction
addenv(::TypstCommand, args...; kwargs...)

See also TypstCommand and julia_mono.

Examples

julia> addenv(typst`compile input.typ output.pdf`, "TYPST_FONT_PATHS" => julia_mono)
-typst`compile input.typ output.pdf`
source
Base.detachFunction
detach(::TypstCommand)

See also TypstCommand.

Examples

julia> detach(typst`help`)
-typst`help`
source
Base.eltypeFunction
eltype(::Type{TypstCommand})

See also TypstCommand.

Examples

julia> eltype(TypstCommand)
-String
source
Base.firstindexFunction
firstindex(::TypstCommand)

See also TypstCommand.

Examples

julia> firstindex(typst`help`)
-1
source
Base.getindexFunction
getindex(::TypstCommand, i)

See also TypstCommand.

Examples

julia> typst`help`[2]
-"help"
source
Base.hashFunction
hash(::TypstCommand, ::UInt)

See also TypstCommand.

source
Base.ignorestatusFunction
ignorestatus(::TypstCommand)

See also TypstCommand.

Examples

julia> ignorestatus(typst`help`)
-typst`help`
source
Base.iterateMethod
iterate(::TypstCommand)
+false
source
Base.addenvFunction
addenv(::TypstCommand, args...; kwargs...)

See also TypstCommand and julia_mono.

Examples

julia> addenv(typst`compile input.typ output.pdf`, "TYPST_FONT_PATHS" => julia_mono)
+typst`compile input.typ output.pdf`
source
Base.detachFunction
detach(::TypstCommand)

See also TypstCommand.

Examples

julia> detach(typst`help`)
+typst`help`
source
Base.eltypeFunction
eltype(::Type{TypstCommand})

See also TypstCommand.

Examples

julia> eltype(TypstCommand)
+String
source
Base.firstindexFunction
firstindex(::TypstCommand)

See also TypstCommand.

Examples

julia> firstindex(typst`help`)
+1
source
Base.getindexFunction
getindex(::TypstCommand, i)

See also TypstCommand.

Examples

julia> typst`help`[2]
+"help"
source
Base.hashFunction
hash(::TypstCommand, ::UInt)

See also TypstCommand.

source
Base.ignorestatusFunction
ignorestatus(::TypstCommand)

See also TypstCommand.

Examples

julia> ignorestatus(typst`help`)
+typst`help`
source
Base.iterateMethod
iterate(::TypstCommand)
 iterate(::TypstCommand, i)

See also TypstCommand.

Examples

julia> iterate(typst`help`, 2)
 ("help", 3)
 
-julia> iterate(typst`help`, 3)
source
Base.keysFunction
keys(::TypstCommand)

See also TypstCommand.

Examples

julia> keys(typst`help`)
+julia> iterate(typst`help`, 3)
source
Base.keysFunction
keys(::TypstCommand)

See also TypstCommand.

Examples

julia> keys(typst`help`)
 2-element LinearIndices{1, Tuple{Base.OneTo{Int64}}}:
  1
- 2
source
Base.lastindexFunction
lastindex(::TypstCommand)

See also TypstCommand.

Examples

julia> lastindex(typst`help`)
-2
source
Base.lengthFunction
length(::TypstCommand)

See also TypstCommand.

Examples

julia> length(typst`help`)
-2
source
Base.runFunction
run(::TypstCommand, args...; kwargs...)

See also TypstCommand.

Info

Errors from the Typst compiler are printed to stderr. If ignorestatus has been applied, this will not throw an error in Julia. Otherwise, the Typst error will be printed before the Julia error.

source
Base.setcpuaffinityFunction
setcpuaffinity(::TypstCommand, cpus)

See also TypstCommand.

Compat

Requires at least Julia v0.8.

Examples

julia> setcpuaffinity(typst`help`, nothing)
-typst`help`
source
Base.setenvFunction
setenv(::TypstCommand, args...; kwargs...)

See also TypstCommand and julia_mono.

Examples

julia> setenv(typst`compile input.typ output.pdf`, "TYPST_FONT_PATHS" => julia_mono)
-typst`compile input.typ output.pdf`
source
Base.showMethod
show(::IO, ::MIME"text/plain", ::TypstCommand)

See also TypstCommand.

Examples

julia> show(stdout, "text/plain", typst`help`)
-typst`help`
source
Base.showerrorFunction
showerror(::IO, ::TypstError)

Print a TypstError when failing to run a TypstCommand.

Examples

julia> showerror(stdout, TypstError(typst``))
-TypstError: failed to `run` a `TypstCommand([""]))`
source
+ 2source
Base.lastindexFunction
lastindex(::TypstCommand)

See also TypstCommand.

Examples

julia> lastindex(typst`help`)
+2
source
Base.lengthFunction
length(::TypstCommand)

See also TypstCommand.

Examples

julia> length(typst`help`)
+2
source
Base.runFunction
run(::TypstCommand, args...; kwargs...)

See also TypstCommand.

Info

Errors from the Typst compiler are printed to stderr. If ignorestatus has been applied, this will not throw an error in Julia. Otherwise, the Typst error will be printed before the Julia error.

source
Base.setcpuaffinityFunction
setcpuaffinity(::TypstCommand, cpus)

See also TypstCommand.

Compat

Requires at least Julia v0.8.

Examples

julia> setcpuaffinity(typst`help`, nothing)
+typst`help`
source
Base.setenvFunction
setenv(::TypstCommand, args...; kwargs...)

See also TypstCommand and julia_mono.

Examples

julia> setenv(typst`compile input.typ output.pdf`, "TYPST_FONT_PATHS" => julia_mono)
+typst`compile input.typ output.pdf`
source
Base.showMethod
show(::IO, ::MIME"text/plain", ::TypstCommand)

See also TypstCommand.

Examples

julia> show(stdout, "text/plain", typst`help`)
+typst`help`
source
Base.showerrorFunction
showerror(::IO, ::TypstError)

Print a TypstError when failing to run a TypstCommand.

Examples

julia> showerror(stdout, TypstError(typst``))
+TypstError: failed to `run` a `TypstCommand([""]))`
source
diff --git a/development/manual/internals/index.html b/development/manual/internals/index.html index 8772d4a..4a1e253 100644 --- a/development/manual/internals/index.html +++ b/development/manual/internals/index.html @@ -3,39 +3,39 @@ Typstry.TypstText("a") julia> Typstry.TypstText([1, 2, 3, 4]) -Typstry.TypstText("[1, 2, 3, 4]")source
Typstry.examplesConstant
examples

A constant Vector of Julia values and their corresponding Types implemented for show(::IO, ::MIME"text/plain", ::Union{Typst, TypstString}).

source
Typstry.preambleConstant
preamble

A constant used at the beginning of Typst source files generated by show(::IO, ::Union{MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"}, ::TypstString).

Examples

julia> println(Typstry.preamble)
+Typstry.TypstText("[1, 2, 3, 4]")
source
Typstry.examplesConstant
examples

A constant Vector of Julia values and their corresponding Types implemented for show(::IO, ::MIME"text/plain", ::Union{Typst, TypstString}).

source
Typstry.preambleConstant
preamble

A constant used at the beginning of Typst source files generated by show(::IO, ::Union{MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"}, ::TypstString).

Examples

julia> println(Typstry.preamble)
 #set page(margin: 1em, height: auto, width: auto, fill: white)
-#set text(16pt, font: "JuliaMono")
source
Typstry.settingsConstant
settings

A constant NamedTuple containing the default IOContext settings used in show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

Examples

julia> Typstry.settings
-(block = false, depth = 0, indent = "    ", mode = markup, parenthesize = true)
source
Typstry.typst_mimeConstant
typst_mime

Examples

julia> Typstry.typst_mime
-MIME type text/typst
source
Typstry.blockFunction
block(io)

Return io[:block]::Bool.

Examples

julia> Typstry.block(IOContext(stdout, :block => true))
-true
source
Typstry.code_modeFunction
code_mode(io)

Print the number sign, unless mode(io) == code.

See also Mode and mode.

Examples

julia> Typstry.code_mode(IOContext(stdout, :mode => code))
+#set text(16pt, font: "JuliaMono")
source
Typstry.settingsConstant
settings

A constant NamedTuple containing the default IOContext settings used in show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

Examples

julia> Typstry.settings
+(block = false, depth = 0, indent = "    ", mode = markup, parenthesize = true)
source
Typstry.typst_mimeConstant
typst_mime

Examples

julia> Typstry.typst_mime
+MIME type text/typst
source
Typstry.blockFunction
block(io)

Return io[:block]::Bool.

Examples

julia> Typstry.block(IOContext(stdout, :block => true))
+true
source
Typstry.code_modeFunction
code_mode(io)

Print the number sign, unless mode(io) == code.

See also Mode and mode.

Examples

julia> Typstry.code_mode(IOContext(stdout, :mode => code))
 
 julia> Typstry.code_mode(IOContext(stdout, :mode => markup))
 #
 
 julia> Typstry.code_mode(IOContext(stdout, :mode => math))
-#
source
Typstry.depthFunction
depth(io)

Return io[:depth]::Int.

Examples

julia> Typstry.depth(IOContext(stdout, :depth => 0))
-0
source
Typstry.encloseFunction
enclose(f, io, x, left, right = reverse(left); settings...)

Call f(io, x; settings...) between printing left and right, respectfully.

Examples

julia> Typstry.enclose((io, i; x) -> print(io, i, x), stdout, 1, "\$ "; x = "x")
-$ 1x $
source
Typstry.formatFunction
format(::Union{MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"})

Examples

julia> Typstry.format(MIME"application/pdf"())
+#
source
Typstry.depthFunction
depth(io)

Return io[:depth]::Int.

Examples

julia> Typstry.depth(IOContext(stdout, :depth => 0))
+0
source
Typstry.encloseFunction
enclose(f, io, x, left, right = reverse(left); settings...)

Call f(io, x; settings...) between printing left and right, respectfully.

Examples

julia> Typstry.enclose((io, i; x) -> print(io, i, x), stdout, 1, "\$ "; x = "x")
+$ 1x $
source
Typstry.formatFunction
format(::Union{MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"})

Examples

julia> Typstry.format(MIME"application/pdf"())
 "pdf"
 
 julia> Typstry.format(MIME"image/png"())
 "png"
 
 julia> Typstry.format(MIME"image/svg+xml"())
-"svg"
source
Typstry.indentFunction
indent(io)

Return io[:indent]::String.

Examples

julia> Typstry.indent(IOContext(stdout, :indent => ' ' ^ 4))
-"    "
source
Typstry.join_withFunction
join_with(f, io, xs, delimeter; settings...)

Similar to join, except printing with f(io, x; settings...).

Examples

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

Return "", "\$", or "\$ " depending on the block and mode settings.

Examples

julia> Typstry.math_pad(IOContext(stdout, :mode => math))
+"svg"
source
Typstry.indentFunction
indent(io)

Return io[:indent]::String.

Examples

julia> Typstry.indent(IOContext(stdout, :indent => ' ' ^ 4))
+"    "
source
Typstry.join_withFunction
join_with(f, io, xs, delimeter; settings...)

Similar to join, except printing with f(io, x; settings...).

Examples

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

Return "", "\$", or "\$ " depending on the block and mode settings.

Examples

julia> Typstry.math_pad(IOContext(stdout, :mode => math))
 ""
 
 julia> Typstry.math_pad(IOContext(stdout, :block => true, :mode => markup))
 "\$ "
 
 julia> Typstry.math_pad(IOContext(stdout, :block => false, :mode => markup))
-"\$"
source
Typstry.modeFunction
mode(io)

Return io[:mode]::Mode.

See also Mode.

Examples

julia> Typstry.mode(IOContext(stdout, :mode => code))
-code::Mode = 0
source
Typstry.parenthesizeFunction
parenthesize(io)

Return io[:parenthesize]::Bool.

Examples

julia> Typstry.parenthesize(IOContext(stdout, :parenthesize => true))
-true
source
Typstry.print_parametersFunction
print_parameters(io, f, keys)

Print the name of a Typst function, an opening parenthesis, the parameters to a Typst function, and a newline.

Skip keys that are not in the IOContext.

Examples

julia> Typstry.print_parameters(
+"\$"
source
Typstry.modeFunction
mode(io)

Return io[:mode]::Mode.

See also Mode.

Examples

julia> Typstry.mode(IOContext(stdout, :mode => code))
+code::Mode = 0
source
Typstry.parenthesizeFunction
parenthesize(io)

Return io[:parenthesize]::Bool.

Examples

julia> Typstry.parenthesize(IOContext(stdout, :parenthesize => true))
+true
source
Typstry.print_parametersFunction
print_parameters(io, f, keys)

Print the name of a Typst function, an opening parenthesis, the parameters to a Typst function, and a newline.

Skip keys that are not in the IOContext.

Examples

julia> Typstry.print_parameters(
            IOContext(stdout, :delim => "\"(\""),
        "vec", [:delim, :gap])
-vec(delim: "(",
source
Typstry.print_quotedFunction
print_quoted(io, s)

Print the string enclosed in double quotation marks and with interior double quotations marks escaped.

Examples

julia> Typstry.print_quoted(stdout, TypstString("a"))
-"\"a\""
source
Typstry.show_arrayFunction
show_array(io, x)
source
Typstry.show_vectorFunction
show_vector(io, x)
source
Typstry.static_parseFunction
static_parse(args...; filename, kwargs...)

Call Meta.parse with the filename if it is supported in the current Julia version (at least v1.10).

source

Commands

Typstry.typst_compilerConstant
typst_compiler

A constant Cmd that is the Typst compiler given by Typst_jll.jl with no additional parameters.

source
Typstry.applyFunction
apply(f, tc, args...; kwargs...)
source
+vec(delim: "(",source
Typstry.print_quotedFunction
print_quoted(io, s)

Print the string enclosed in double quotation marks and with interior double quotations marks escaped.

Examples

julia> Typstry.print_quoted(stdout, TypstString("a"))
+"\"a\""
source
Typstry.show_arrayFunction
show_array(io, x)
source
Typstry.show_vectorFunction
show_vector(io, x)
source
Typstry.static_parseFunction
static_parse(args...; filename, kwargs...)

Call Meta.parse with the filename if it is supported in the current Julia version (at least v1.10).

source

Commands

Typstry.typst_compilerConstant
typst_compiler

A constant Cmd that is the Typst compiler given by Typst_jll.jl with no additional parameters.

source
Typstry.applyFunction
apply(f, tc, args...; kwargs...)
source
diff --git a/development/manual/strings/index.html b/development/manual/strings/index.html index 972fd5c..fa17fe8 100644 --- a/development/manual/strings/index.html +++ b/development/manual/strings/index.html @@ -3,17 +3,17 @@ Enum Mode: code = 0 markup = 1 -math = 2source
Typstry.TypstType
Typst{T}
+math = 2
source
Typstry.TypstType
Typst{T}
 Typst(::T)

A wrapper used to pass values to show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

julia> Typst(1)
 Typst{Int64}(1)
 
 julia> Typst("a")
-Typst{String}("a")
source
Typstry.TypstStringType
TypstString <: AbstractString
+Typst{String}("a")
source
Typstry.TypstStringType
TypstString <: AbstractString
 TypstString(::Any; context...)

Convert the value to a Typst formatted string.

Optional Julia settings and Typst parameters are passed to show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}) in an IOContext. See also show_typst for a list of supported types.

Info

This type implements the String interface. However, the interface is unspecified which may result unexpected behavior.

Examples

julia> TypstString("a")
 typst"\"a\""
 
 julia> TypstString("a"; mode = code)
-typst"\"\\\"a\\\"\""
source
Typstry.@typst_strMacro
@typst_str(s)
+typst"\"\\\"a\\\"\""
source
Typstry.@typst_strMacro
@typst_str(s)
 typst"s"

Construct a TypstString.

Control characters are escaped, except double quotation marks and backslashes in the same manner as @raw_str. TypstStrings containing control characters may be created using typst_text. Values may be interpolated by calling the TypstString constructor, except using a backslash instead of the type name.

Tip

Pring directly to an IO using show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

See also the performance tip to Avoid string interpolation for I/O.

Examples

julia> x = 1;
 
 julia> typst"$ \(x) / \(x + 1) $"
@@ -26,47 +26,47 @@
 typst"(1 / 2)"
 
 julia> typst"\\(x)"
-typst"\\(x)"
source
Typstry.show_typstFunction
show_typst(x)

Print the Typst format to stdout with default Julia settings and Typst parameters.

Examples

julia> show_typst(1 // 2)
+typst"\\(x)"
source
Typstry.show_typstFunction
show_typst(x)

Print the Typst format to stdout with default Julia settings and Typst parameters.

Examples

julia> show_typst(1 // 2)
 $1 / 2$
 
 julia> show_typst(1:4)
 $vec(
     1, 2, 3, 4
-)$
source
show_typst(io, x)

Print the Typst format using Julia settings and Typst parameters in an IOContext.

Settings are used in Julia to format the TypstString and can be any type. Parameters are passed to a function in the Typst source file and must be a String with the same name as in Typst, except that dashes are replaced with underscores.

For additional information on parameters and settings, see also show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}) and the Typst Documentation, respectively. For additional information on printing and rendering, see also Examples.

Tip

Implement this function for custom types to specify their Typst formatting.

Warning

This function's methods are incomplete. Please file an issue or create a pull-request for missing methods.

TypeSettingsParameters
AbstractArray:block, :depth, :indent, :mode:delim, :gap
AbstractChar:mode
AbstractFloat
AbstractMatrix:block, :depth, :indent, :mode:augment, :column_gap, :delim, :gap, :row_gap
AbstractString:mode
Bool:mode
Complex:block, :mode, :parenthesize
Irrational:mode
Nothing:mode
OrdinalRange{<:Integer, <:Integer}:mode
Rational:block, :mode, :parenthesize
Regex:mode
Signed
StepRangeLen{<:Integer, <:Integer, <:Integer}:mode
Text:mode
Typst
TypstString

Examples

julia> show_typst(stdout, 1)
+)$
source
show_typst(io, x)

Print the Typst format using Julia settings and Typst parameters in an IOContext.

Settings are used in Julia to format the TypstString and can be any type. Parameters are passed to a function in the Typst source file and must be a String with the same name as in Typst, except that dashes are replaced with underscores.

For additional information on parameters and settings, see also show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}) and the Typst Documentation, respectively. For additional information on printing and rendering, see also Examples.

Tip

Implement this function for custom types to specify their Typst formatting.

Warning

This function's methods are incomplete. Please file an issue or create a pull-request for missing methods.

TypeSettingsParameters
AbstractArray:block, :depth, :indent, :mode:delim, :gap
AbstractChar:mode
AbstractFloat
AbstractMatrix:block, :depth, :indent, :mode:augment, :column_gap, :delim, :gap, :row_gap
AbstractString:mode
Bool:mode
Complex:block, :mode, :parenthesize
Irrational:mode
Nothing:mode
OrdinalRange{<:Integer, <:Integer}:mode
Rational:block, :mode, :parenthesize
Regex:mode
Signed
StepRangeLen{<:Integer, <:Integer, <:Integer}:mode
Text:mode
Typst
TypstString

Examples

julia> show_typst(stdout, 1)
 1
 
 julia> show_typst(IOContext(stdout, :mode => code), "a")
-"\"a\""
source
Typstry.typst_textFunction
typst_text(::Any)

Construct a TypstString using print instead of show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

Warning

Unescaped control characters in TypstStrings may break formatting in some environments, such as the REPL.

Examples

julia> typst_text("a")
+"\"a\""
source
Typstry.typst_textFunction
typst_text(::Any)

Construct a TypstString using print instead of show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString}).

Warning

Unescaped control characters in TypstStrings may break formatting in some environments, such as the REPL.

Examples

julia> typst_text("a")
 typst"a"
 
 julia> typst_text([1, 2, 3, 4])
-typst"[1, 2, 3, 4]"
source

Base

Base.IOBufferType
IOBuffer(::TypstString)

See also TypstString.

Examples

julia> IOBuffer(typst"a")
-IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=1, maxsize=Inf, ptr=1, mark=-1)
source
Base.codeunitFunction
codeunit(::TypstString)
+typst"[1, 2, 3, 4]"
source

Base

Base.IOBufferType
IOBuffer(::TypstString)

See also TypstString.

Examples

julia> IOBuffer(typst"a")
+IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=1, maxsize=Inf, ptr=1, mark=-1)
source
Base.codeunitFunction
codeunit(::TypstString)
 codeunit(::TypstString, ::Integer)

See also TypstString.

Examples

julia> codeunit(typst"a")
 UInt8
 
 julia> codeunit(typst"a", 1)
-0x61
source
Base.isvalidFunction
isvalid(::TypstString, ::Integer)

See also TypstString.

Examples

julia> isvalid(typst"a", 1)
-true
source
Base.iterateMethod
iterate(::TypstString, ::Integer)
+0x61
source
Base.isvalidFunction
isvalid(::TypstString, ::Integer)

See also TypstString.

Examples

julia> isvalid(typst"a", 1)
+true
source
Base.iterateMethod
iterate(::TypstString, ::Integer)
 iterate(::TypstString)

See also TypstString.

Examples

julia> iterate(typst"a")
 ('a', 2)
 
 julia> iterate(typst"a", 1)
-('a', 2)
source
Base.ncodeunitsFunction
ncodeunits(::TypstString)

See also TypstString.

Examples

julia> ncodeunits(typst"a")
-1
source
Base.pointerFunction
pointer(::TypstString)

See also TypstString.

source
Base.reprFunction
repr(::MIME, ::TypstString; kwargs...)

See also TypstString.

Info

This method patches incorrect output from the assumption in repr that the parameter is already in the requested MIME type when the MIME type istextmime and the parameter is an AbstractString.

Examples

julia> repr(MIME"text/plain"(), typst"a")
+('a', 2)
source
Base.ncodeunitsFunction
ncodeunits(::TypstString)

See also TypstString.

Examples

julia> ncodeunits(typst"a")
+1
source
Base.pointerFunction
pointer(::TypstString)

See also TypstString.

source
Base.reprFunction
repr(::MIME, ::TypstString; kwargs...)

See also TypstString.

Info

This method patches incorrect output from the assumption in repr that the parameter is already in the requested MIME type when the MIME type istextmime and the parameter is an AbstractString.

Examples

julia> repr(MIME"text/plain"(), typst"a")
 "typst\"a\""
 
 julia> repr(MIME"text/typst"(), typst"a")
-typst"a"
source
Base.showMethod
show(::IO, ::TypstString)

See also TypstString.

Examples

julia> show(stdout, typst"a")
-typst"a"
source
Base.showMethod
show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString})

Print the Typst format.

Provides default settings for show_typst which may be specified in an IOContext.

See also Typst and TypstString.

Tip

Implement this function for custom types to specify their default settings and parameters. Remember to Avoid type piracy.

SettingDefaultTypeDescription
:blockfalseBoolWhen :mode => math, specifies whether the enclosing dollar signs are padded with a space to render the element inline or its own block.
:depth0IntThe current level of nesting within container types to specify the degree of indentation.
:indent' ' ^ 4StringThe string used for horizontal spacing by some elements with multi-line Typst formatting.
:modemarkupModeThe current Typst context where code follows the number sign, markup is at the top-level and enclosed in square brackets, and math is enclosed in dollar signs.
:parenthesizetrueBoolWhether to enclose some mathematical elements in parentheses.

Examples

julia> show(stdout, "text/typst", typst"a")
+typst"a"
source
Base.showMethod
show(::IO, ::TypstString)

See also TypstString.

Examples

julia> show(stdout, typst"a")
+typst"a"
source
Base.showMethod
show(::IO, ::MIME"text/typst", ::Union{Typst, TypstString})

Print the Typst format.

Provides default settings for show_typst which may be specified in an IOContext.

See also Typst and TypstString.

Tip

Implement this function for custom types to specify their default settings and parameters. Remember to Avoid type piracy.

SettingDefaultTypeDescription
:blockfalseBoolWhen :mode => math, specifies whether the enclosing dollar signs are padded with a space to render the element inline or its own block.
:depth0IntThe current level of nesting within container types to specify the degree of indentation.
:indent' ' ^ 4StringThe string used for horizontal spacing by some elements with multi-line Typst formatting.
:modemarkupModeThe current Typst context where code follows the number sign, markup is at the top-level and enclosed in square brackets, and math is enclosed in dollar signs.
:parenthesizetrueBoolWhether to enclose some mathematical elements in parentheses.

Examples

julia> show(stdout, "text/typst", typst"a")
 a
 
 julia> show(stdout, "text/typst", Typst("a"))
 "a"
 
 julia> show(IOContext(stdout, :mode => code), "text/typst", Typst("a"))
-"\"a\""
source
Base.showMethod
show(::IO, ::Union{
+"\"a\""
source
Base.showMethod
show(::IO, ::Union{
     MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"
 }, ::TypstString)

Print the Portable Document Format (PDF), Portable Network Graphics (PNG), or Scalable Vector Graphics (SVG) format.

The corresponding Typst source file begins with this preamble:

#set page(margin: 1em, height: auto, width: auto, fill: white)
 #set text(16pt, font: "JuliaMono")
-
Note

Environments such as Pluto.jl notebooks use this function to render TypstStrings to a document.

source
+
Note

Environments such as Pluto.jl notebooks use this function to render TypstStrings to a document.

source diff --git a/development/tutorials/interface/index.html b/development/tutorials/interface/index.html index 8de171b..97064ea 100644 --- a/development/tutorials/interface/index.html +++ b/development/tutorials/interface/index.html @@ -65,4 +65,4 @@ range(1, 6, step: 2) julia> println(TypstString(1:2.0:6; mode = code)) -(1.0, 3.0, 5.0) +(1.0, 3.0, 5.0)