mirror of
https://github.com/typst/typst
synced 2025-07-27 14:27:56 +08:00
Add 0.15.0 as removal version to deprecated bindings
Note that `path` was left out because it may not be removed, but replaced by a path type constructor right away.
This commit is contained in:
parent
44c573d1a0
commit
9eb2cafcc3
@ -33,7 +33,10 @@ pub fn cbor(
|
||||
impl cbor {
|
||||
/// Reads structured data from CBOR bytes.
|
||||
#[func(title = "Decode CBOR")]
|
||||
#[deprecated = "`cbor.decode` is deprecated, directly pass bytes to `cbor` instead"]
|
||||
#[deprecated(
|
||||
message = "`cbor.decode` is deprecated, directly pass bytes to `cbor` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// CBOR data.
|
||||
|
@ -95,7 +95,10 @@ pub fn csv(
|
||||
impl csv {
|
||||
/// Reads structured data from a CSV string/bytes.
|
||||
#[func(title = "Decode CSV")]
|
||||
#[deprecated = "`csv.decode` is deprecated, directly pass bytes to `csv` instead"]
|
||||
#[deprecated(
|
||||
message = "`csv.decode` is deprecated, directly pass bytes to `csv` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// CSV data.
|
||||
|
@ -67,7 +67,10 @@ pub fn json(
|
||||
impl json {
|
||||
/// Reads structured data from a JSON string/bytes.
|
||||
#[func(title = "Decode JSON")]
|
||||
#[deprecated = "`json.decode` is deprecated, directly pass bytes to `json` instead"]
|
||||
#[deprecated(
|
||||
message = "`json.decode` is deprecated, directly pass bytes to `json` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// JSON data.
|
||||
|
@ -41,7 +41,10 @@ pub fn toml(
|
||||
impl toml {
|
||||
/// Reads structured data from a TOML string/bytes.
|
||||
#[func(title = "Decode TOML")]
|
||||
#[deprecated = "`toml.decode` is deprecated, directly pass bytes to `toml` instead"]
|
||||
#[deprecated(
|
||||
message = "`toml.decode` is deprecated, directly pass bytes to `toml` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// TOML data.
|
||||
|
@ -75,7 +75,10 @@ pub fn xml(
|
||||
impl xml {
|
||||
/// Reads structured data from an XML string/bytes.
|
||||
#[func(title = "Decode XML")]
|
||||
#[deprecated = "`xml.decode` is deprecated, directly pass bytes to `xml` instead"]
|
||||
#[deprecated(
|
||||
message = "`xml.decode` is deprecated, directly pass bytes to `xml` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// XML data.
|
||||
|
@ -54,7 +54,10 @@ pub fn yaml(
|
||||
impl yaml {
|
||||
/// Reads structured data from a YAML string/bytes.
|
||||
#[func(title = "Decode YAML")]
|
||||
#[deprecated = "`yaml.decode` is deprecated, directly pass bytes to `yaml` instead"]
|
||||
#[deprecated(
|
||||
message = "`yaml.decode` is deprecated, directly pass bytes to `yaml` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
engine: &mut Engine,
|
||||
/// YAML data.
|
||||
|
@ -169,7 +169,10 @@ pub struct ImageElem {
|
||||
impl ImageElem {
|
||||
/// Decode a raster or vector graphic from bytes or a string.
|
||||
#[func(title = "Decode Image")]
|
||||
#[deprecated = "`image.decode` is deprecated, directly pass bytes to `image` instead"]
|
||||
#[deprecated(
|
||||
message = "`image.decode` is deprecated, directly pass bytes to `image` instead",
|
||||
until = "0.15.0"
|
||||
)]
|
||||
pub fn decode(
|
||||
span: Span,
|
||||
/// The data to decode as an image. Can be a string for SVGs.
|
||||
|
@ -46,6 +46,7 @@ pub(super) fn define(global: &mut Scope) {
|
||||
.deprecated("the `path` function is deprecated, use `curve` instead");
|
||||
global
|
||||
.define("pattern", Type::of::<Tiling>())
|
||||
.deprecated("the name `pattern` is deprecated, use `tiling` instead");
|
||||
.deprecated("the name `pattern` is deprecated, use `tiling` instead")
|
||||
.deprecated_until("0.15.0");
|
||||
global.reset_category();
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
--- cbor-decode-deprecated ---
|
||||
// Warning: 15-21 `cbor.decode` is deprecated, directly pass bytes to `cbor` instead
|
||||
// Hint: 15-21 this will be removed in 0.15.0
|
||||
#let _ = cbor.decode
|
||||
|
@ -32,4 +32,5 @@
|
||||
|
||||
--- csv-decode-deprecated ---
|
||||
// Warning: 14-20 `csv.decode` is deprecated, directly pass bytes to `csv` instead
|
||||
// Hint: 14-20 this will be removed in 0.15.0
|
||||
#let _ = csv.decode
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
--- json-decode-deprecated ---
|
||||
// Warning: 15-21 `json.decode` is deprecated, directly pass bytes to `json` instead
|
||||
// Hint: 15-21 this will be removed in 0.15.0
|
||||
#let _ = json.decode
|
||||
|
||||
--- issue-3363-json-large-number ---
|
||||
|
@ -42,4 +42,5 @@
|
||||
|
||||
--- toml-decode-deprecated ---
|
||||
// Warning: 15-21 `toml.decode` is deprecated, directly pass bytes to `toml` instead
|
||||
// Hint: 15-21 this will be removed in 0.15.0
|
||||
#let _ = toml.decode
|
||||
|
@ -29,4 +29,5 @@
|
||||
|
||||
--- xml-decode-deprecated ---
|
||||
// Warning: 14-20 `xml.decode` is deprecated, directly pass bytes to `xml` instead
|
||||
// Hint: 14-20 this will be removed in 0.15.0
|
||||
#let _ = xml.decode
|
||||
|
@ -18,4 +18,5 @@
|
||||
|
||||
--- yaml-decode-deprecated ---
|
||||
// Warning: 15-21 `yaml.decode` is deprecated, directly pass bytes to `yaml` instead
|
||||
// Hint: 15-21 this will be removed in 0.15.0
|
||||
#let _ = yaml.decode
|
||||
|
@ -188,26 +188,31 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B
|
||||
--- image-decode-svg ---
|
||||
// Test parsing from svg data
|
||||
// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead
|
||||
// Hint: 8-14 this will be removed in 0.15.0
|
||||
#image.decode(`<svg xmlns="http://www.w3.org/2000/svg" height="140" width="500"><ellipse cx="200" cy="80" rx="100" ry="50" style="fill:yellow;stroke:purple;stroke-width:2" /></svg>`.text, format: "svg")
|
||||
|
||||
--- image-decode-bad-svg ---
|
||||
// Error: 15-152 failed to parse SVG (missing root node at 1:1)
|
||||
// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead
|
||||
// Hint: 8-14 this will be removed in 0.15.0
|
||||
#image.decode(`<svg height="140" width="500"><ellipse cx="200" cy="80" rx="100" ry="50" style="fill:yellow;stroke:purple;stroke-width:2" /></svg>`.text, format: "svg")
|
||||
|
||||
--- image-decode-detect-format ---
|
||||
// Test format auto detect
|
||||
// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead
|
||||
// Hint: 8-14 this will be removed in 0.15.0
|
||||
#image.decode(read("/assets/images/tiger.jpg", encoding: none), width: 80%)
|
||||
|
||||
--- image-decode-specify-format ---
|
||||
// Test format manual
|
||||
// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead
|
||||
// Hint: 8-14 this will be removed in 0.15.0
|
||||
#image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "jpg", width: 80%)
|
||||
|
||||
--- image-decode-specify-wrong-format ---
|
||||
// Error: 2-91 failed to decode image (Format error decoding Png: Invalid PNG signature.)
|
||||
// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead
|
||||
// Hint: 8-14 this will be removed in 0.15.0
|
||||
#image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "png", width: 80%)
|
||||
|
||||
--- image-pixmap-empty ---
|
||||
|
@ -161,5 +161,6 @@
|
||||
#set page(width: auto, height: auto, margin: 0pt)
|
||||
|
||||
// Warning: 10-17 the name `pattern` is deprecated, use `tiling` instead
|
||||
// Hint: 10-17 this will be removed in 0.15.0
|
||||
#let t = pattern(size: (10pt, 10pt), line(stroke: 4pt, start: (0%, 0%), end: (100%, 100%)))
|
||||
#rect(width: 50pt, height: 50pt, fill: t)
|
||||
|
Loading…
x
Reference in New Issue
Block a user