Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

read自始可用Go to source

Reads plain text or data from a file.

By default, the file will be read as UTF-8 and returned as a string.

If you specify encoding: none, this returns raw bytes instead.

Example

An example for a HTML file: \ #let text = read("example.html") #raw(text, block: true, lang: "html") Raw bytes: #read("tiger.jpg", encoding: none)

参数
Question mark

path
str or path
必需参数
Question mark
位置参数
Question mark

Path to a file.

encoding默认值:"utf8"

The encoding to read the file with.

If set to none, this function returns raw bytes.

VariantDetails
"utf8"The Unicode UTF-8 encoding.