diff --git a/crates/typst-library/src/foundations/datetime.rs b/crates/typst-library/src/foundations/datetime.rs index ffc6aaafa..5f72d817d 100644 --- a/crates/typst-library/src/foundations/datetime.rs +++ b/crates/typst-library/src/foundations/datetime.rs @@ -17,8 +17,7 @@ use crate::foundations::{ /// Represents a date, a time, or a combination of both. /// /// Can be created by either specifying a custom datetime using this type's -/// constructor function or getting the current date with -/// [`datetime.today`]($datetime.today). +/// constructor function or getting the current date with [`datetime.today`]. /// /// # Example /// ```example diff --git a/crates/typst-library/src/foundations/decimal.rs b/crates/typst-library/src/foundations/decimal.rs index 998de8e95..d1291c346 100644 --- a/crates/typst-library/src/foundations/decimal.rs +++ b/crates/typst-library/src/foundations/decimal.rs @@ -41,8 +41,8 @@ use crate::foundations::{Repr, Str, cast, func, repr, scope, ty}; /// constant decimal values instead (e.g. `{decimal("3.14")}`). /// /// The precision of a `float` to `decimal` cast can be slightly improved by -/// rounding the result to 15 digits with [`calc.round`]($calc.round), but there -/// are still no precision guarantees for that kind of conversion. +/// rounding the result to 15 digits with [`calc.round`], but there are still no +/// precision guarantees for that kind of conversion. /// /// # Operations /// Basic arithmetic operations are supported on two decimals and on pairs of diff --git a/crates/typst-library/src/foundations/func.rs b/crates/typst-library/src/foundations/func.rs index da498a407..bf1c384b5 100644 --- a/crates/typst-library/src/foundations/func.rs +++ b/crates/typst-library/src/foundations/func.rs @@ -59,9 +59,9 @@ use crate::foundations::{ /// /// # Function scopes /// Functions can hold related definitions in their own scope, similar to a -/// [module]($scripting/#modules). Examples of this are -/// [`assert.eq`]($assert.eq) or [`list.item`]($list.item). However, this -/// feature is currently only available for built-in functions. +/// [module]($scripting/#modules). Examples of this are [`assert.eq`] or +/// [`list.item`]. However, this feature is currently only available for +/// built-in functions. /// /// # Defining functions /// You can define your own function with a [let binding]($scripting/#bindings) diff --git a/crates/typst-library/src/foundations/mod.rs b/crates/typst-library/src/foundations/mod.rs index 8a94107c2..0af9d46de 100644 --- a/crates/typst-library/src/foundations/mod.rs +++ b/crates/typst-library/src/foundations/mod.rs @@ -154,8 +154,8 @@ pub fn panic( /// Fails with an error if the condition is not fulfilled. Does not /// produce any output in the document. /// -/// If you wish to test equality between two values, see -/// [`assert.eq`]($assert.eq) and [`assert.ne`]($assert.ne). +/// If you wish to test equality between two values, see [`assert.eq`] and +/// [`assert.ne`]. /// /// # Example /// ```typ diff --git a/crates/typst-library/src/introspection/query.rs b/crates/typst-library/src/introspection/query.rs index 65afe9e75..f6f5b6e93 100644 --- a/crates/typst-library/src/introspection/query.rs +++ b/crates/typst-library/src/introspection/query.rs @@ -141,7 +141,7 @@ use crate::foundations::{Array, Context, LocatableSelector, Value, func}; /// /// In case you need to query a document when exporting for a specific target, /// you can use the `--target` argument. Valid values are `paged`, and `html` -/// (if the [`html`]($html) feature is enabled). +/// (if the [`html`] feature is enabled). #[func(contextual)] pub fn query( engine: &mut Engine, diff --git a/crates/typst-library/src/layout/grid/mod.rs b/crates/typst-library/src/layout/grid/mod.rs index 7db00cff4..03e9a3114 100644 --- a/crates/typst-library/src/layout/grid/mod.rs +++ b/crates/typst-library/src/layout/grid/mod.rs @@ -62,8 +62,8 @@ use crate::visualize::{Paint, Stroke}; /// /// # Examples /// The example below demonstrates the different track sizing options. It also -/// shows how you can use [`grid.cell`]($grid.cell) to make an individual cell -/// span two grid tracks. +/// shows how you can use [`grid.cell`] to make an individual cell span two grid +/// tracks. /// /// ```example /// // We use `rect` to emphasize the @@ -111,15 +111,14 @@ use crate::visualize::{Paint, Stroke}; /// stroke /// /// If you need to override one of the above options for a single cell, you can -/// use the [`grid.cell`]($grid.cell) element. Likewise, you can override -/// individual grid lines with the [`grid.hline`]($grid.hline) and -/// [`grid.vline`]($grid.vline) elements. +/// use the [`grid.cell`] element. Likewise, you can override individual grid +/// lines with the [`grid.hline`] and [`grid.vline`] elements. /// /// Alternatively, if you need the appearance options to depend on a cell's /// position (column and row), you may specify a function to `fill` or `align` /// of the form `(column, row) => value`. You may also use a show rule on -/// [`grid.cell`]($grid.cell) - see that element's examples or the examples -/// below for more information. +/// [`grid.cell`] - see that element's examples or the examples below for more +/// information. /// /// Locating most of your styling in set and show rules is recommended, as it /// keeps the grid's or table's actual usages clean and easy to read. It also @@ -202,8 +201,8 @@ pub struct GridElem { /// The function receives the cells' column and row indices, starting from /// zero. If set to `{auto}`, the outer alignment is used. /// - /// You can find an example for this argument at the - /// [`table.align`]($table.align) parameter. + /// You can find an example for this argument at the [`table.align`] + /// parameter. pub align: Celled>, /// How to [stroke]($stroke) the cells. @@ -214,8 +213,7 @@ pub struct GridElem { /// If it is necessary to place lines which can cross spacing between cells /// produced by the `gutter` option, or to override the stroke between /// multiple specific cells, consider specifying one or more of - /// [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline) alongside - /// your grid cells. + /// [`grid.hline`] and [`grid.vline`] alongside your grid cells. /// /// ```example /// #set page(height: 13em, width: 26em) @@ -288,14 +286,13 @@ pub struct GridElem { /// How much to pad the cells' content. /// - /// You can find an example for this argument at the - /// [`table.inset`]($table.inset) parameter. + /// You can find an example for this argument at the [`table.inset`] + /// parameter. #[fold] pub inset: Celled>>>, - /// The contents of the grid cells, plus any extra grid lines specified - /// with the [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline) - /// elements. + /// The contents of the grid cells, plus any extra grid lines specified with + /// the [`grid.hline`] and [`grid.vline`] elements. /// /// The cells are populated in row-major order. #[variadic] @@ -445,8 +442,8 @@ impl TryFrom for GridItem { /// A repeatable grid header. /// /// If `repeat` is set to `true`, the header will be repeated across pages. For -/// an example, refer to the [`table.header`]($table.header) element and the -/// [`grid.stroke`]($grid.stroke) parameter. +/// an example, refer to the [`table.header`] element and the [`grid.stroke`] +/// parameter. #[elem(name = "header", title = "Grid Header")] pub struct GridHeader { /// Whether this header should be repeated across pages. @@ -471,8 +468,8 @@ pub struct GridHeader { /// A repeatable grid footer. /// -/// Just like the [`grid.header`]($grid.header) element, the footer can repeat -/// itself on every page of the table. +/// Just like the [`grid.header`] element, the footer can repeat itself on every +/// page of the table. /// /// No other grid cells may be placed after the footer. #[elem(name = "footer", title = "Grid Footer")] @@ -492,8 +489,7 @@ pub struct GridFooter { /// `stroke` field. Can cross spacing between cells created through the grid's /// `column-gutter` option. /// -/// An example for this function can be found at the -/// [`table.hline`]($table.hline) element. +/// An example for this function can be found at the [`table.hline`] element. #[elem(name = "hline", title = "Grid Horizontal Line")] pub struct GridHLine { /// The row above which the horizontal line is placed (zero-indexed). @@ -638,8 +634,8 @@ pub struct GridVLine { /// /// You may also apply a show rule on `grid.cell` to style all cells at once, /// which allows you, for example, to apply styles based on a cell's position. -/// Refer to the examples of the [`table.cell`]($table.cell) element to learn -/// more about this. +/// Refer to the examples of the [`table.cell`] element to learn more about +/// this. #[elem(name = "cell", title = "Grid Cell")] pub struct GridCell { /// The cell's body. diff --git a/crates/typst-library/src/layout/page.rs b/crates/typst-library/src/layout/page.rs index 8f4fd0e63..461ff5800 100644 --- a/crates/typst-library/src/layout/page.rs +++ b/crates/typst-library/src/layout/page.rs @@ -405,7 +405,7 @@ impl LocalName for PageElem { /// /// Pagination tries to avoid single lines of text at the top or bottom of a /// page (these are called _widows_ and _orphans_). You can adjust the -/// [`text.costs`]($text.costs) parameter to disable this behavior. +/// [`text.costs`] parameter to disable this behavior. #[elem(title = "Page Break")] pub struct PagebreakElem { /// If `{true}`, the page break is skipped if the current page is already diff --git a/crates/typst-library/src/layout/place.rs b/crates/typst-library/src/layout/place.rs index 4c92a8d9f..efdac6726 100644 --- a/crates/typst-library/src/layout/place.rs +++ b/crates/typst-library/src/layout/place.rs @@ -19,8 +19,7 @@ use crate::layout::{Alignment, Em, Length, Rel}; /// [`alignment`]($place.alignment), the offsets `dx` and `dy` will set the /// position of the element's top left corner relatively to the top left corner /// of the text area. For absolute positioning on the full page including -/// margins, you can use `place` in [`page.foreground`]($page.foreground) or -/// [`page.background`]($page.background). +/// margins, you can use `place` in [`page.foreground`] or [`page.background`]. /// /// # Examples /// ```example diff --git a/crates/typst-library/src/model/enum.rs b/crates/typst-library/src/model/enum.rs index adb738879..14811b66c 100644 --- a/crates/typst-library/src/model/enum.rs +++ b/crates/typst-library/src/model/enum.rs @@ -41,8 +41,8 @@ use crate::model::{ListItemLike, ListLike, Numbering, NumberingPattern}; /// + Don't forget step two /// ``` /// -/// You can also use [`enum.item`]($enum.item) to programmatically customize the -/// number of each item in the enumeration: +/// You can also use [`enum.item`] to programmatically customize the number of +/// each item in the enumeration: /// /// ```example /// #enum( diff --git a/crates/typst-library/src/model/footnote.rs b/crates/typst-library/src/model/footnote.rs index 51b9f25fd..7afd31ec2 100644 --- a/crates/typst-library/src/model/footnote.rs +++ b/crates/typst-library/src/model/footnote.rs @@ -23,10 +23,10 @@ use crate::visualize::{LineElem, Stroke}; /// and can break across multiple pages. /// /// To customize the appearance of the entry in the footnote listing, see -/// [`footnote.entry`]($footnote.entry). The footnote itself is realized as a -/// normal superscript, so you can use a set rule on the [`super`] function to -/// customize it. You can also apply a show rule to customize only the footnote -/// marker (superscript number) in the running text. +/// [`footnote.entry`]. The footnote itself is realized as a normal superscript, +/// so you can use a set rule on the [`super`] function to customize it. You can +/// also apply a show rule to customize only the footnote marker (superscript +/// number) in the running text. /// /// # Example /// ```example diff --git a/crates/typst-library/src/model/outline.rs b/crates/typst-library/src/model/outline.rs index 96c4eb2b4..743a287ea 100644 --- a/crates/typst-library/src/model/outline.rs +++ b/crates/typst-library/src/model/outline.rs @@ -382,7 +382,7 @@ impl OutlineEntry { /// If the outline's indent is a fixed value or a function, the prefixes are /// indented, but the inner contents are simply offset from the prefix by /// the specified `gap`, rather than aligning outline-wide. For a visual - /// explanation, see [`outline.indent`]($outline.indent). + /// explanation, see [`outline.indent`]. #[func(contextual)] pub fn indented( &self, diff --git a/crates/typst-library/src/model/reference.rs b/crates/typst-library/src/model/reference.rs index ff695182f..118c597df 100644 --- a/crates/typst-library/src/model/reference.rs +++ b/crates/typst-library/src/model/reference.rs @@ -83,7 +83,7 @@ use crate::text::TextElem; /// When you only ever need to reference pages of a figure/table/heading/etc. in /// a document, the default `form` field value can be changed to `{"page"}` with /// a set rule. If you prefer a short "p." supplement over "page", the -/// [`page.supplement`]($page.supplement) field can be used for changing this: +/// [`page.supplement`] field can be used for changing this: /// /// ```example /// #set page( diff --git a/crates/typst-library/src/model/table.rs b/crates/typst-library/src/model/table.rs index 58dd0e950..2a85ce01c 100644 --- a/crates/typst-library/src/model/table.rs +++ b/crates/typst-library/src/model/table.rs @@ -36,8 +36,8 @@ use crate::visualize::{Paint, Stroke}; /// in the document flow. /// /// Note that, to override a particular cell's properties or apply show rules on -/// table cells, you can use the [`table.cell`]($table.cell) element. See its -/// documentation for more information. +/// table cells, you can use the [`table.cell`] element. See its documentation +/// for more information. /// /// Although the `table` and the `grid` share most properties, set and show /// rules on one of them do not affect the other. @@ -69,8 +69,8 @@ use crate::visualize::{Paint, Stroke}; /// ) /// ``` /// -/// Much like with grids, you can use [`table.cell`]($table.cell) to customize -/// the appearance and the position of each cell. +/// Much like with grids, you can use [`table.cell`] to customize the appearance +/// and the position of each cell. /// /// ```example /// >>> #set page(width: auto) @@ -190,8 +190,7 @@ pub struct TableElem { /// If it is necessary to place lines which can cross spacing between cells /// produced by the `gutter` option, or to override the stroke between /// multiple specific cells, consider specifying one or more of - /// [`table.hline`]($table.hline) and [`table.vline`]($table.vline) - /// alongside your table cells. + /// [`table.hline`] and [`table.vline`] alongside your table cells. /// /// See the [grid documentation]($grid.stroke) for more information on /// strokes. @@ -223,8 +222,7 @@ pub struct TableElem { pub inset: Celled>>>, /// The contents of the table cells, plus any extra table lines specified - /// with the [`table.hline`]($table.hline) and - /// [`table.vline`]($table.vline) elements. + /// with the [`table.hline`] and [`table.vline`] elements. #[variadic] pub children: Vec, } @@ -433,10 +431,10 @@ pub struct TableHeader { /// A repeatable table footer. /// -/// Just like the [`table.header`]($table.header) element, the footer can repeat -/// itself on every page of the table. This is useful for improving legibility -/// by adding the column labels in both the header and footer of a large table, -/// totals, or other information that should be visible on every page. +/// Just like the [`table.header`] element, the footer can repeat itself on +/// every page of the table. This is useful for improving legibility by adding +/// the column labels in both the header and footer of a large table, totals, or +/// other information that should be visible on every page. /// /// No other table cells may be placed after the footer. #[elem(name = "footer", title = "Table Footer")] @@ -514,22 +512,22 @@ pub struct TableHLine { pub position: OuterVAlignment, } -/// A vertical line in the table. See the docs for [`grid.vline`]($grid.vline) -/// for more information regarding how to use this element's fields. +/// A vertical line in the table. See the docs for [`grid.vline`] for more +/// information regarding how to use this element's fields. /// /// Overrides any per-cell stroke, including stroke specified through the /// table's `stroke` field. Can cross spacing between cells created through the /// table's [`row-gutter`]($table.row-gutter) option. /// -/// Similar to [`table.hline`]($table.hline), use this function if you want to -/// manually place a vertical line at a specific position in a single table and -/// use the [table's `stroke`]($table.stroke) field or [`table.cell`'s +/// Similar to [`table.hline`], use this function if you want to manually place +/// a vertical line at a specific position in a single table and use the +/// [table's `stroke`]($table.stroke) field or [`table.cell`'s /// `stroke`]($table.cell.stroke) field instead if the line you want to place is /// part of all your tables' designs. #[elem(name = "vline", title = "Table Vertical Line")] pub struct TableVLine { /// The column before which the vertical line is placed (zero-indexed). - /// Functions identically to the `x` field in [`grid.vline`]($grid.vline). + /// Functions identically to the `x` field in [`grid.vline`]. pub x: Smart, /// The row at which the vertical line starts (zero-indexed, inclusive). @@ -653,11 +651,11 @@ pub struct TableCell { pub body: Content, /// The cell's column (zero-indexed). - /// Functions identically to the `x` field in [`grid.cell`]($grid.cell). + /// Functions identically to the `x` field in [`grid.cell`]. pub x: Smart, /// The cell's row (zero-indexed). - /// Functions identically to the `y` field in [`grid.cell`]($grid.cell). + /// Functions identically to the `y` field in [`grid.cell`]. pub y: Smart, /// The amount of columns spanned by this cell. diff --git a/crates/typst-library/src/visualize/gradient.rs b/crates/typst-library/src/visualize/gradient.rs index 5dda14c71..525fd5012 100644 --- a/crates/typst-library/src/visualize/gradient.rs +++ b/crates/typst-library/src/visualize/gradient.rs @@ -168,12 +168,11 @@ use crate::visualize::{Color, ColorSpace, WeightedColor}; /// consider the following: /// - SVG gradients are currently inefficiently encoded. This will be improved /// in the future. -/// - PDF gradients in the [`color.oklab`]($color.oklab), [`color.hsv`]($color.hsv), -/// [`color.hsl`]($color.hsl), and [`color.oklch`]($color.oklch) color spaces -/// are stored as a list of [`color.rgb`]($color.rgb) colors with extra stops -/// in between. This avoids needing to encode these color spaces in your PDF -/// file, but it does add extra stops to your gradient, which can increase -/// the file size. +/// - PDF gradients in the [`color.oklab`], [`color.hsv`], [`color.hsl`], and +/// [`color.oklch`] color spaces are stored as a list of [`color.rgb`] colors +/// with extra stops in between. This avoids needing to encode these color +/// spaces in your PDF file, but it does add extra stops to your gradient, +/// which can increase the file size. #[ty(scope, cast)] #[derive(Clone, PartialEq, Eq, Hash)] pub enum Gradient {