From 6bbca295c07f38276d5a38f13299b05528bc08f5 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sat, 13 Jul 2024 08:23:56 +0000 Subject: [PATCH] build based on bd1211f --- development/.documenter-siteinfo.json | 2 +- development/getting_started/index.html | 2 +- development/index.html | 2 +- development/manual/commands/index.html | 42 +++++++++++----------- development/manual/extensions/index.html | 2 +- development/manual/internals/index.html | 32 ++++++++--------- development/manual/strings/index.html | 32 ++++++++--------- development/tutorials/interface/index.html | 2 +- development/tutorials/makie_tex.svg | 26 ++++++++++++-- development/tutorials/packages/index.html | 30 +++------------- 10 files changed, 87 insertions(+), 85 deletions(-) diff --git a/development/.documenter-siteinfo.json b/development/.documenter-siteinfo.json index 26c1c3c..dca38ff 100644 --- a/development/.documenter-siteinfo.json +++ b/development/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-13T07:55:39","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-13T08:23:53","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/development/getting_started/index.html b/development/getting_started/index.html index 3f599ed..2fbaa2f 100644 --- a/development/getting_started/index.html +++ b/development/getting_started/index.html @@ -11,4 +11,4 @@ typst"$ π approx 3.141592653589793 $"

Commands

Use render to easily generate a Typst source file and compile it into a document.

julia> render(Any[true 1; 1.2 1 // 2]);

Compile source files by running a TypstCommand created using its constructor or @typst_cmd.

julia> TypstCommand(["help"])
 typst`help`
 
-julia> run(typst`compile input.typ output.pdf`);

Examples

These Typst documents were generated from Julia using show with the text/typst MIME type and compiled using a TypstCommand. Each row corresponds to a method of show_typst. Sequential documents correspond to package Extensions.

Tip

Open these images in a new tab or another viewer.

Typstry.jl examples LaTeXStrings.jl examples Markdown.jl examples

+julia> run(typst`compile input.typ output.pdf`);

Examples

These Typst documents were generated from Julia using show with the text/typst MIME type and compiled using a TypstCommand. Each row corresponds to a method of show_typst. Sequential documents correspond to package Extensions.

Tip

Open these images in a new tab or another viewer.

Typstry.jl examples LaTeXStrings.jl examples Markdown.jl examples

diff --git a/development/index.html b/development/index.html index ccac3c0..9fc995d 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

Similar Packages

Typst

LaTeX

+typst`compile input.typ output.pdf`

Features

Strings

Commands

Planned

Similar Packages

Typst

LaTeX

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

An Exception indicating a failure to run a TypstCommand.

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

An Exception indicating a failure to run a TypstCommand.

source
Typstry.Commands.@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 constructor instead.

Examples

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

An constant artifact containing the JuliaMono typeface.

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

source
Typstry.Commands.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.Commands.preamble)
+typst`compile input.typ output.typ`
source
Typstry.Commands.julia_monoConstant
julia_mono

An constant artifact containing the JuliaMono typeface.

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

source
Typstry.Commands.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.Commands.preamble)
 #set page(margin: 1em, height: auto, width: auto, fill: white)
-#set text(16pt, font: "JuliaMono")
source
Typstry.Commands.renderFunction
render(x;
+#set text(16pt, font: "JuliaMono")
source
Typstry.Commands.renderFunction
render(x;
     input = "input.typ",
     output = "output.pdf",
     open = true,
@@ -21,32 +21,32 @@
         #set page(margin: 1em, height: auto, width: auto, fill: white)
         #set text(16pt, font: "JuliaMono")
     """,
-context...)

Render to a document using show(::IO, ::MIME"text/typst", ::Typst).

This generates two files: the input is the Typst source text and the output is the compiled document. The document format is inferred by the file extension of output, which may be pdf, png, or svg. The document may be automatically opened by the default viewer.

Examples

julia> render(Any[true 1; 1.2 1 // 2]);
source

Base

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

See also TypstCommand.

Examples

julia> help = typst`help`
+context...)

Render to a document using show(::IO, ::MIME"text/typst", ::Typst).

This generates two files: the input is the Typst source text and the output is the compiled document. The document format is inferred by the file extension of output, which may be pdf, png, or svg. The document may be automatically opened by the default viewer.

Examples

julia> render(Any[true 1; 1.2 1 // 2]);
source

Base

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

See also TypstCommand.

Examples

julia> help = typst`help`
 typst`help`
 
 julia> help == help
 true
 
 julia> help == TypstCommand(help; ignorestatus = true)
-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)

Return a TypstCommand that does not throw a TypstError if the Typst compiler throws an error.

Errors thrown by the Typst compiler are printed to stderr regardless.

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)

Return a TypstCommand that does not throw a TypstError if the Typst compiler throws an error.

Errors thrown by the Typst compiler are printed to stderr regardless.

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

If the Typst compiler throws an error, it will be printed to stderr. Then, a Julia TypstError will be thrown unless the ignorestatus flag is set.

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.showMethod
show(::IO, ::Union{
+ 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

If the Typst compiler throws an error, it will be printed to stderr. Then, a Julia TypstError will be thrown unless the ignorestatus flag is set.

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.showMethod
show(::IO, ::Union{
     MIME"application/pdf", MIME"image/png", MIME"image/svg+xml"
-}, ::Union{Typst, TypstString, TypstText})

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

The preamble keyword parameter used by render may be specified in an IOContext.

Environments, such as Pluto.jl notebooks, may use these methods to display Typsts, TypstStrings, and TypstTexts.

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(String[])`
source
+}, ::Union{Typst, TypstString, TypstText})

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

The preamble keyword parameter used by render may be specified in an IOContext.

Environments, such as Pluto.jl notebooks, may use these methods to display Typsts, TypstStrings, and TypstTexts.

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(String[])`
source
diff --git a/development/manual/extensions/index.html b/development/manual/extensions/index.html index c82c937..70964a2 100644 --- a/development/manual/extensions/index.html +++ b/development/manual/extensions/index.html @@ -1,2 +1,2 @@ -Extensions · Typstry.jl
+Extensions · Typstry.jl
diff --git a/development/manual/internals/index.html b/development/manual/internals/index.html index 7084467..bb1a691 100644 --- a/development/manual/internals/index.html +++ b/development/manual/internals/index.html @@ -1,44 +1,44 @@ -Internals · Typstry.jl

Internals

Strings

Typstry.Strings.backticksFunction
backticks(io)

Return to io[:backticks]::Int.

Examples

julia> Typstry.Strings.backticks(IOContext(stdout, :backticks => 3))
-3
source
Typstry.Strings.blockFunction
block(io)

Return io[:block]::Bool.

Examples

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

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

See also Mode and mode.

Examples

julia> Typstry.Strings.code_mode(IOContext(stdout, :mode => code))
+Internals · Typstry.jl

Internals

Strings

Typstry.Strings.backticksFunction
backticks(io)

Return to io[:backticks]::Int.

Examples

julia> Typstry.Strings.backticks(IOContext(stdout, :backticks => 3))
+3
source
Typstry.Strings.blockFunction
block(io)

Return io[:block]::Bool.

Examples

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

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

See also Mode and mode.

Examples

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

Return io[:depth]::Int.

Examples

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

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

Examples

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

Examples

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

Return io[:depth]::Int.

Examples

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

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

Examples

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

Examples

julia> Typstry.Strings.format(MIME"application/pdf"())
 "pdf"
 
 julia> Typstry.Strings.format(MIME"image/png"())
 "png"
 
 julia> Typstry.Strings.format(MIME"image/svg+xml"())
-"svg"
source
Typstry.Strings.join_withFunction
join_with(f, io, xs, delimeter; kwargs...)

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

Examples

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

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

Examples

julia> Typstry.Strings.math_pad(IOContext(stdout, :mode => math))
+"svg"
source
Typstry.Strings.join_withFunction
join_with(f, io, xs, delimeter; kwargs...)

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

Examples

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

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

Examples

julia> Typstry.Strings.math_pad(IOContext(stdout, :mode => math))
 ""
 
 julia> Typstry.Strings.math_pad(IOContext(stdout, :block => true, :mode => markup))
 "\$ "
 
 julia> Typstry.Strings.math_pad(IOContext(stdout, :block => false, :mode => markup))
-"\$"
source
Typstry.Strings.maybe_wrapFunction
maybe_wrap(::Any)

Wrap the value in Typst unless it is a TypstString or TypstText.

Examples

julia> Typstry.Strings.maybe_wrap(1)
 Typst{Int64}(1)
 
 julia> Typstry.Strings.maybe_wrap(TypstString(1))
 typst"$1$"
 
 julia> Typstry.Strings.maybe_wrap(TypstText(1))
-TypstText{Int64}(1)
source
Typstry.Strings.modeFunction
mode(io)

Return io[:mode]::Mode.

See also Mode.

Examples

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

Return io[:parenthesize]::Bool.

Examples

julia> Typstry.Strings.parenthesize(IOContext(stdout, :parenthesize => true))
-true
source
Typstry.Strings.modeFunction
mode(io)

Return io[:mode]::Mode.

See also Mode.

Examples

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

Return io[:parenthesize]::Bool.

Examples

julia> Typstry.Strings.parenthesize(IOContext(stdout, :parenthesize => true))
+true
source
Typstry.Strings.show_parametersFunction
show_parameters(io, f, keys, final)

Examples

julia> Typstry.Strings.show_parameters(
            IOContext(stdout, :depth => 0, :tab_size => 2, :delim => typst"\"(\""),
        "vec", [:delim, :gap], true)
 vec(
-  delim: "(",
source
Typstry.Strings.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

Dates.jl

Info

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

Typstry.Strings.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

Dates.jl

Info

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

Commands

+})
source

Commands

diff --git a/development/manual/strings/index.html b/development/manual/strings/index.html index 68a0871..eff803f 100644 --- a/development/manual/strings/index.html +++ b/development/manual/strings/index.html @@ -3,22 +3,22 @@ Enum Mode: code = 0 markup = 1 -math = 2source
Typstry.Strings.TypstType
Typst{T}
+math = 2
source
Typstry.Strings.TypstType
Typst{T}
 Typst(::T)

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

julia> Typst(1)
 Typst{Int64}(1)
 
 julia> Typst("a")
-Typst{String}("a")
source
Typstry.Strings.TypstStringType
TypstString <: AbstractString
+Typst{String}("a")
source
Typstry.Strings.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", ::Typst) 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 in unexpected behavior.

Examples

julia> TypstString(1)
 typst"$1$"
 
 julia> TypstString(1 + 2im; mode = math)
-typst"(1 + 2i)"
source
Typstry.Strings.TypstTextType
TypstText{T}
+typst"(1 + 2i)"
source
Typstry.Strings.TypstTextType
TypstText{T}
 TypstText(::Any)

A wrapper whose show_typst method uses print.

Info

This may be used to insert control characters into a TypstString. Unescaped control characters in TypstStrings may break formatting in some environments, such as the REPL.

Examples

julia> TypstText(1)
 TypstText{Int64}(1)
 
 julia> TypstText("a")
-TypstText{String}("a")
source
Typstry.Strings.@typst_strMacro
@typst_str(s)
+TypstText{String}("a")
source
Typstry.Strings.@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. Values may be interpolated by calling the TypstString constructor, except using a backslash instead of the type name. Interpolation syntax may be escaped in the same manner as quotation marks.

Tip

Print directly to an IO using show(::IO, ::MIME"text/typst", ::Typst).

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

Examples

julia> x = 1;
 
 julia> typst"$ \(x; mode = math) / \(x + 1; mode = math) $"
@@ -31,32 +31,32 @@
 typst"(1 / 2)"
 
 julia> typst"\\(x)"
-typst"\\(x)"
source
Typstry.Strings.codeConstant
code

A Typst syntactical Mode prefixed by the number sign.

Examples

julia> code
-code::Mode = 0
source
Typstry.Strings.markupConstant
markup

A Typst syntactical Mode at the top-level of source text and enclosed within square brackets.

julia> markup
-markup::Mode = 1
source
Typstry.Strings.mathConstant
math

A Typst syntactical Mode enclosed within dollar signs.

julia> math
-math::Mode = 2
source
Typstry.Strings.contextFunction
context(x)

Provide formatting data for show(::IO, ::MIME"text/typst", ::Typst).

Implement this function for a custom type to specify its custom settings and parameters. Passing a value wrapped in Typst will merge! its custom context with defaults, such that the defaults may be overwritten. To be compatible with merging contexts and constructing an IOContext, methods must return an AbstractDict{Symbol}.

SettingDefaultTypeDescription
:backticks3IntThe number of backticks to enclose raw text markup, which may be increased to disambiguiate nested raw text.
: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.
:modemarkupModeThe current Typst syntactical 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 to specify their operator precedence and avoid ambiguity.
:tab_size2IntThe number of spaces used by some elements with multi-line Typst formatting, which is repeated for each level of depth
source
Typstry.Strings.show_typstMethod
show_typst(io, x)

Print in Typst format with Julia settings and Typst parameters provided by an IOContext.

Implement this function for a custom type to specify its Typst formatting. A setting is a value used in Julia, whose type varies across settings. A parameter is passed directly to a Typst function and must be a TypstString with the same name as in Typst, except that dashes are replaced with underscores. Some settings, such as block, correspond with a parameter but may be used in Julia.

For additional information on settings and parameters, see also context and the Typst Documentation, respectively.

Info

Some types, particularly containers, may call show(::IO, ::MIME"text/typst", ::Typst) to format a value, which may use additional settings and parameters.

Warning

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

TypeSettingsParameters
AbstractArray:block, :depth, :mode, :tab_size:delim,:gap`
AbstractChar
AbstractFloat:mode
AbstractMatrix:block, :depth, :mode, :tab_size:augment, :columngap,:delim,:gap,:rowgap`
AbstractString
Bool:mode
Complex{Bool}:block, :mode, :parenthesize
Complex:block, :mode, :parenthesize
Irrational:mode
Nothing:mode
OrdinalRange{<:Integer, <:Integer}:mode
Rational:block, :mode, :parenthesize
Regex:mode
Signed:mode
StepRangeLen{<:Integer, <:Integer, <:Integer}:mode
String:mode
Tuple:block, :depth, :mode, :tab_size:delim, :gap
Typst
TypstString
TypstText:mode
Unsigned:mode
VersionNumber:mode
Docs.HTML:block, :depth, :mode, :tab_size
Docs.Text:mode
Dates.Date:mode, :indent
Dates.DateTime:mode, :indent
Dates.Day:mode, :indent
Dates.Hour:mode, :indent
Dates.Minute:mode, :indent
Dates.Second:mode, :indent
Dates.Time:mode, :indent
Dates.Week:mode, :indent

```

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"\\(x)"
source
Typstry.Strings.codeConstant
code

A Typst syntactical Mode prefixed by the number sign.

Examples

julia> code
+code::Mode = 0
source
Typstry.Strings.markupConstant
markup

A Typst syntactical Mode at the top-level of source text and enclosed within square brackets.

julia> markup
+markup::Mode = 1
source
Typstry.Strings.mathConstant
math

A Typst syntactical Mode enclosed within dollar signs.

julia> math
+math::Mode = 2
source
Typstry.Strings.contextFunction
context(x)

Provide formatting data for show(::IO, ::MIME"text/typst", ::Typst).

Implement this function for a custom type to specify its custom settings and parameters. Passing a value wrapped in Typst will merge! its custom context with defaults, such that the defaults may be overwritten. To be compatible with merging contexts and constructing an IOContext, methods must return an AbstractDict{Symbol}.

SettingDefaultTypeDescription
:backticks3IntThe number of backticks to enclose raw text markup, which may be increased to disambiguiate nested raw text.
: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.
:modemarkupModeThe current Typst syntactical 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 to specify their operator precedence and avoid ambiguity.
:tab_size2IntThe number of spaces used by some elements with multi-line Typst formatting, which is repeated for each level of depth
source
Typstry.Strings.show_typstMethod
show_typst(io, x)

Print in Typst format with Julia settings and Typst parameters provided by an IOContext.

Implement this function for a custom type to specify its Typst formatting. A setting is a value used in Julia, whose type varies across settings. A parameter is passed directly to a Typst function and must be a TypstString with the same name as in Typst, except that dashes are replaced with underscores. Some settings, such as block, correspond with a parameter but may be used in Julia.

For additional information on settings and parameters, see also context and the Typst Documentation, respectively.

Info

Some types, particularly containers, may call show(::IO, ::MIME"text/typst", ::Typst) to format a value, which may use additional settings and parameters.

Warning

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

TypeSettingsParameters
AbstractArray:block, :depth, :mode, :tab_size:delim,:gap`
AbstractChar
AbstractFloat:mode
AbstractMatrix:block, :depth, :mode, :tab_size:augment, :columngap,:delim,:gap,:rowgap`
AbstractString
Bool:mode
Complex{Bool}:block, :mode, :parenthesize
Complex:block, :mode, :parenthesize
Irrational:mode
Nothing:mode
OrdinalRange{<:Integer, <:Integer}:mode
Rational:block, :mode, :parenthesize
Regex:mode
Signed:mode
StepRangeLen{<:Integer, <:Integer, <:Integer}:mode
String:mode
Tuple:block, :depth, :mode, :tab_size:delim, :gap
Typst
TypstString
TypstText:mode
Unsigned:mode
VersionNumber:mode
Docs.HTML:block, :depth, :mode, :tab_size
Docs.Text:mode
Dates.Date:mode, :indent
Dates.DateTime:mode, :indent
Dates.Day:mode, :indent
Dates.Hour:mode, :indent
Dates.Minute:mode, :indent
Dates.Second:mode, :indent
Dates.Time:mode, :indent
Dates.Week:mode, :indent

```

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("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("text/plain", typst"a")
 "typst\"a\""
 
 julia> repr("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, TypstText})

Print the Typst format.

This method provides formatting data to show_typst specified by a default and custom context.

See also TypstString and TypstText.

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, TypstText})

Print the Typst format.

This method provides formatting data to show_typst specified by a default and custom context.

See also TypstString and TypstText.

Examples

julia> show(stdout, "text/typst", typst"a")
 a
 
 julia> show(stdout, "text/typst", Typst("a"))
 "a"
 
 julia> show(stdout, "text/typst", Typst(Text("a")))
-a
source
+asource diff --git a/development/tutorials/interface/index.html b/development/tutorials/interface/index.html index d4ec5b8..a003627 100644 --- a/development/tutorials/interface/index.html +++ b/development/tutorials/interface/index.html @@ -66,4 +66,4 @@ range(0, 7, step: 2) julia> println(TypstString(0:2.0:6; mode = code)) -(0.0, 2.0, 4.0, 6.0) +(0.0, 2.0, 4.0, 6.0) diff --git a/development/tutorials/makie_tex.svg b/development/tutorials/makie_tex.svg index e7207eb..535326e 100644 --- a/development/tutorials/makie_tex.svg +++ b/development/tutorials/makie_tex.svg @@ -1,4 +1,26 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/development/tutorials/packages/index.html b/development/tutorials/packages/index.html index 042edd8..86d672e 100644 --- a/development/tutorials/packages/index.html +++ b/development/tutorials/packages/index.html @@ -1,25 +1,5 @@ -Packages · Typstry.jl

Packages

MakieTeX.jl

Note

This package re-exports @typst_str and TypstString.

julia> using CairoMakie, MakieTeXERROR: LoadError: UndefVarError: `make_block_docstring` not defined
-Stacktrace:
- [1] top-level scope
-   @ ~/.julia/packages/Makie/rEu75/src/makielayout/blocks.jl:114
- [2] include(mod::Module, _path::String)
-   @ Base ./Base.jl:495
- [3] include(x::String)
-   @ MakieTeX ~/.julia/packages/MakieTeX/KAivD/src/MakieTeX.jl:1
- [4] top-level scope
-   @ ~/.julia/packages/MakieTeX/KAivD/src/MakieTeX.jl:35
- [5] include
-   @ ./Base.jl:495 [inlined]
- [6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
-   @ Base ./loading.jl:2222
- [7] top-level scope
-   @ stdin:3
-in expression starting at /home/runner/.julia/packages/MakieTeX/KAivD/src/layoutable.jl:5
-in expression starting at /home/runner/.julia/packages/MakieTeX/KAivD/src/MakieTeX.jl:1
-in expression starting at stdin:3
-ERROR: Failed to precompile MakieTeX [6d554a22-29e7-47bd-aee5-0c5f06619414] to "/home/runner/.julia/compiled/v1.10/MakieTeX/jl_ZfC0re".
julia> f = Figure(; size = (100, 100));
julia> LTeX(f[1, 1], TypstDocument(typst"$1 / x$"); scale = 5);ERROR: LoadError: UndefVarError: `@typst_str` not defined -in expression starting at REPL[4]:2
julia> save("makie_tex.svg", f);

MakieTeX.jl

TypstJlyfish.jl

#set page(margin: 1em, height: auto, width: auto, fill: white)
+Packages · Typstry.jl

Packages

MakieTeX.jl

Note

This package re-exports @typst_str and TypstString.

julia> using CairoMakie, MakieTeX
julia> f = Figure(; size = (100, 100));
julia> LTeX(f[1, 1], TypstDocument(typst"$1 / x$"); scale = 5);
julia> save("makie_tex.svg", f);

MakieTeX.jl

TypstJlyfish.jl

#set page(margin: 1em, height: auto, width: auto, fill: white)
 #set text(16pt, font: "JuliaMono")
 #import "@preview/jlyfish:0.1.0": *
 #read-julia-output(json("typst_jlyfish.json"))
@@ -28,7 +8,7 @@
 
julia> using TypstJlyfish
julia> TypstJlyfish.compile("typst_jlyfish.typ"; evaluation_file = "typst_jlyfish.json", typst_compile_args = "--format=svg" - ) Activating new project at `/tmp/jlyfish-evalXzLRzd` + ) Activating new project at `/tmp/jlyfish-evalNu7Ze5` [ Info: Output written to file typst_jlyfish.json downloading @preview/jlyfish:0.1.0 2.7 KiB / 2.7 KiB (100 %) 2.7 KiB/s in 0s ETA: 0s @@ -40,9 +20,9 @@ Updating registry at `~/.julia/registries/General.toml` Resolving package versions... Installed Typstry ─ v0.2.0 - Updating `/tmp/jlyfish-evalXzLRzd/Project.toml` + Updating `/tmp/jlyfish-evalNu7Ze5/Project.toml` [f0ed7684] + Typstry v0.2.0 - Updating `/tmp/jlyfish-evalXzLRzd/Manifest.toml` + Updating `/tmp/jlyfish-evalNu7Ze5/Manifest.toml` [692b3bcd] + JLLWrappers v1.5.0 [aea7be01] + PrecompileTools v1.2.1 [21216c6a] + Preferences v1.4.3 @@ -62,4 +42,4 @@ [ Info: Evaluating `using Typstry; typst"$1 / x$"` ... [ Info: Output written to file typst_jlyfish.json [ Info: Compiling document... -[ Info: Done.

TypstJlyfish.jl

+[ Info: Done.

TypstJlyfish.jl